question

josh@gameforge avatar image
josh@gameforge asked

SDK Tester issues same purchaseToken for different (consumable) purchases

During testing we found that the SDK Tester produces the same purchaseToken for subsequent purchases of the same consumable item. Since the combination of userId and purchaseToken is the only way to know whether a payment - sent to our backend server - has already been made, the item cannot be delivered multiple times for the same purchaseToken. Can we safely assume the live system produces different purchaseTokens for different purchases of the same item from the same user? The documentation should mention this in the section "Differences from the live environment".
iap
10 |5000

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

StephenC@Amazon avatar image
StephenC@Amazon answered
You are correct. The live store will generate a different purchase token for each purchase, even if you purchase the same item. We will be updating the SDK Tester to fix some inconsitencies, like the one you mentioned regarding identical tokens.
10 |5000

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

pplomar avatar image
pplomar answered
Any idea when this will be fixed? It is forcing us to use some horrible hacks in our staging environment
10 |5000

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

Sujoy@Amazon avatar image
Sujoy@Amazon answered
This issue should be fixed in IAP V2. In IAP V2, a unique receipt ID is delivered to the app for every purchase in both the live and sandbox environments. Your app should verify the receipt ID through RVS from back end. Please refer documentation listed below: https://developer.amazon.com/public/apis/earn/in-app-purchasing/docs-v2/implementing-iap-2.0#14.%20Verifying%20the%20Receipt%20with%20the%20back-end%20server https://developer.amazon.com/public/apis/earn/in-app-purchasing/docs-v2/verifying-receipts-in-iap-2.0
10 |5000

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