Showing Payment Result
note
The YocoSDK.showPaymentResult()
is an optional API flow that will show the user a success or error screen.
Parameters
paymentResult: PaymentResult
- result returned from [YocoSDK.getPaymentResult()
]params: PaymentParameters
- (Optional) Provides additional info regarding the paymentreceiptDelegate: ReceiptDelegate?
- (Optional) Receipt screen callback handler and util
rootViewController: UIViewController?
- (Optional) Presenting view controller, nil if result screen needs to be presented fromUIWindow.rootViewController
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.