Hello, I am getting an error on some iOS users (if not all) when they try to make a purchase in my game.
They are charged by Apple, but the Playfab receipt validation fails with the following:
"TitleId": "AD88", "Source": "PlayFab", "Error": "InvalidEnvironmentForReceipt", "PaymentProvider": "iTunes Sandbox", "ReceiptContent": "[Actual Receipt]", "PaymentType": "ReceiptValidation", "Valid": false
I'm using Unity IAPs and didn't have a problem until recently on the Live build.
Any ideas on what is going wrong?
Thanks
Bump, because it seems like Apple returns the correct environment for the problematic receipts.
Answer by Brendan · Aug 04, 2020 at 12:44 AM
The way the receipt validation process works for iOS (in part) is that we make a call to Apple to verify if the receipt is a valid Production environment receipt. If not, we check if it's a valid Development environment receipt. In practice, receipts have to be for one of the two environments. However, we occasionally see Apple return the "wrong environment" error for both environments on a receipt check. Only in that case do we return the wrong environment error.
Thanks, I seem to get that error on quite a lot of users at the moment - if that's an Apple side bug, do you have any leads on where I could look / what I should look for to get that fixed? Knowing the actual error they're sending would be a great start!
Cheers
edit: I have checked some of the conspicuous receipts, and the environment is returned as Production by Apple every time. That would indicate that it is a PlayFab issue then?
No, if you re-try the receipt processing in PlayFab, it would likely succeed. What I'm saying above is that at the time you made the call, Apple returned that error for both sandbox and prod. We have no way to investigate why they did that - it's entirely on their side. I would open a ticket with the Apple store folks to get more info.
Answer by NoBloat · Dec 14, 2021 at 04:38 PM
For anyone dealing with this error, I found a solution by removing then re-adding the Apple Partner Add-On in Game Manager.
More info: https://community.playfab.com/answers/58485/view.html