-
Optionally configure additional information on your PKPaymentRequest. This closure will be called after the PKPaymentRequest is created, but before the Apple Pay sheet is presented. In your implementation, you can configure the PKPaymentRequest to add custom fields, such as
recurringPaymentRequest
. See https://developer.apple.com/documentation/passkit/pkpaymentrequest for all configuration options.- Return: The PKPaymentRequest after your modifications.
Declaration
Swift
public let paymentRequestHandler: ((PKPaymentRequest) -> PKPaymentRequest)?
-
Optionally configure additional information on your PKPaymentAuthorizationResult. This closure will be called after the PaymentIntent or SetupIntent is confirmed, but before the Apple Pay sheet has been closed. In your implementation, you can configure the PKPaymentAuthorizationResult to add custom fields, such as
orderDetails
. See https://developer.apple.com/documentation/passkit/pkpaymentauthorizationresult for all configuration options.Declaration
Swift
public let authorizationResultHandler: ((PKPaymentAuthorizationResult, ((PKPaymentAuthorizationResult) -> Void)) -> Void)?
Parameters
$0
The PKPaymentAuthorizationResult created by PaymentSheet.
$1
A completion handler. You must call this handler with the PKPaymentAuthorizationResult on the main queue after applying your modifications. For example:
.authorizationResultHandler = { result, completion in result.orderDetails = PKPaymentOrderDetails(/* ... */) completion(result) }
WARNING: If you do not call the completion handler, your app will hang until the Apple Pay sheet times out. -
Initializes the ApplePayConfiguration Handlers.
Declaration
Swift
public init(paymentRequestHandler: ((PKPaymentRequest) -> PKPaymentRequest)? = nil, authorizationResultHandler: ((PKPaymentAuthorizationResult, ((PKPaymentAuthorizationResult) -> Void)) -> Void)? = nil)