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 1 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?

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.