The product.receipt of a cancelled IAP does not return null. Help?
The product.receipt of a cancelled IAP does not return null.
Here at this link as Unity documentation suggests, you can see that unowned non-consumable products should return a null receipt.
I'd like to unlock my non-consumable IAPs by checking product.hasReceipt but because it returns true for cancelled items, it doesn't work.
How can I solve this?
Answer by tuncOfGrayLake · Apr 22, 2016 at 10:09 AM
Here's what we got so far:
Even if you cancel the receipt for a non-consumable in-app-purchase through Merchant Center it takes some extra hours for its receipt to return as "Cancelled" when you request it through your app.
So someone who's order you cancel will be able to use for a while until some hours after.
If you Debug.Log the JSON of the receipt you can see the purchaseState details as a string. (0 is purchased, 1 is cancelled, 2 is refunded, more info here). We were getting a 0 (purchased) for orders we cancelled. The next day, however, it was fine as we received a null receipt.
Hope this bit of information helps. We're still conducting some tests. If you have more information on this matter, please feel free to share with us or correct us.
Thanks for leaving this answer, I have the same problem. In my case it's a test order on my main development device, so the delay is quite annoying as it prevents me from doing further tests... I wonder if the delay is cause by the store (google in my case), or from the Unity IAP system.