I am encountering a bug, seemingly in Unity IAP system, where consumable purchases that were cancelled by the user or that failed for other reasons are still sent through and ProcessPurchase gets called anyway at the next startup of the app, allowing for fake purchases to take place.
This, however, happens only for the first purchase after deleting the app data or installing, but the bug happens again each time data is deleted.
Steps for reproducing are below.
I am mostly using the standard Unity IAP implementation (with code) on Android as per the tutorial.
I have tried checking the receipts but all cancelled/failed orders show correct receipts, also I have tried on accounts that were not on the testers list to see if it was a problem with test credit cards but still it wasn’t working.
I have also noticed that when OnInitialized gets called no product appears to be on the StoreController, so no pending transactions could be found and marked for deletion, but ProcessPurchase will get called regardless.
Steps for reproducing:
- Delete app data from phone or reinstall app.
- Start a purchase and cancel it or leave it in the IAP UI.
- Close the app.
- Open the app again. ProcessPurchase is called as if the first purchase was completed.
- Try again steps 2-4, ProcessPurchase is not called this time.