jamesmontemagno / InAppBillingPlugin

Cross-platform In App Billing Plugin for .NET
MIT License
651 stars 152 forks source link

UWP ToInAppBillingPurchase XmlException #52

Closed ozzy1873 closed 7 years ago

ozzy1873 commented 7 years ago

Version Number of Plugin: v1.1.0.35-beta Device Tested On: Windows Phone Version of VS: 2015 Version of Xamarin: Forms 2.3.5.239-pre3

Sorry, don't have steps. But this error only occurs when the Windows store returns a non-XML error response. If there is no Windows store error, the control works great.

jamesmontemagno commented 7 years ago

What is the call stack?

Is it returning a failure of the purchase?

ozzy1873 commented 7 years ago

Unfortunately, I don’t have a usable call stack. Just the exception:

Plugin.InAppBilling.Abstractions.InAppBillingPurchaseException: Unable to process purchase.

I did manage to see this in the debugger once. The problem is that Microsoft does not return XML for the failure. It returns a non-XML error message (“Unable to process purchase”), so the XML parser fails.

jamesmontemagno commented 7 years ago

Ah, I see, but kind of the result is expected that it throws an exception though. Specifically it is an exception that I am catching and then propagating up. It should have an enum on it that says the issue. In this instance you would catch the exception and have the user try to purchase it again. I think it is pretty correct, maybe could tidy it up a bit...

ozzy1873 commented 7 years ago

Yes, I am catching the exception and that works. I just wanted to point it out in case you didn't know about it and thought it should be handled differently. Thanks for the great control!