question

arnaudbernard avatar image
arnaudbernard asked

Testing token validation

Hello, My app just got refused because it was not giving items to users through in app purchases. I used the flow "Validate Transactions Outside Your App". I tested with the sdk tester and RVSSandbox.war, it was working fine. I suspect my token validation process does not work with amazon servers, but I have no way to verify that. What should I do to reproduce your testing settings? Thanks!
iap
10 |5000 characters needed characters left characters exceeded

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
Hi -- Here are some things to check: 1) Make sure you change the RVS URL to the production ("Live") Amazon RVS URL listed in the documentation 2) Make sure you pass, as parameters: -- the purchaseToken from the Receipt found in onPurchaseResponse() -- the UserID from the ongetUserIDResponse callback -- the Developer Secret found on your Developer Portal account (Please never post your Developer Secret in the forums, or anywhere else :)
10 |5000 characters needed characters left characters exceeded

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

arnaudbernard avatar image
arnaudbernard answered
Looks like the shared key got changed when we created a new project, thanks for the pointers!
10 |5000 characters needed characters left characters exceeded

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

arnaudbernard avatar image
arnaudbernard answered
Also I noticed that, in test mode, receipt.getPurchaseToken() returns a string ending with a "\n". It makes the validation http get fail on my server, should I expect a "\n" in production purchaseToken and try to remove it?
10 |5000 characters needed characters left characters exceeded

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

Dixith@Amazon avatar image
Dixith@Amazon answered
Hi, Actually there shouldn't be any "\" chars in the purchase token, but there is a bug where "\n" char is appended to end of the purchase token. Please remove that char and every thing will work fine. We are working towards a fix for this bug. Please go through the below thread for more information on purchase token. https://forums.developer.amazon.com/forums/message.jspa?messageID=384 Hope this information helps you.
10 |5000 characters needed characters left characters exceeded

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