question

heath avatar image
heath asked

ValidateAmazonIAPReceipt Error 1150

Hello, Forum - I am consistently getting "1150" error codes when I attempt to validate an Amazon receipt.

Using Unity 2017.1, PlayFab SDK 2.24.170710.The Amazon Add-On and secret key is established.

I successfully get the Amazon IAP UI on the device, but the subsequent receipt validation call to PlayFab (ValidateAmazonIAPReceipt) fails.

I am pulling the ReceiptId and UserId from the data returned by Amazon, and the CurrencyCode and PurchasePrice from the data returned by "PlayFab.PlayFabClientAPI.GetCatalogItems", via a lookup on "ItemId".

So the request looks like:

{

ReceiptId: q1YqVbJSyjH28DGPKChw9c0o8nd3ySststQtzSkrzM8tCk43K6z0d_HOTcwwN8vxCrVV0lEqBmpJz08s0UsqzUvJSdVLSizOTNYrSEzOBkqWKFkZ6CilAJUYmhoYWlhYmhmZm5qbK9UCAA,

UserId :l3HL7XppEMhrOGDnur9-ulvqomrSg6qyODKmah76lJU=,

CurrencyCode : RM ,

PurchasePrice: 99

}

from a purchase of: (Sample GetCatalogItems response):

{

"ItemId": "thing.to.buy",

"ItemClass": "ThingClass",

"CatalogVersion": "Game Packs",

"DisplayName": "THING",

"Description": "Thing To Buy",

"VirtualCurrencyPrices":

{ "RM": 99,

"GT": 0

}, "

..etc

}

The 1150 error is not in the error list on the man page for ValidateAmazonIAPReceipt. Is this a more general error?

Even using the API "Try it" gives the same error.

Am I misunderstanding how to use the call?

Let me know if I can supply any other info.Thanks, any suggestions are appreciated.

-heath carlisle

10 |1200

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

1 Answer

·
brendan avatar image
brendan answered

Looking at the logs on the service, it appears we're getting a protocol error back from Amazon on these requests. Is there any chance these are sandbox purchases? We currently only support production receipts for Amazon's receipt service.

If this isn't a sandbox receipt, can you post the code snippet showing how you're getting the receipt info?

3 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.

heath avatar image heath commented ·

It is indeed a sandboxed request:

com.j***.k*****I/Unity: PurchaseProcessingResult

{"Store":"AmazonApps","TransactionID":"q1YqVbJSyjH28DGPKChw9c0o8nd3ySststQtzSkrzM8tCk43K6z0d_HOTcwwN8vxCrVV0lEqBmpJz08s0UsqzUvJSdVLSizOTNYrSEzOBkqWKFkZ6CilAJUYmhoYWlgamlhaGhsYKtUCAA","Payload":"{\"receiptId\":\"q1YqVbJSyjH28DGPKChw9c0o8nd3ySststQtzSkrzM8tCk43K6z0d_HOTcwwN8vxCrVV0lEqBmpJz08s0UsqzUvJSdVLSizOTNYrSEzOBkqWKFkZ6CilAJUYmhoYWlgamlhaGhsYKtUCAA\",\"userId\":\"l3HL7XppEMhrOGDnur9-ulvqomrSg6qyODKmah76lJU=\",\"isSandbox\":true}"}

I'll try a test outside of the sandbox. Thank you!

0 Likes 0 ·
heath avatar image heath heath commented ·

Tests outside the sandbox do indeed work. The problem I was experiencing had nothing to do with PlayFab, but I was trying to use PF to troubleshoot it.

It turns out that several products in the apps IAP store were misconfigured, and this caused Unity's IAP module to not initialize.

Once all of the store products were properly set up, it seems that Amazon has a delay (0-48 hrs??) before the store is in a valid state, at least as far as Unity IAP is concerned. Once that delay elapsed I was able to successfully perform live testing, and the subsequent ValidateAmazonIAPReceipt calls worked as expected. I've read about this delay on other posts both here and on the Unity forums, and I can add to the consensus. Fuzzy bottom line, if you make a change to the IAP store items (or config) and then get errors, give it a day or so before attempting live testing. Hope that helps!

0 Likes 0 ·
brendan avatar image brendan heath commented ·

Wow - so up to 2 days before changes you make in the Amazon store are propagated to live? Good to know - thanks!

0 Likes 0 ·

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.