Is there a way to know when CANCEL is pressed in the Apple Pay view? I tried to look for a delegate, but didn't find one.
If you have the PKPaymentAuthorizationViewControllerDelegate methods setup, you can catch the cancel in this method:
- (void)paymentAuthorizationViewControllerDidFinish:(PKPaymentAuthorizationViewController *)controller
I set a boolean (applePaymentDidSucceed) to FALSE before I call Apple Pay, then set it to true if the "PKPaymentAuthorizationStatus" in this method is true:
- (void)paymentAuthorizationViewController:(PKPaymentAuthorizationViewController *)controller
didAuthorizePayment...
if ( ! applePaymentDidSucceed), the user cancelled.
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