Hello all,
I've been looking at various other threads trying to decipher this, but there don't seem to be clear answers.
My question is the following: if I want to develop an app with In-App Purchases, but I want to know when those IAPs were refunded, how can I do that? My plan was to keep receipts server-side, and to keep checking with Apple's servers until the refund period ends (how long that is exactly is another matter).
However, it's not clear from the documentation how I can tell by a receipt, that an IAP was refunded. I read here about the cancellation_time field:
however, I have a few questions.
- The link mentions that "This field is set when a customer contacts Apple customer support for a refund and the transaction is canceled." Does this happen if a user in the EU cancels an IAP with no questions asked, within the first 14-day window after purchase?
- According to the link, cancellation_date might appear in various places, depending on circumstances I don't fully understand: "
is not automatically added to your app's receipt when set. It appears in thecancellation_date
section of your app's receipt when the receipt is updated (for instance, when a new payment transaction occurs or when you restore purchases using SKPaymentQueue’s restoreCompletedTransactions), when your app calls SKReceiptRefreshRequest to refresh it, or when your app performs receipt validation with the App Store (latest_receipt
). Note: If your app validates its receipt with the App Store and your subscriptions are still valid, thenhttps://buy.itunes.apple.com/verifyReceipt
will appear in thecancellation_date
section of the returned receipt. If your subscriptions are expired,latest_receipt
will appear in itscancellation_date
section." Is there a series of steps a server can take, using a receipt, to be certain whether an IAP has been refunded?latest_receipt_info
- How long do we need to keep checking for refunds? Can users refund their IAPs after the initial 14-day grace period (in Europe, at least)?
Thanks in advance.
Alexander
You will want to see this reference:
The cancellation_date field will be set if the user cancels the purchase. But it is set only in receipts that issue after the user cancels the purchase - not before (because of causality - cause must precede effect). If you have an old style receipt (iOS6 - transaction.transactionReceipt) and you send that old style receipt to the Apple servers for decoding then the Apple servers will append to that receipt the latest_receipt_info field and that added field, not in the receipt, will contain a cancellation_date if appropriate. But if you have a new receipt (iOS7 and later - from [[NSBundle mainBundle] appStoreReceiptURL]) then Apple servers do not update that receipt, they just decode it. So if a user makes a purchase then their receipt will not have a cancellation_date in it. If they subsequently cancel the purchase then their old receipts will not magically transform. You will need to refersh their receipt to discover whether or not there is a cancellation_date.
So the answer to your questions are 1: yes. 2: refresh the receipt or call restoreCompletedTransactions or rely on finding a deprecated transaction.transactionReceipt at your peril. 3: Forever and yes or ignore the problem because after all there are very few refunds