简体   繁体   English

Apple Pay支付“未完成付款” - 无法获得令牌

[英]“Payment not completed” with Apple Pay - can't get token

I am implementing Apple Pay using PassKit, I am showing the dialog the proper way and handling the delegate methods, but every time I use touch Id to verify a purchase it says "Payment not completed" and never reaches my delegate method paymentAuthorizationViewController:didAuthorizePayment:completion: . 我正在使用PassKit实现Apple Pay,我正在以正确的方式显示对话框并处理委托方法,但每次我使用touch Id验证购买时它都显示“付款未完成”并且从未到达我的委托方法paymentAuthorizationViewController:didAuthorizePayment:completion: I did all of these things fully to set up apple pay, but I cant seem to get a token back to send to my payment gateway. 我完全做了所有这些事情来设置苹果工资,但我似乎无法获得一个令牌发送到我的支付网关。

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

Here is what I am seeing, and the screen just stays there and says "Try Again" over and over: 这就是我所看到的,屏幕就在那里,一遍又一遍地说“再试一次”:

在此输入图像描述

Finally got a token. 终于得到了一个令牌。 I needed to enable 3DS as a payment processing capability: 我需要启用3DS作为支付处理功能:

request.merchantCapabilities = PKMerchantCapabilityEMV | PKMerchantCapability3DS;

That's what I get for copypasting someone else's code ( http://goo.gl/uvkl8F ). 这就是我用来复制别人代码的方法( http://goo.gl/uvkl8F )。 Strange because 3DS is 'required' according to the docs : 奇怪,因为根据文档 “3DS”是“必需的”:

You must support 3DS; 你必须支持3DS; support of EMV is optional. EMV的支持是可选的。

Why I have to explicitly state 3DS is supported by the merchant when it's required is beyond me. 为什么我必须明确陈述3DS是商家支持的,当它需要超出我。

确保您在Passbook上设置的信用卡已经过验证...否则,PKPaymentAuthorizationViewController将返回nil。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM