I’ve updated our project from Editor version 2020.3 to 2021.3 and for some reason the play store receipt is changed, which cause a crush on our server side when trying to parse it for validation.
when I tested a build version from the day before that upgrade we are getting the old receipt JSON which is a single object, but now we are getting an array of object, I read about this change on play store documentation but I cant find anywhere what’s the cause for our new version to get different object from the play store.
The IAP package was not updated (although later on I did try to update it to see how it effect).
Another change I made at the same time is adding support for Android OS 12+13. I tried to switch back the build target to highest from android 13 but it still the same.
So at the moment I have 2 builds of the same app that receive 2 different response from the IAP receipt from play store and I’m trying to understand what’s causing it (mainly to know how to handle backward compatibility on the server verification process)
There was no actual crush, just parsing error because of the new JSON structure, the change was only on skuDetails param with was an object before skuDetails{…}, and now is an array of objects skuDetails[{,},{,},{,}}
I didnt had a chance to test it for confirmation but I’m pretty sure the change was caused by upgrading the “Target API Level” from 11 to 13, but I would love a conformation for it
Please send us the receipts that you are using for testing. We are not aware of any effect of changing target API levels, that should not change the receipt that you receive from Google.
We confirm that this has changed.
In 4.5.1, we updated the changelog to mention this:
The “skuDetails” in the receipt json is now an array of the old structure, not just one object. It will only have one element in most cases, so if this is being parsed in your app, treat it like an array and get the first element by default.