3

I have a bunch of IAPs in my iOS application, and I have implemented receipt validation for the IAPs.

I'm wondering what error handling I should be doing if the receipt validation request fails.

So, say you have a user who legitimately purchases one of the IAPs, the transaction was successful but the request to verify the receipt fails for whatever reason (e.g. no connection, Apple's server is down). I assume that the user will have been charged because the transaction was successful, but as the validation failed the user will not have been given the content.

What should I do in this situation? I know it might be a rare case but I want to account for it anyway.

I was thinking I could save the receipt to persistent storage and retry the receipt validation in the background until it succeeds. Is this a viable option? Do the receipts remain valid forever or do they expire after a certain amount of time?

I couldn't find much information on this from Apple's documentation so I'm asking you guys.

Thanks in advance

Alec
  • 1,247
  • 2
  • 9
  • 9
  • So the transaction has been removed from the queue? You could tell the user it failed and ask them to retry / restore when the connection is restored. Or trigger that process automatically. – Wain Aug 16 '13 at 13:32
  • Yeah by that point the transaction has been removed from the queue. I should point out that the IAPs are consumable so I don't know if a restore would work. Although I could restore from the saved receipt or something. – Alec Aug 16 '13 at 13:45
  • Retrying is probably your best option, particularly if you are selling consumables (which can't be restored). – Ben Flynn Aug 18 '13 at 16:57

0 Answers0