Apple Pay
Payment Product ID: 302
Apple Pay enables customers to pay securely using Touch ID or Face ID on their iOS devices. Card data is tokenized and stored securely in the Apple Pay wallet, providing enhanced security and a frictionless checkout experience.
Benefits
- Seamless Authentication - Native Touch ID/Face ID for quick checkout
- Enhanced Security - Tokenized card data with Device PAN (DPAN)
- Higher Conversion - Reduced friction for mobile transactions
- Wide Device Support - iPhone, iPad, Apple Watch, Mac
Supported Card Brands
- Visa
- Mastercard
- American Express
- Cartes Bancaires
Device Requirements
| Device | Requirements |
|---|---|
| iPhone | Face ID or Touch ID (iPhone 6 and later) |
| iPad | iPad Pro, Air, standard, or mini with Touch ID |
| Apple Watch | Series 1 and later |
| Mac | Touch ID or paired Apple Watch |
Integration Methods
Hosted Checkout Page
The simplest integration method. Apple Pay automatically appears for customers using Safari on supported Apple devices.
{
"order": {
"amountOfMoney": {
"currencyCode": "EUR",
"amount": 2980
}
},
"hostedCheckoutSpecificInput": {
"locale": "en_GB",
"returnUrl": "https://yoursite.com/return"
},
"mobilePaymentMethodSpecificInput": {
"authorizationMode": "FINAL_AUTHORIZATION",
"paymentProductId": 302
}
}
Cross-Device Flow
Customers on desktop can scan a QR code to complete payment on their Apple device:
- Customer initiates checkout on desktop
- Apple Pay QR code is displayed
- Customer scans QR code with iPhone
- Apple Pay sheet opens on iPhone
- Customer authenticates with Face ID/Touch ID
- Desktop receives confirmation
Mobile SDK Integration
For native iOS apps, choose between platform-handled or merchant-handled decryption.
Platform-Handled Decryption (Recommended)
Worldline handles decryption of the Apple Pay token. Simplest approach with lowest PCI scope.
- API Request
- iOS (Swift)
{
"mobilePaymentMethodSpecificInput": {
"paymentProductId": 302,
"authorizationMode": "FINAL_AUTHORIZATION",
"encryptedPaymentData": "eyJ2ZXJzaW9uIjoiRUNfdjEiLCJkYX...",
"ephemeralKey": "MFkwEwYHKoZIzj0CAQYIKoZIzj...",
"publicKeyHash": "uUhU0fJoEJNk11gR8Ptd5Uw+jAnudz..."
},
"order": {
"amountOfMoney": {
"amount": 2980,
"currencyCode": "EUR"
}
}
}
func handleApplePayAuthorization(payment: PKPayment) {
let paymentData = payment.token.paymentData
let base64PaymentData = paymentData.base64EncodedString()
// Send to your server
let request = CreatePaymentRequest(
encryptedPaymentData: base64PaymentData,
ephemeralKey: extractEphemeralKey(from: payment),
publicKeyHash: extractPublicKeyHash(from: payment)
)
// Your server sends this to Worldline API
sendToServer(request)
}
Merchant-Handled Decryption
You decrypt the Apple Pay token before sending to Worldline. Provides more control but increases PCI scope.
{
"mobilePaymentMethodSpecificInput": {
"paymentProductId": 302,
"authorizationMode": "FINAL_AUTHORIZATION",
"decryptedPaymentData": {
"dpan": "4761120010000492",
"expiryDate": "1225",
"cryptogram": "jiSRYgf6G2rjYwAAC0GPAHQAAAA=",
"eci": "7",
"cardholderName": "John Doe"
}
},
"order": {
"amountOfMoney": {
"amount": 2980,
"currencyCode": "EUR"
}
}
}
Onboarding Setup
Step 1: Apple Developer Account
- Enroll in the Apple Developer Program
- Create an Apple Merchant ID
- Accept Apple Pay terms and conditions
Step 2: Certificate Configuration
For platform-handled decryption:
- Go to Merchant Portal > Business > Payment Methods > Apple Pay
- Download the Certificate Signing Request (CSR)
- In Apple Developer Portal, create an Apple Pay certificate using the CSR
- Upload the generated certificate to Merchant Portal
Certificates expire after two years. You'll receive email notifications before expiration. Create separate certificates for test and production environments.
Step 3: Enable Apple Pay
- In Merchant Portal, go to Business > Payment Methods
- Enable Apple Pay (Payment Product 302)
- Test in sandbox environment
Recurring Payments
Apple Pay supports recurring payments (Card on File):
Initial Payment
{
"mobilePaymentMethodSpecificInput": {
"paymentProductId": 302,
"encryptedPaymentData": "xxx",
"ephemeralKey": "xxx",
"publicKeyHash": "xxx",
"paymentProduct302SpecificInput": {
"isRecurring": true,
"tokenize": true,
"recurring": {
"recurringPaymentSequenceIndicator": "first"
}
}
},
"order": {
"amountOfMoney": {
"currencyCode": "EUR",
"amount": 1000
}
}
}
Subsequent Payments
Use the stored token for subsequent charges:
{
"subsequentCardPaymentMethodSpecificInput": {
"subsequentType": "recurring"
},
"order": {
"amountOfMoney": {
"amount": 1000,
"currencyCode": "EUR"
}
}
}
Subscription Configuration
Configure recurring billing details:
{
"mobilePaymentMethodSpecificInput": {
"paymentProduct302SpecificInput": {
"applePayRecurringPaymentRequest": {
"paymentDescription": "Monthly Subscription",
"regularBilling": {
"label": "Premium Plan",
"amount": "9.99",
"type": "final",
"paymentTiming": "recurring",
"recurringPaymentIntervalUnit": "month",
"recurringPaymentIntervalCount": 1
},
"managementURL": "https://yoursite.com/manage-subscription"
}
}
}
}
PKPayment Mapping
Map Apple's PKPayment object to the API request:
| PKPayment Property | API Property |
|---|---|
token.data.applicationPrimaryAccountNumber | dpan |
token.data.applicationExpirationDate | expiryDate |
token.data.paymentData.onlinePaymentCryptogram | cryptogram |
token.data.paymentData.eciIndicator | eci |
billingContact.emailAddress | contactDetails.emailAddress |
billingContact.phoneNumber | contactDetails.phoneNumber |
billingContact.name | personalInformation.name |
billingContact.postalAddress | billingAddress |
Testing
Use the Apple Pay sandbox environment for testing:
- Create a sandbox Apple ID in App Store Connect
- Add test cards to the sandbox wallet
- Use the Worldline test environment endpoint
Apple provides test cards specifically for sandbox testing. See Apple's documentation for available test card numbers.
Country & Currency Support
Supported Countries: 40+ including Australia, Belgium, Canada, France, Germany, Japan, Netherlands, UK, US
Supported Currencies: 150+ including EUR, USD, GBP, JPY, CAD, AUD
Security
Apple Pay provides multiple security layers:
- Tokenization - Card numbers are never stored or transmitted
- Device PAN (DPAN) - Unique device-specific token
- Biometric Authentication - Face ID or Touch ID required
- Dynamic Security Code - Generated for each transaction
Best Practices
- Display Apple Pay prominently - Use Apple's official button guidelines
- Pre-fill customer data - Request shipping/billing from Apple Pay
- Handle errors gracefully - Provide clear feedback on failures
- Test on real devices - Simulator has limitations
- Keep certificates current - Monitor expiration dates
SDKs
| Platform | SDK |
|---|---|
| iOS (Swift/Obj-C) | GitHub |
| Android | GitHub |
| JavaScript | GitHub |
| Flutter | pub.dev |
| React Native | npm |
Next Steps
- Set up 3-D Secure for additional card security
- Configure webhooks for payment notifications
- Explore other payment methods