Show payment result
The YocoSDK.showPaymentResult()
is an optional API flow that will show the user
a success or error screen.
When calling the YocoSDK.showPaymentResult()
method without passing in a
ActivityResultLauncher
callback, but rather handling the PaymentResult
in
the onActivityResult
call instead, the PaymentResult will be assigned the
PaymentResultInfo.RequestCode.LAST_TRANSACTION_RESULT_REQUEST
value.
Usage
Before calling the YocoSDK.showPaymentResult()
method, retrieve
the PaymentResult
by calling the YocoSDK.getPaymentResult()
method. Pass the
PaymentResult
as parameter to YocoSDK.showPaymentResult()
to
show the user a success or error screen based on the state of the
transaction.
If no users are authenticated, the login flow will start. Once completed, the payment flow will continue.
Handling the result
When calling the YocoSDK.showPaymentResult()
method without a ActivityResultLauncher
callback, when handling the PaymentResult
in the onActivityResult
call, the
RequestCode
will be assigned the PaymentResultInfo.RequestCode.REFUND_REQUEST
value.
To handle the result using the ActivityResultLauncher
contract, see
how to handle the result.