Error recovery
Previous transaction lookup
If the application crashes or is terminated during a transaction, it is useful to know what happened to the transaction that was in progress. To look up the state of a previous transaction, call:
This will allow you to get the PaymentResult
of the transaction so you can determine
if it was a success or failure.
Showing the user the result
After receiving the PaymentResult
above, you probably want to show the user the
result (and allow them to send a receipt). The YocoSDK has a function to allow
you to present the result of the payment and send a receipt via the function below:
You can pass the same PaymentParameters object you normally use with the
YocoSDK.charge()
method. You can chain both the above methods in your
application’s initialisation to automatically display a previous transaction: