Different behaviour between sandbox and production IAP environment

We found that there is some difference behaviour between Apple’s production and sandbox IAP environment :


Sandbox : (https://sandbox.itunes.apple.com/verifyReceipt)

By calling this URL, Apple will return an array of receipt data with more than one element (assumed that account have several purchase records)


Production : (https://buy.itunes.apple.com/verifyReceipt)

By calling this URL, Apple will return an array of receipt data with only one element (the most recent purchase record)


The only difference between our UAT and production app is only the path mentioned above while the purchase/verify receipt logic are all the same. Is there anyone experiencing the same issue ?

You are testing different receipts in these two websites so it is important to understand when to expect multiple products in a receipt.

What type of products are these? Have you called finishTransaction on the transaction that reported the purchase? A consumable IAP will not be retained in the receipt after its transaction is finished and the receipt is refreshed. But all non-consumables and non-renewing subscriptions and autorenewable subscriptions should be in the receipt. Therefore the abhorent behavior you are seeing depends on whether the IAPs are for consumables or not.

I do called finishTransaction after the purchase is being reported. Strangely, multiple purchase record is presented in sandbox even the IAP is consumed but only one purchase record is presented in production environment (we have read the log from our server and indicates that the user has several purchase attempts). The logic for handling those consumable IAP items are just the same in both environment.

If your IAPs are consumables then the receipt should (as per the documents) only contain that purchase 1) after updatedTransactions has been called with the original purchase and 2) up until you call finishTransactions and then refresh the receipt by either calling refreshReceipt or by getting another call to updatedTransactions. It is possible that the purchase is incorrectly retained in the receipt and it is possible that this is done in the sandbox but not in production. If the refreshed receipt contains a consumable purchase for which finishTransaction has been called then that is a bug.

"It is possible that the purchase is incorrectly retained in the receipt and it is possible that this is done in the sandbox but not in production. "


you have the same experience before ? or just by wild guessing ?

I have seen retained IAP receipts for consumables in the sandbox even though the documents say they should be removed after finishTransaction.

I have same issue... 4 years past
Different behaviour between sandbox and production IAP environment
 
 
Q