[Solved] questions about google play payment process

Is there any way for me to know what happened between the google play payment window shows and disappears? Like whether the user encounters some internet error, whether the user got a declined payment, etc.

@Citrusjoy123

When a purchase fails, the OnPurchaseFailed callback is triggered.

The PurchaseFailureReason will give you more specific information about the purchase failure, if available:

https://docs.unity3d.com/ScriptReference/Purchasing.PurchaseFailureReason.html

I do use OnPurchaseFailed callback, and I do check PurchaseFailureReason, but no matter what happens during the payment process, I always get a “canceled reason”, as least on the Google Play platform.

So discussing this issue with our engineers, it seems the case may be that we are not able to get more information from Google Play.

It appears what is most likely happening is that some error message is displayed with an OK button that will close the dialog box. When the user closes the dialog box, Google marks this as a “User Cancelled” event and that is what Unity IAP receives.

There isn’t much we can do on this end, since Unity IAP is just an API that can only use what the stores send us. This may be something you can contact Google about and see if you can suggest more transparency in the errors they report: