ios - Apple Pay "Payment not completed"- 无法获取 token

标签 ios objective-c applepay

我正在使用 PassKit 实现 Apple Pay,我正在以正确的方式显示对话框并处理委托(delegate)方法,但每次我使用 touch Id 验证购买时它都会显示“付款未完成”并且永远不会到达我的委托(delegate)方法 paymentAuthorizationViewController:didAuthorizePayment:completion:。我做了所有 these things完全可以设置 Apple Pay,但我似乎无法取回 token 以发送到我的支付网关。

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];
}

这就是我所看到的,屏幕只是停留在那里并一遍又一遍地说“再试一次”:

enter image description here

最佳答案

终于拿到 token 了。我需要启用 3DS 作为支付处理功能:

request.merchantCapabilities = PKMerchantCapabilityEMV | PKMerchantCapability3DS;

这就是我复制粘贴别人代码的结果 ( http://goo.gl/uvkl8F )。奇怪,因为根据 the docs 3DS 是“必需的” :

You must support 3DS; support of EMV is optional.

为什么我必须在需要时明确声明商家支持 3DS,这超出了我的理解范围。

关于ios - Apple Pay "Payment not completed"- 无法获取 token ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26553229/

相关文章:

ios - 通知服务扩展 - 有关在推送通知上显示图像的问题

ios - 与 Apple 通信失败错误

ios - Alamofire 和 Swift 3 的更新

objective-c - 如何在没有 url 方案或外部服务器的情况下在 2 个本地 ios 应用程序之间共享文件?

objective-c - iOS:XCode 4.5:xcodebuild 错误 - fatal error :找不到 'UIKit/UIKit.h' 文件

iphone - 使用当前时间以编程方式添加 UILabel

react-native - 如何在 React Native 中实现付费去除广告(iOS 和 Android)

payment-gateway - 我们可以将apple pay 集成到任何网站吗?

ios - 如何验证与 MacRoman 兼容的字符

ios - 您可以在不删除对象然后再次添加它们的情况下更新核心数据吗? - iOS