Search code examples
javascriptjavasandboxbraintreeapplepay

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


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


Solution

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