如果取消Apple Pay,该如何处理?

时间:2018-08-30 15:57:49

标签: ios swift authorization payment applepay

我在PKPaymentAuthorizationViewControllerDelegate中调用了函数

func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didAuthorizePayment payment: PKPayment, completion: @escaping (PKPaymentAuthorizationStatus) -> Void) {
  onError: { completion(.failure) },
  onComplete: { completion(.success) } }

,如果交易完成,paymentAuthorizationViewControllerDidFinish将收到呼叫以关闭Apple Pay对话框。但是,如果用户也按“取消”按钮将其关闭,则有一个例外。

是否有任何方法可以从paymentAuthorizationViewController中的paymentAuthorizationViewControllerDidFinish获取回调结果?还是可以知道是否按下了取消按钮?

0 个答案:

没有答案