Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IAP - How to cancel a purchased transaction if the content download fails, or the receipt is invalid ?

I am trying to figure out something with IAP.

In the documents I see that I need to call finish transaction only after the purchased content ha successfully downloaded for the user:

Your application should call finishTransaction: only after it has successfully processed the transaction and unlocked the functionality purchased by the user.

I have this situation -

  1. The user purchase the content.
  2. After the purchase is completed, I am sending the receipt to verification on my server.
  3. If there is no problem I am downloading the content to the user.

BUT what if I get an invalid receipt? Should I call finishTransaction ? or simply remove transaction ?

Other scenario is when the download fails, and the user leaves the app for a while. Is there away to cancel the purchase and let him restart it later ?

Thanks

like image 268
shannoga Avatar asked Apr 09 '13 15:04

shannoga


1 Answers

  • If the validations fails you should call finishsTransaction but not deliver the content and advice the user that something went wrong.

  • You can't cancel the purchase, once you get a receipt the purchase has been done. You have to code your own mechanism for retrying the download whenever is posible.

like image 65
Ecarrion Avatar answered Sep 19 '22 20:09

Ecarrion