question

Pankaj avatar image
Pankaj asked

Variable receipt on purchase update response

Hello Guys, I have some users who purchased subscription using IAP 1.0. Now after the upgrade to IAP 2.0, I can see different purchase receipt in purchase update callback. I'm using receipt hash as a key for my database but this difference in receipt is causing me trouble. As per the docs, the receipts are same for a particular purchase. Why am I getting this issue of different receipt? Need help,
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.

DougM@Amazon avatar image
DougM@Amazon answered
Hello Pankaj, Could you please point to where in our documentation we state the value of the receiptID is the same as the purchaseToken in In-App Purchasing 1.0? As while these values are equivalent, the values being identical is not guaranteed as purchaseTokens have a limited lifetime and can be expired and renewed for a receipt. However, as of In-App Purchasing 2.0, the receiptID value should be unique to a particular purchase unlike the purchaseTokens with v 1.0. However, calling PurchasingService.getPurchaseUpdates() with the reset flag set to true should allow for you to migrate your receipts from In-App Purchasing v1.0 to the receipts that are valid for 2.0. https://developer.amazon.com/public/binaries/content/assets/javadoc/iap-v2/com/amazon/device/iap/purchasingservice.html For more details as to the changes that happen between In-App Purchasing 1.0 and 2.0, please check out our migration guide at: https://developer.amazon.com/public/binaries/content/assets/javadoc/iap-v2/com/amazon/device/iap/purchasingservice.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.

Pankaj avatar image
Pankaj answered
Hello Doug, Thanks for the clarification. My next question is, in IAP v2.0, will the receiptId be same even after a subscription expired or renewed? Also, after the renewal, the purchase date will be first time purchase date or renewal date?
10 |5000

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

DougM@Amazon avatar image
DougM@Amazon answered
Hello Pankaj, The receipt will be the same if the subscription is expired at any point, however the expiration date will be defined as the day the subscription is expired instead of null. If your customer subscribes to the content again there will be two receipts for the same sku, one with a null expiration date , which will be the current valid subscription, and there will be the prior subscription receipt that will include the expiration date. The purchase date should be related to when the purchase was made in our systems. So, when you implement your purchaseUpdatesResponse within the PurchasingListener you will need to keep that in mind. Please let us know if you have any additional questions.
10 |5000

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

Pankaj avatar image
Pankaj answered
Thanks Doug, Now I'm getting into it. Still I have a doubt, Will the receipt be same if subscription is auto renewed without expiring? Or there will be 2 receipts in case of auto renewal also? Will the purchase date be same in this case? Thanks once again!
10 |5000

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

DougM@Amazon avatar image
DougM@Amazon answered
Hello again, Subscriptions will remain with the same purchase date in the event of auto-renewal as well. This will be handled by a single receipt for the subscription purchase. As subscriptions automatically renew by default, it would be expected that the same receipt should be valid for the duration of the subscription until the customer cancels it either via the Appstore client or in their account settings on Amazon.com.
10 |5000

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

Pankaj avatar image
Pankaj answered
Thanks Doug! :)
10 |5000

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