我正在使用 PassKit 实现 Apple Pay,我正在以正确的方式显示对话框并处理委托方法,但是每次我使用 touch Id 验证购买时,它都会显示“付款未完成”并且永远不会到达我的委托方法paymentAuthorizationViewController:didAuthorizePayment:completion:
。我完全做了所有这些事情来设置苹果支付,但我似乎无法取回令牌以发送到我的支付网关。
PKPaymentRequest *request = [[PKPaymentRequest alloc] init];
self.paymentRequest = request;
request.countryCode = @"US";
request.currencyCode = @"USD";
request.supportedNetworks = @[PKPaymentNetworkAmex, PKPaymentNetworkMasterCard, PKPaymentNetworkVisa];
request.merchantCapabilities = PKMerchantCapabilityEMV;
request.merchantIdentifier = @"merchant.com.*******";
request.requiredShippingAddressFields = PKAddressFieldPostalAddress;
request.requiredBillingAddressFields = PKAddressFieldPostalAddress;
request.paymentSummaryItems = [self paymentSummaryItems];
self.paymentPane = [[PKPaymentAuthorizationViewController alloc] initWithPaymentRequest:request];
self.paymentPane.delegate = self;
if (self.paymentPane) {
[self presentViewController:self.paymentPane animated:TRUE completion:nil];
}
这是我所看到的,屏幕只是停留在那里,一遍又一遍地说“再试一次”: