Integrating Apple Pay JS API

Create a Merchant Identity Certificate

A Merchant Identity Certificate is associated with your Apple Pay Merchant ID and is used to authenticate your sessions with the Apple Pay servers.

To obtain the Merchant Identity Certificate, follow the below steps:

  1. Navigate to the directory where all the previous certificates are stored.

  2. Open Git Bash or any other common-line environment which supports OpenSSL from the above directory.

  3. Execute the following OpenSSL command to create a private key:

    openssl genrsa -out private-key.key 2048

  4. Execute the following command to generate a certificate signing request from the private key.

    openssl req -new -key private-key.key -out csr.txt

  5. Log in to Apple Developer Portal and Create a Merchant Identity Certificate. Refer Create a merchant identity certificate for the setup steps.

    When prompted, the merchant should upload the certificate signing request file (csr.txt) created using the private key. This CSR file is different from the one generated from the Merchant Backoffice portal for creating the Payment Processing Certificate.

  6. When prompted, download the Apple Pay Merchant Identity Certificate (merchant_id.cer).

  7. Save the merchant_id.cer in the same directory where the private key and the certificate signing request file (csr.txt) is saved.

  8. Convert the Merchant Identity Certificate (merchant_id.cer) downloaded from Apple Developer Portal to a text certificate (merchant_id.pem) using the following command:

    openssl x509 -inform der -in merchant_id.cer -out merchant_id.pem

Completing the above setup enables you to use Apple Pay JS API and create an Apple Pay session with the Merchant Identity Certificate.

While your Apple Pay Merchant ID never expires, the Payment Processing Certificate, Merchant Identity Certificate, and domain verification do expire. See Maintaining Your Environment for more information.

Get Your Paysafe API Keys

Once you register for a Test merchant account on the Paysafe Developer Center, you will have access to the following API keys:

  • API key for Card and Customer Vault API
  • API key for Single-Use Token

You can get both of these API keys in our Merchant Back Office, under Settings > API Key.

Did you find this page useful?