Error recovery
Previous transaction lookup
If the application crashes or is terminated during a transaction, it’s useful to know what happened to the transaction that was in progress. To look up the state of a previous transaction, call:
This allows 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 from the preceding step, 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 preceding methods in your application’s initialisation to automatically
display a previous transaction: