How to handle failed transactions? #1561
Unanswered
DreamingInfraviolet
asked this question in
Q&A
Replies: 1 comment
-
My suggestion is to finish the transaction ONLY when your receipt is validated successfully on the backend side. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
So it seems that when a purchase succeeds, one has to call
RNIAP.finishTransaction
to tell Apple/Google that the transaction has been successfully delivered.However, sometimes there may be an error verifying the transaction (network error, fraudulent transaction, etc.). What should one do if there's some kind of error delivering the purchase? It seems that Apple recommends calling
finishTransaction
anyway, but marking the transaction as failed, however I don't see a way of doing this using RNIAP.Example code illustrating the problem:
Right now I can only see RNIAP offering two options when it comes to dealing with errors:
RNIAP.finishTransaction
anyway. This means that the user will be charged despite not receiving anything, but will correctly clear the ios transaction queue.RNIAP.finishTransaction
. On Android, the user will be automatically refunded in a few days. On iOS, the behaviour is not clear. The transaction queue is never cleared, which may lead to weird behaviour from what I understand.Neither of these approaches seem right. From Apple documentation:
But this results in users being charged despite not getting anything.
Is there a better way of handling errors?
Beta Was this translation helpful? Give feedback.
All reactions