Showing Payment Result
info
When calling YocoSDK.showPaymentResult()
without passing in a ActivityResultLauncher
and handling the PaymentResult
in onActivityResult
, it will be assigned the PaymentResultInfo.RequestCode.LAST_TRANSACTION_RESULT_REQUEST
code
note
The YocoSDK.showPaymentResult()
is an optional API flow that will show the user a success or error screen.
Parameters
context: Context
- The calling Activity/Fragment initiating the paymentpaymentResult: PaymentResult
- result returned from [YocoSDK.getPaymentResult()
]params: PaymentParameters
- (Optional) Provides additional info regarding the paymentreceiptDelegate: ReceiptDelegate?
- (Optional) Receipt screen callback handler and util
result: ActivityResultLauncher<Intent>?
- (Optional) activity result handler contract to handle intent result
danger
The context
that is passed as a parameter MUST be calling activity/fragment's context and NOT the application context.
Usage
Before calling the SDK showPaymentResult()
method, you will first need to retrieve the PaymentResult
from the SDK getPaymentResult()
, which can then be passed as a parameter to show the user a success or error screen based on that transaction.
note
If no user has logged in, you WILL be prompted to login using your Yoco account details. If successful, it will continue to the payment flow.