Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ApplePay iOS error - This device cannot make payments

Tags:

ios

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];
like image 248
y2chaits Avatar asked Oct 20 '14 23:10

y2chaits


People also ask

Why is Apple Pay not letting me pay?

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.

What does the region setting for this device Cannot be used with Apple Pay?

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.


2 Answers

Apple's documentation is woefully inadequate in listing integration steps in detail.

Apple's Getting Started with Apple Pay document mentions these bullet points:

Prerequisites

In addition to implementing Apple Pay with the PassKit framework, you must:

  • 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.

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.

like image 153
y2chaits Avatar answered Sep 28 '22 04:09

y2chaits


Make sure the Credit card you setup on Passbook is verified...otherwise, PKPaymentAuthorizationViewController will return nil.

like image 28
Adetiloye Philip Kehinde Avatar answered Sep 28 '22 05:09

Adetiloye Philip Kehinde