Instance Method

paymentAuthorizationController(_:didAuthorizePayment:completion:)

Tells the delegate that the user has authorized the payment request.

Declaration

optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didAuthorizePayment payment: PKPayment, completion: @escaping (PKPaymentAuthorizationStatus) -> Void)

Parameters

controller

The payment authorization controller.

payment

The authorized payment. This object contains the payment token you need to submit to your payment processor, as well as the billing and shipping information required by the payment request.

completion

The completion block to be called after the app authorizes the payment.

This block takes the following parameters:

status

The authorization status for the payment. For values, see paymentAuthorizationControllerDidFinish(_:).

Discussion

This method is called after the payment request is authorized. You submit the payment information to your payment processor to authorize the transaction, and then call the completion block.

See Also

Handling User's Payment Authorization

func paymentAuthorizationControllerWillAuthorizePayment(PKPaymentAuthorizationController)

Tells the delegate that the user is authorizing the payment request.

func paymentAuthorizationControllerDidFinish(PKPaymentAuthorizationController)

Tells the delegate that payment authorization has completed.

Required.