question

ntanda avatar image
ntanda asked

InvalidEnvironmentForReceipt error on Live iOS game

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

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

ntanda avatar image ntanda commented ·

Bump, because it seems like Apple returns the correct environment for the problematic receipts.

0 Likes 0 ·
brendan avatar image
brendan answered

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.

2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

ntanda avatar image ntanda commented ·

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?

0 Likes 0 ·
brendan avatar image brendan ntanda commented ·

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.

0 Likes 0 ·
nobloat avatar image
nobloat answered

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

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.