Apple Pay is a digital wallet service that allows cardholders to store payment cards securely on their Apple devices and make transactions. Apple Pay leverages the device’s secure hardware and tokenization standards defined by the card schemes to replace the actual Primary Account Number (PAN) with a device-specific token.
From a payments perspective, Apple Pay enables:
Apple Pay supports both in-store transactions (via NFC contactless) and in-app/web transactions (via Apple Pay APIs). For acquirers, gateways, and merchants, integration ensures compliance with scheme and Apple requirements while delivering a frictionless checkout experience to cardholders.
This document covers the end-to-end Apple Pay integration process for merchants using the Global Payments API. It explains what the required certificates are, why they're needed, and what to do with them at each step.
| Phase | Purpose |
|---|---|
| 1. Create merchant ID | Apple Developer Portal setup |
| 2. Provision certificates | Merchant identity & payment processing certifications |
| 3. Host verification file | Domain verification required by Apple |
| 4. Backend session validation | Authenticate with Apple via your certificate & key |
| 5. Token handling | Global Payments decrypts the Apple Pay token |
To ensure safe, isolated testing and production operation, merchants should adopt the following structure:
A) Log into your Apple Developer account and click on the Identifiers tab on the top-right corner.
B) Click the plus icon "+" to add a new Apple Pay merchant ID.
C) Use the following format: merchant.com.yourbrand.
D) Save this ID. It will be referenced in certificates and needed for session validation.
The merchant identity certificate is necessary to validate Apple Pay sessions in Safari/iOS.
A) Provision the Merchant Identity Certificate:
openssl genrsa -out merchant_id.key 2048
openssl req -new -key merchant_id.key -out merchant_id.csr \
-subj "/CN=Apple Pay Merchant ID: merchant.com.yourbrand"B) Log into your Apple Developer account, click on Certificates and then Merchant Identity Certificate to upload the Certificate Signing Request (CSR)
C) Download the resulting merchant_id.cer.
D) Use the OpenSSL code below to convert the merchant ID certificate to .pem file format. This is necessary because Apple Pay’s default .cer file format cannot typically be read by other systems and can create issues.
openssl x509 -in merchant_id.cer -inform DER -out merchant_id.pem -outform PEMBelow, there are two additional, optional steps that you can use if needed. Once you complete Step 1 and 2.1, you’ll have the keys necessary for your backend Apple Pay session validations.
Keep these secure. They are used only for backend Apple Pay session validation.
While merchant setup is outside of the scope of Global Payments' API, if your backend requires a combined file, you can use the following step to create it.
cat merchant_id.pem merchant_id.key > merchant_combined.pemThis is an optional step that allows you to ensure you’re using the right .key and .pem combination. They should match:
openssl rsa -noout -modulus -in merchant_id.key | openssl md5openssl x509 -noout -modulus -in merchant_id.pem | openssl md5Both returned values should be identical.
Apple Pay requires a payment processing certificate to encrypt the payment token. The certificate owner then uses the same certificate to decrypt the payment token and process the transaction.
There are two options for handling decryption.
With this option, Global Payments generates the CSR and stores the related private key.
A) Log in to Realcontrol in Sandbox or Production.
B) On the Client Settings tab, navigate to the Apple Pay section. Click the Obtain CSR button to generate and download a new certificate. Note that generating one CSR per client is recommended.
C) Log into your Apple Developer Account and click on the Identifiers tab on the top-right corner.
D) Select Merchant IDs → your Merchant ID → Apple Pay Payment Processing Certificate and upload the CSR you downloaded in Step 2 with this option.
E) Download the .cer file.
F) Return to your Global Payments Portal and upload the .cer file to the Apple Pay section.
With this option, the whole wallet process occurs outside the Global Payments environment, and we will only receive an Auth request.
A) Use the code below to decrypt the token and generate the CSR.
openssl ecparam -name prime256v1 -genkey -noout -out payment.key
openssl req -new -key payment.key -out payment.csr \
-subj "/CN=Apple Pay Merchant ID: merchant.com.yourbrand"B) Log into your Apple Developer account, select Certificates, then Payment Processing Certificate to upload the CSR.
C) Download the payment .cer file.
D) Apple frequently serves .cer files as .der files. So it's best to convert to .pem format if you're going to combine.
openssl x509 -in payment.cer -inform DER -out payment.pem -outform PEMApple requires domain verification.
A) Add your domain to the Domain Verification section in your Apple Developer account. Do not use https://. The domain name (e.g., test.com) is all that is expected.
B) Log into your Apple Developer account, select your Merchant ID, then click Add Domain, to access and download the domain verification file.
C) Host the file at the domain location as shown: https://yourdomain.com/.well-known/apple-developer-merchantid-domain-association.
D) Be aware that the file:
This step is required for Safari/iOS to activate the Apple Pay session securely.
The following call returns a valid applePaySession that your frontend uses for validation:
requests.post(validation_url, cert=('merchant_id.pem', 'merchant_id.key'), json={
"merchantIdentifier": "merchant.com.yourbrand",
"displayName": "Your Store",
"initiative": "web",
"initiativeContext": "yourdomain.com"
})const https = require('https');
const agent = new https.Agent({
cert: fs.readFileSync('merchant_combined.pem'),
key: fs.readFileSync('merchant_combined.pem')
});After the Apple Pay JS returns the token, you send the entire token payload to Global Payments:
{
"source": {
"type": "applepay",
"token": {
"version": "EC_v1",
"data": "...",
"signature": "...",
"header": { ... }
}
},
"amount": 1000,
"currency": "EUR",
"reference": "ORDER-1234"
}Global Payments uses the previously provided payment processing cert generated in Step 2.2 to decrypt the token and process the payment.
| File | Needed For | Share with Global Payments? |
|---|---|---|
| merchant_id.key | Apple session validation | No - Keep secure |
| merchant_id.pem | Apple session validation | No - Keep secure |
| merchant_combined.pem | Optional for certain SDKs | No - Keep secure |
| payment.cer | Public certificate from Apple | Yes - Required |
| apple-developer-merchantid-domain-association | Domain verification | No - Keep secure |
This guide contains OpenSSL and curl commands to verify:
Change the names, bolded in the commands below, to match your files.
To verify the merchant identity certificate, change merchant_id.pem to match your file.
Make sure each certificate is used with the correct AMID: You can verify this using OpenSSL as shown below.
openssl x509 -in ./certs/merchant_id.pem -noout -subject -issuer -serial -fingerprint -enddateExpected output includes:
subject=UID=merchant.newdocs.gp, CN=merchant.newdocs.gpissuer=Apple Inc.serial, fingerprint, and notAfter dateopenssl x509 -in apple_pay.cer -inform DER -out apple_pay.pem -outform PEM
openssl x509 -in ./apple_pay.pem -noout -subject -issuer -serial -fingerprint -enddateExpected output includes:
subject=UID=merchant.newdocs.gp, CN=Apple Pay Payment Processing:merchant.newdocs.gpissuer=Apple Inc.serial, fingerprint, and notAfter dateIf using a .csr generated by RealControl or another system:
openssl req -in ./Realex.certSigningRequest -noout -textExpected output includes:
Subject: CN=realex payments userPublic Key Algorithm: id-ecPublicKeyASN1 OID: prime256v1curl -s -o - https://test.org/.well-known/apple-developer-merchantid-domain-associationExpected output:
["merchant.newdocs.gp"]
To check for HTTP 200:
curl -s -o /dev/null -w "%{http_code}" https://test.org/.well-known/apple-developer-merchantid-domain-associationIf all of these are true, you should be ready to go:
.cer file to .pem and integrated it into my backend.startSession response from Apple and verified it loads in the frontend.