Showing Payment Result

note

The YocoSDK.showPaymentResult() is an optional API flow that will show the user a success or error screen.

Parameters

  1. paymentResult: PaymentResult - result returned from [YocoSDK.getPaymentResult()]
  2. params: PaymentParameters - (Optional) Provides additional info regarding the payment
    1. receiptDelegate: ReceiptDelegate? - (Optional) Receipt screen callback handler and util
  3. rootViewController: UIViewController? - (Optional) Presenting view controller, nil if result screen needs to be presented from UIWindow.rootViewController
  4. completionHandler: YocoCompletionHandler<PaymentResult>? - (Optional) Completion handler invoked when result screen is dismissed

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.

import YocoSDK
// Required:
let paymentResult: PaymentResult = <Result from Yoco.getPaymentResult()>
// Optional: Params containing additional for advanced functionality
let params = PaymentParameters(
receiptDelegate = this
)
// Initiating showing the Payment Result
YocoSDK.showPaymentResult(
paymentResult,
paymentParameters: params,
rootViewController: rootViewController,
) { paymentResult in
}
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.

Handling Receipts

Handling Payment Result