question

newuser-70d49955-3ecc-4038-84e0-906ae7ed1fdc avatar image

Get receiptId using SDK Tester Desktop environment

Hello,

I'm using SDK Tester for Desktop environment as described here https://developer.amazon.com/docs/in-app-purchasing/iap-sdk-tester-for-webapps.html

In onPurchaseResponse() I receive the following object:

{jsReqId:"b2c23589-0c9b-4443-b317-0f3b773f4c23",purchaseRequestStatus:"SUCCESSFUL",receipt:{itemType:"ENTITLED",purchaseToken:1507647338704,sku:"sample.greenbutton",subscriptionPeriod:null,requestId:"IAP.purchaseItemTue Oct 10 2017 16:55:38 GMT+0200 (CEST)"},userId:"userId"}

When I use purchase token to validate receipt in RVS sandbox (rvs_server:port/version/2.0/verify/developer/.../user/userId/purchaseToken/1507647338704) I'm getting the error:

{"status":false,"message":"Failed to parse iap token"}

How can I get proper purchaseToken to be able to test validation with RVS Sandbox (using RVS for Web App)?

iapweb appssdk
10 |5000

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

Levon@Amazon avatar image
Levon@Amazon answered

Hi there,

Thanks for posting! Web apps use the older IAP v1 and it looks like you are trying to use RVS v2 for validation. That's not possible; the versions should match. Please make sure to call the correct API on RVS per these documents:

10 |5000

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

newuser-70d49955-3ecc-4038-84e0-906ae7ed1fdc avatar image
newuser-70d49955-3ecc-4038-84e0-906ae7ed1fdc answered

Hi,

Thanks for the quick reply. Are you sure that the versions should match? On the migration page it is said:

Note: In the RVS URLs, the “version” field refers to the version number of RVS, not the version number of the IAP APIs.
If you are using IAP v1.0, the correct RVS version is 2.0.
If you are using IAP v2.0, the correct RVS version is 1.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.

Levon@Amazon avatar image
Levon@Amazon answered

Hi there,

Are you using the older SDK Tester, or the newer App Tester companion app? Please use the App Tester: https://developer.amazon.com/docs/in-app-purchasing/iap-app-tester-user-guide.html

10 |5000

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