Hi folks! First, thank you to the Unity IAP Team. Unity IAP is one of the best Unity packages and the support here is excellent. Don’t get me started on Addressables…
Three “best practice” questions about Unity IAP. Let me preface them by saying that I’ve followed all of the Unity IAP tutorials and documentation (which is excellent) and I already have 11 apps published using Unity IAP today. I am 100% code based and don’t use any of the Editor UI for IAP (store, products, etc are all in code).
-
Is it possible to validate receipts in Editor Play Mode? A year ago I swear we used to be able to instantiate the CrossPlatformValidator in Play Mode but receipts would always fail (because they are test ones, which is expected) and so I would override the validation to test in Play Mode. Today I can’t even get the CrossPlatformValidator to instantiate due to missing tangle data in Play Mode. Not a big deal but slightly less code able to be tested before it heads to device.
-
What is the best practice for dealing with receipts that fail validation? Specifically, what do we do with the receipt that is now stored in product.receipt? In Play Mode the receipts are obviously going to fail validation because they are fake, but also in Production if someone attempts to stuff a bad receipt I will deal with the same issue. I already know that we will not fulfill the reward, but should we also manually erase the receipt saved in product.receipt upon validation failure?
-
Are test receipts that are created in Editor Play Mode automatically purged? In Play Mode I can test an IAP purchase and it generates a fake receipt, and if I bypass the receipt validation I can grant the Player the reward. However when I stop and restart Play Mode, the receipt saved in product.receipt (in the IAP Controller) is gone. Is this expected? In Production I can still count on the controller retaining the receipt there permanently, correct?
Thanks for your input!