From here I figured out that I could implement receipt validation from code inside ProcessPurchase method.
But what if I use Codeless IAP? Can Codeless IAP do receipt validation automatically? And if no, then how do I implement it if I am using IAP Buttons and IAP Listeners instead of the actual scripting API?
Currently, it is not possible to do receipt validation if you are using Codeless IAP. You can modify the scripts to perform the necessary validation, but there is no pre-built system for doing this at the moment.
Hi, I am using the codelessIAP. If i change the script on IAPButton.cs (as you can see on the image) with the Receipt validation manual codes, can i do the validation?
Yes, that should work but we haven’t tested it. But if you’re going that route, you might consider not using Codeless in the first place. Also, be careful when you update IAP versions as the update would likely overwrite your changes. There are the Sample IAP projects here, the first one is scripted, the second is Codeless. https://discussions.unity.com/t/700293
I didnt try, everything is ok in my test project and it is on google play and i tested with test accounts and everything seems correct but i wanted to use validation for illegal buys
So you’ve implemented your suggested code and uploaded to Google Play, and now you are testing your new validation code. You can use Debug.Log to monitor the device logs for debugging. Also, note how the Sample IAP project writes debug information to the UI, very handy for debugging.
Now, i tried with my phone but i have more than 10 account and validation was coming always true(altough i tried with new google play account) and the paying screen didnt come to screen, but i think it was a problem for me and then i tried with another fresh mobile phone and the paying screen came and i paid with test card ofc, after that because of the i added the validation confirmed text to the end of the validpurchase code, i saw the validpurchased text on the screen.I tried replay the game eveything was good(Using playerprefs).After that, tried reinsalling.Approximately 5 seconds later i saw the validpurchase text so i think everything is ok so far.
(I added the image of the code i was changed.)
Ok sorry for delay i have to look for device logs.I reinstall the app to my iap bought fresh phone.So i didnt buy the items again google play just refreshed it.
Actually I was mentioning debugging techniques for your (future) benefit. If it’s working, there is no need to attach the logs or perform additional troubleshooting.
And i think from receipt validation code it is return always PurchaseProcessingResult.Complete; so if i use IAP listeners for complete purchases, it wont be a good choice.Am i right?