Apple Pay Web Integration Setup Guide
Overview: This document outlines the process for enabling Apple Pay on the web for customers, integrating with Authorize.net as the payment gateway. This is for web-based checkout (no native apps or devices required).
Prerequisites
- Active Authorize.net merchant account for your customer
- Apple Developer account (customer needs this)
- HTTPS website with valid SSL certificate
- Payment processor that supports Apple Pay tokenization through Authorize.net
Process Overview
The setup involves three main stages:
- Apple Developer Account Setup - Customer creates Apple Pay identifiers and certificates
- Authorize.net Configuration - Link Apple Pay to customer's Authorize.net account
- Domain Verification - Prove ownership of the domain serving Apple Pay
- Integration - Your frontend code uses customer's credentials
Part 1: Apple Developer Account Setup
Step 1.1: Create Apple Merchant ID
Your customer needs to create a unique Merchant Identifier in their Apple Developer account.
Actions for Customer:
- Log in to https://developer.apple.com
- Navigate to: Certificates, Identifiers & Profiles
- Select Identifiers from sidebar
- Click the + button
- Select Merchant IDs from the dropdown (top right)
- Click Continue
- Enter a description (e.g., "My Company Apple Pay")
- Enter identifier (format:
merchant.com.yourcompany.identifier)
- Example:
merchant.com.acmestore.payments
Important: This identifier never expires and can be reused
What You Need: Record the Merchant ID for later use
Part 2: Authorize.net Configuration
Step 2.1: Generate Certificate Signing Request (CSR)
The CSR is generated BY Authorize.net and uploaded TO Apple.
Actions for Customer:
- Log in to Authorize.net Merchant Interface at:
- Navigate to: Account > Digital Payment Solutions (or Tools > Digital Payment Solutions)
- Locate the Apple Pay section
- Click Sign Up or Enable
- Enter the Apple Merchant ID from Part 1 (e.g.,
merchant.com.acmestore.payments)
- Click Generate Apple CSR
- Download the CSR file (
.certSigningRequest)
Important: Use the CSR from Authorize.net, not one you create yourself.
Step 2.2: Create Payment Processing Certificate in Apple
This certificate allows Authorize.net to decrypt Apple Pay payment data.
Actions for Customer:
- Return to Apple Developer account
- Navigate to: Certificates, Identifiers & Profiles > Identifiers
- Select Merchant IDs from dropdown
- Click on the Merchant ID created in Step 1.1
- Under Apple Pay Payment Processing Certificate, click Create Certificate
- In the dialog, click Choose File
- Select the CSR file downloaded from Authorize.net (Step 2.1)
- Click Continue
- Click Download to save the certificate (
.cer file)
Important: This certificate expires every 25 months and must be renewed.
Step 2.3: Upload Certificate to Authorize.net
Actions for Customer:
- Return to Authorize.net Merchant Interface
- Navigate back to: Digital Payment Solutions > Apple Pay
- Upload the
.cer file downloaded from Apple
- Complete the enrollment process
What You Need: Customer's Authorize.net API credentials:
- API Login ID
- Transaction Key
Part 3: Domain Verification
Apple requires proof that you control the domain where Apple Pay will be displayed.
Step 3.1: Download Domain Association File
Actions:
- Apple provides a domain verification file
- Download:
apple-developer-merchantid-domain-association
- This is a text file that must be placed on your web server
Step 3.2: Host the Verification File
Place the file at this exact location on your web server:
https://yourdomain.com/.well-known/apple-developer-merchantid-domain-association
Requirements:
- Must be accessible via HTTPS
- Must be in the
.well-known folder at the root of your domain
- Must be publicly accessible (no authentication required)
- File must be served as-is (no modifications)
Step 3.3: Register Domain with Apple
Actions for Customer:
- Return to Apple Developer account
- Navigate to: Certificates, Identifiers & Profiles > Identifiers
- Select the Merchant ID
- Under Merchant Domains, click Add Domain
- Enter your domain (e.g.,
yourdomain.com)
- Do not include
https:// or www.
- Click Verify
- Apple will check for the association file
Result: Domain is registered and verified for Apple Pay
Part 4: Integration with Your Frontend Code
Step 4.1: What You Need from Customer
To integrate Apple Pay for each customer, you need:
- Apple Merchant ID (from Part 1)
- Example:
merchant.com.acmestore.payments
- Authorize.net API Credentials:
- API Login ID
- Transaction Key
- Environment (Sandbox or Production)
Step 4.2: Frontend Implementation Overview
Your existing frontend code needs to:
- Initialize Apple Pay Session with customer's Merchant ID
- Handle Merchant Validation (you may need a server-side endpoint)
- Receive Payment Token from Apple Pay
- Send to Authorize.net using customer's API credentials
Step 4.3: Processing Apple Pay Payments
When a payment is made:
Data Flow:
Customer's Browser (Apple Pay)
↓ [Apple Pay Token]
Your Frontend
↓ [Base64 Encoded Token]
Authorize.net API (using customer's credentials)
↓ [Payment Result]
Your Backend
Key Points:
- Apple Pay returns a payment token (JSON object)
- You must Base64-encode the entire token
- Send to Authorize.net using
opaqueData format:
dataDescriptor: "COMMON.APPLE.INAPP.PAYMENT"
dataValue: Base64-encoded Apple Pay token
- Use customer's Authorize.net API credentials for authentication
Step 4.4: Authorize.net API Call Structure
{
"createTransactionRequest": {
"merchantAuthentication": {
"name": "[Customer's API Login ID]",
"transactionKey": "[Customer's Transaction Key]"
},
"transactionRequest": {
"transactionType": "authCaptureTransaction",
"amount": "50.00",
"payment": {
"opaqueData": {
"dataDescriptor": "COMMON.APPLE.INAPP.PAYMENT",
"dataValue": "[Base64-encoded Apple Pay token]"
}
}
}
}
}
Part 5: Managing Multiple Customers
Storage of Customer Credentials
For each customer, you need to securely store:
- Apple Merchant ID
- Authorize.net API Login ID
- Authorize.net Transaction Key
- Environment (Sandbox/Production)
Runtime Selection
When processing a payment:
- Identify which customer the transaction belongs to
- Retrieve that customer's Apple Pay Merchant ID and Authorize.net credentials
- Use those credentials in the Apple Pay session and API call
- Payment is processed through their Authorize.net account
Important Limitations & Requirements
Payment Processor Support
Apple Pay through Authorize.net requires a payment processor that supports payment network tokenization. Your customer should verify this with their processor.
Certificate Expiration
Payment processing certificates expire every 25 months and must be renewed. Set reminders for customers.
Security Requirements
- All pages with Apple Pay must use HTTPS
- Domain must have valid SSL certificate
- Cannot use localhost for testing (use sandbox.authorize.net for testing)
Transaction Requirements
When submitting transactions:
- Must be e-commerce transactions (set
marketType=0)
- Cannot include credit card numbers or expiration dates
- Cannot include track data or 3D Secure data
- Transaction type must be
authCaptureTransaction or authOnlyTransaction
Testing & Validation
Sandbox Testing
- Use Authorize.net sandbox account (sandbox.authorize.net)
- Use Apple's sandbox environment
- Test with Apple's test cards in Wallet app
- Verify end-to-end flow before production
Validation Checklist
- Customer has Apple Developer account
- Merchant ID created in Apple Developer account
- CSR generated from Authorize.net
- Payment Processing Certificate created and uploaded
- Domain association file hosted at correct location
- Domain registered and verified with Apple
- Authorize.net API credentials obtained
- Frontend code configured with customer's Merchant ID
- Test transaction completed successfully
- Payment appears in customer's Authorize.net account
Troubleshooting
Common Issues
Domain Verification Fails:
- Ensure file is at exact path:
/.well-known/apple-developer-merchantid-domain-association
- Check file is accessible via HTTPS without authentication
- Verify SSL certificate is valid
- Don't include
https:// or www. when registering domain
Transaction Errors:
- Verify Authorize.net credentials are correct
- Ensure payment processor supports tokenization
- Check Base64 encoding of Apple Pay token is correct
- Verify
dataDescriptor is exactly "COMMON.APPLE.INAPP.PAYMENT"
Certificate Issues:
- Use CSR from Authorize.net, not self-generated
- Upload certificate back to Authorize.net after download from Apple
- Check certificate hasn't expired (25-month validity)
Summary
The key to multi-customer support is:
- Each customer completes Apple Developer setup independently
- Each customer provides you with their Apple Merchant ID and Authorize.net credentials
- Your code dynamically uses the appropriate credentials based on which customer is being served
- All payments flow through the correct customer's Authorize.net account
This approach is similar to how you currently handle credit card payments, but requires the additional Apple Pay setup steps for each customer.