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];
Restart your device. See if you, or the recipient, need to verify your identity. Make sure that the recipient is eligible to receive Apple Cash payments. The recipient must meet the requirements, and they need the latest versions of iOS or watchOS.
Check the region on your device to ensure it is correct (Settings>general>language & region - set to your region) A passcode is required to use the Wallet app. You need to be in a region that supports Apple Pay - Countries and regions that support Apple Pay - Apple Support.
Apple's documentation is woefully inadequate in listing integration steps in detail.
Apple's Getting Started with Apple Pay document mentions these bullet points:
In addition to implementing Apple Pay with the PassKit framework, you must:
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.
Edit: But wait, there's more!
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.
Make sure the Credit card you setup on Passbook is verified...otherwise, PKPaymentAuthorizationViewController will return nil.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With