I tested the new version of the IAP package v. 4.5.0 (Unity 2020.3.38f1), and the system returned a failure when making a purchase using the Deferred options in Google Play.
I don’t have any error related to the IAP package, but the “transaction success” is false, and my server is complaining that it cannot verify the purchase receipt or signature. If I try to purchase in the usual way (not deferred), all works fine.
Can you elaborate what deferred options you are referring to? Please show the code that you are using, specifically to wire up the deferred listener, the listener code, and ProcessPurchase.
My code worked fine with the previous IAP purchase version 4.4.1 and in [version 4.5.0 ]( https://discussions.unity.com/t/632966 page-2#post-8485985)I didn’t see any change about that
In my testing with “Slow Credit Card - Always Approves” , the deferred listener is called immediately, then a few minutes later I receive ProcessPurchase. This is expected behavior. Again, where are you seeing “transaction success = false”? I might suggest to place appropriate Debug.Log statements in all your purchasing methods like in the Sample project. These will show in the device logs which would be very helpful https://discussions.unity.com/t/699654 and https://discussions.unity.com/t/700293/6
I found the issue: the problem is in the new package version 4.5.0. The ProcessPurchase is triggered more quickly than the previous versions, making our purchase flow fail.
I mean, the flow is not the same as what I had:
First is executed the listener SetDeferredPurchaseListener
Few seconds after this is executed, the ProcessPurchase ← this was making fail our purchases
After a few minutes, the ProcessPurchase is executed again.
In previous versions, the flow was:
First is executed the listener SetDeferredPurchaseListener
After a few minutes, the ProcessPurchase is executed again.
I have a fix from my side, but it seems something changed in the way to trigger those events
Version 4.5.1 is now available through the Package Manager. It looks like this is fixed. Please let us know if you experience any issues with the new version.
Is there a way to disable deferred purchases? Documentation on developer.android.com says you need to explicitly call " enablePendingPurchases" in order to enable so called deferred purchases, otherwise they will fail. How can I disable this functionality?
I wanted to disable it so I don’t have to deal with those special cases right now, I guess I misunderstood this is an optional thing. Thanks for such a fast response!