Contents

paymentAuthorizationViewController(_:didSelectShippingContact:handler:)

Tells the delegate that the user selected a shipping address, and asks for an updated payment request.

Declaration

optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelectShippingContact contact: PKContact, handler completion: @escaping  @Sendable (PKPaymentRequestShippingContactUpdate) -> Void)
optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelectShippingContact contact: PKContact) async -> PKPaymentRequestShippingContactUpdate

Parameters

  • controller:

    The payment authorization view controller.

  • contact:

    A contact object that represents the new shipping address. To maintain privacy, the shipping information is anonymized. For example, in the United States it only includes the city, state, and zip code. This information provides enough detail to calculate shipping costs, without revealing sensitive information until the user actually approves the purchase.

  • completion:

    The completion handler to call with the updated payment summary items and shipping methods.

Discussion

Use this method to update the available shipping methods by creating a new array of valid PKShippingMethod objects for the specified address. You also create an array of PKPaymentSummaryItem objects that represent the updated cost if the user selected a valid shipping method. For more information on updating these values, see the PKPaymentRequest class’s shippingMethods and paymentSummaryItems properties.

See Also

Handling shipping information