Apple Pay calls the following delegate whenever a PKPaymentAuthorizationViewController
is dismissed for any reason. Is there any way to detect if just the Cancel button was touched?
- (void)paymentAuthorizationViewControllerDidFinish:(PKPaymentAuthorizationViewController *)controller
{
[self dismissViewControllerAnimated:YES completion:nil];
}
From the documentation for paymentAuthorizationViewControllerDidFinish:
When the user authorizes a payment request, this method is called after the status from the paymentAuthorizationViewController:didAuthorizePayment:completion: method’s completion block has been shown to the user. When the user cancels without authorizing the payment request, only paymentAuthorizationViewControllerDidFinish: is called.
So if
paymentAuthorizationViewController:didAuthorizePayment:completion:
Is not called first, then the user tapped the cancel button (or the controller somehow got cancelled otherwise).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With