paymentAuthorizationViewController(_:didSelectShippingAddress:completion:)
Tells the delegate that the user selected a shipping address.
Declaration
optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelectShippingAddress address: ABRecord, completion: @escaping @Sendable (PKPaymentAuthorizationStatus, [PKShippingMethod], [PKPaymentSummaryItem]) -> Void)Parameters
- controller:
The payment authorization view controller.
- address:
An address book record representing the selected shipping method.
- completion:
The completion block to be called with updated shipping information.
This block takes the following parameters:
statusThe authorization status for the payment. For values, see Pkpaymentauthorizationviewcontrollerdelegate.
shippingMethodsAn array of Pkshippingmethod objects that replaces the shipping methods for the current payment request.
summaryItemsAn array of Pkpaymentsummaryitem objects that replaces the summary items for the current payment request.
Discussion
Use this method to update the available shipping methods and, if a shipping method has been selected, the current shipping cost.
When this method is called, you create a new array of valid PKShippingMethod objects for the specified address. You also create an array of PKPaymentSummaryItem objects that represent the updated cost. The summary items should include the shipping cost if a valid shipping method has been selected. For more information on updating these values, see the PKPaymentRequest class’s shippingMethods and paymentSummaryItems properties.