paymentAuthorizationViewController(_:didSelect:completion:)
Tells the delegate that the user changed the payment method, and asks for an updated payment request.
Declaration
optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelect paymentMethod: PKPaymentMethod, completion: @escaping @Sendable ([PKPaymentSummaryItem]) -> Void)optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelect paymentMethod: PKPaymentMethod) async -> [PKPaymentSummaryItem]Parameters
- controller:
The payment authorization view controller.
- paymentMethod:
The new payment method.
- completion:
The completion block to call with the updated payment summary items.
This block takes the following parameters:
summaryItemsAn updated array of summary items that include any changes due to fees or credit card surcharges associated with the payment method.
Discussion
This method is called when the user has selected a new payment card. Use this delegate callback to update the summary items in response to the card type changing (for example, applying credit card surcharges), and then call the callback with the updated summary items.
See Also
Handling user’s payment authorization
paymentAuthorizationViewController(_:didRequestMerchantSessionUpdate:)paymentAuthorizationViewControllerWillAuthorizePayment(_:)paymentAuthorizationViewController(_:didAuthorizePayment:handler:)paymentAuthorizationViewController(_:didAuthorizePayment:completion:)paymentAuthorizationViewControllerDidFinish(_:)paymentAuthorizationViewController(_:didSelect:handler:)