I am working on implementing subscription using Amazon IAP version 2. I am referring to the sample subscription application provided by them, for implementation.
Currently I am testing in Sandbox environment. For this I have set up
- Amazon App tester in my device.
- placed amazon.sdktester.json file in "mnt/sdcard" directory.
When I make a purchase request, I send child sku in the request as shown in sample. The request status I get in response is SUCCESSFUL. After receipt verification at backend server when I try to grant the subscription purchase, I get INVALID_SKU. When I print the value of SKU, it gives me Parent SKU. And in this case I have to call
PurchasingService.notifyFulfillment(receipt.getReceiptId(),
FulfillmentResult.UNAVAILABLE);
UPDATE:
My SKU at Amazon developer portal, the json I am using for testing, and in my code is same.
Could anyone please explain what exactly is going on here? Why the SKU is invalid?
What is your SKU set in Amazon developer portal? The SKU should be the same as the SKU in your
amazon.sdktester.jsonAnd, don't forget to install the
App Testerreference: https://developer.amazon.com/public/apis/earn/in-app-purchasing/docs-v2/testing-iap-2.0