Apple Pay integration on the WEB - setting up the Sandbox environment

2.3k views Asked by At

I want to integrate Apple Pay on my website (so it's a Apple Pay - Web Integration), using the Braintree payment provider, JS as a client side language and Java as a server side language.

I'm having difficulties creating a proper sandbox environment for my Apple Pay implementation Testing. Followed the steps from the Apple docs but it seems they are not accurate:

  • Says to create a Merchant Id, one for sandbox and one for production (as far as I can see, at the moment of creating those 2, there's no way of telling that you want to use one for the development environment and the other for the production)

  • After that, says to create a Certificate using the Merchant ID created before; if I sign in to my Apple Developer Account, I can see the 'Development' and the 'Production' sections, but when I try to create a sandbox/development certificate, Apple Pay is not available for it, only in the production section (see images below).

    Is there a way to create a Sandbox / Development Apple Pay certificate, or are there any other ways to properly test the Apple Pay integration?

I tried creating a sandbox user tester account from iTunes, but when I tried to login on ITunes on my IPad(compatible with Apple Pay) which I'm using for testing, I get the following error: ITunes account creation not allowed. This Apple ID cannot be used with the ITunes Store at this time. Please try again later. I already verified my Apple ID and followed all the steps to activate the account, but without any success.

As I was trying to create Sandbox Apple Pay certificates I mistakenly created 2 for the production environment. Could I revoke them without any problems and create another ones ?

If you integrated Apple Pay on the WEB, I would highly appreciate any help, since I'm having such difficulty in simply setting up my testing environment.

  • All certificates are from the below images are created from the 'Development' section of the Apple Developer Account.

First image: Img1

Second image: Img2

2

There are 2 answers

0
andreealib On BEST ANSWER

Sandbox Apple Pay Certificate problem: @zep clarified the sandbox situation: Apple doesn't have an Apple Pay Sandbox Certificate section, instead you must use one of the merchant IDs created in the Apple Developer account for the sandbox certificate creation: the fact that you upload the certificate to the Braintree Sandbox control Panel ensures the distinction between the 2 environments (+ you need to use a sandbox tester user account for the testing Apple devices).

ITunes connection problem: You only need to log into ICloud with the sandbox user tester account (which I managed, there seems to be no problem there),but no need for logging in ITunes.

1
zepp On

Full disclosure: I work at Braintree. If you have any further questions, feel free to contact [email protected].

Since Apple doesn't have a "Sandbox" Apple Pay Certificate, the Production Apple Pay Certificate can be used with the Braintree Sandbox environment.

After downloading a CSR from your Braintree Sandbox Control Panel, go to the Apple Developer Center, pick the Apple Pay Merchant ID you're going to use with the Sandbox, and, under the Production section, chose Apple Pay Certificate. Then upload that certificate to your Braintree Sandbox Control Panel per these instructions.

You do not need to log into the iTunes store with your sandbox tester user account on your test device. You will need to log into iCloud with that tester account.

Edited to add: the other primary difference between production and sandbox is that you don't need to host a domain association file on your site for sandbox.