ApplePay iOS错误 - 此设备无法付款 [英] ApplePay iOS error - This device cannot make payments
问题描述
将ApplePay与我的测试应用集成时,我收到错误:
When integrating ApplePay with my test app, I get the error:
此设备无法付款
This device cannot make payments
我已经设置了一张可以使用的卡,并在销售点终端进行了测试 - 在那里工作正常。
I have setup a card to use, and tested it at a Point of Sale terminal - works fine there.
应该工作(但不是)的代码行是:
The line of code that should be working (but doesn't) is:
PKPaymentAuthorizationViewController *auth = [[PKPaymentAuthorizationViewController alloc] initWithPaymentRequest:paymentRequest];
推荐答案
Apple的文档在详细列出集成步骤方面严重不足。
Apple's documentation is woefully inadequate in listing integration steps in detail.
Apple的 Apple Pay入门文档提到了这些要点:
Apple's Getting Started with Apple Pay document mentions these bullet points:
除了使用PassKit框架实施Apple Pay之外,您还必须:
In addition to implementing Apple Pay with the PassKit framework, you must:
- 如果您愿意,请使用付款处理器或网关设置帐户已经有
一个 - 通过证书注册商家标识符,标识符&个人资料
- 提交证书签名请求获取将用于加密和解密付款代币的公钥和私钥
- (缺少步骤)在您的KeyChain中包含证书
- 包括Apple在您的应用中支付权利。
- Set up an account with a payment processor or gateway, if you don’t already have one
- Register a Merchant Identifier via Certificates, Identifiers & Profiles
- Submit a Certificate Signing Request to obtain Public and Private keys that will be used to encrypt and decrypt Payment Tokens
- (missing step) Include the Cert in your KeyChain
- Include an Apple Pay entitlement in your app.
在我的情况下,我忘记了第3步。修复方法是提交一个新的CSR,其中包含在步骤2中创建的商家ID ,并将结果证书包含在您的钥匙串中。
In my case, I'd forgotten step 3. The fix is to submit a new CSR with the merchant ID created in step 2, and include the resulting certificate in your keychain.
编辑:但等等,还有更多!
But wait, there's more!
您还需要转到Apple的AppID部分会员中心并编辑应用的应用ID,以包含您刚刚创建的商家帐户ID。否则,您的应用将不会被配置为使用商家ID。之后,转到Xcode首选项并刷新您的配置文件(或者如果需要,可以手动下载并安装它们)。
You also need to go to the AppIDs section of your Apple Member Center and edit the App ID for the app to include the merchant account id you just created. Otherwise your app will not be provisioned to use the merchant id. After that, go to Xcode preferences and refresh your provisioning profiles (or download and install them manually if you need to).
这些步骤可以让您通过此设备不能付款错误。
These steps should get you past the "This device cannot make payments" error.
这篇关于ApplePay iOS错误 - 此设备无法付款的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!