Error recovery
Previous transaction look up
In the event that the app crashes or is terminated during a transaction, it is useful to know what happend 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 Yoco.charge()
method to pass a YocoReceiptDelegate
and other optional parameters.
You can chain both the above methods near your app start to automatically display a previous transaction: