ApplePay
| Feature | Description |
|---|---|
| Payment Logo - Usage Guidelines | |
| Integration Methods |
|
| Recommended Regions | Global |
| Virtual Industry Support | ✅ |
| Subscription Support | ✅ Varies by industry |
| Supported SaaS | All integrated SaaS platforms |
| Supported Open-Source Platforms |
|
Integration Method
Embedded
When using embedded integration,
- Merchants need to host domain verification files for each domain they register at the following path and ensure that the files at this path are accessible: Click to ⬇️ download the domain verification file.
https://[DOMAIN_NAME]/.well-known/apple-developer-merchantid-domain-association
Notice
If you have multiple subdomains or other domains, you need to add the above verification files, for example:
https://example.com/.well-known/apple-developer-merchantid-domain-association
https://test.example.com/.well-known/apple-developer-merchantid-domain-association
···
- Initiate domain verification:
- Request
- Response
cURL -X POST 'https://mds.oceanpayment.com/appleregistermerchant'
-H 'Authorization: MVc9Lt1CDY7RBRUvh8iVmvvPbYF3uvWkymUDz'
-d '{
"website": ["example.com,test.example.com"]
}'
{
"statusMessage": "Success",
"statusCode": 200
}
- Errors
| Response code | Description |
|---|---|
| 200 | OK
|
| 400 | Bad Request
|
| 401 | Unauthorized
|
| 417 | Expectation Failed
|
| 500 | Internal Server Error
|
- After domain verification is complete, Apple Pay will be displayed as a payment option on the checkout page, where possible.
Notice
Apple Pay is only available on Apple devices that support it (such as the Safari web browser and iOS devices), and the button will only be displayed on iOS 17 and above.
- The integration was completed using the Embedded integration solution.
Server to Server
To use this integration mode, you need to become an official ApplePay developer.
- ApplePay Developer Account Registration and Configuration
- Visit https://developer.apple.com.
- Choose the Apple Developer Program.
- Payment integration requires a corporate account; personal accounts cannot create Merchant IDs.
- Create Merchant ID
- Log in Apple Developer → Certificates, Identifiers & Profiles.
- Click the menu on the left Identifiers → Merchant IDs → (+), create Merchant ID.
- Generate Merchant Identity Certificate
- Generate a CSR (Certificate Signing Request) using Keychain or OpenSSL on a Mac.
- Go back to Apple Developer → Certificates → Add Certificate.
- After uploading the CSR, Apple returned a
.cerfile. - Download and install it locally, then export the
.p12file. - .p12 is used for payment gateways or intermediate servers to conduct signed and encrypted communication with Apple.
- Configure Merchant Domain whitelist
- Log in Apple Developer → Merchant IDs → Domain Verification.
- Add the merchant domain name (e.g., payments.oceanpayment.com).
- Follow the prompts to download the verification file apple-developer-merchantid-domain-association.
- Upload it to the website's root directory, for example: https://payments.oceanpayment.com/.well-known/apple-developer-merchantid-domain-association
- Click
Verifyto complete the verification.
- Obtain the Apple Pay Payment Token. View the complete ApplePay example, pass the Token to Oceanpayment via the
pay_accountNumberparameter, and call Server to Server integration.
const paymentRequest = {
countryCode: 'US',
currencyCode: 'USD',
total: {
label: 'OceanPayment Checkout',
amount: '10.00',
},
supportedNetworks: ['visa', 'masterCard', 'amex'],
merchantCapabilities: ['supports3DS'],
merchantIdentifier: 'merchant.oceanpayment.test',
};
session.onpaymentauthorized = function (event) {
const payment = event.payment;
console.log(JSON.stringify(payment));
console.log(JSON.stringify(payment.token));
processPayment(payment.token).then(function (response) {
console.log("response from datatrans received");
console.log(response);
if (response.match(/status=.error./)) {
console.log("an error occured!");
console.log(response);
return session.abort();
}
session.completePayment(ApplePaySession.STATUS_SUCCESS);
window.location.href = "/success.html";
});
};
function processPayment(paymentToken) {
let paymentMethod = paymentToken.paymentMethod;
let cardType = paymentMethod.network;
let environment = document.getElementById('environment').value;
let account = payParams[environment].account;
let terminal = payParams[environment].terminal;
let orderNo = new Date().getTime();
let orderCurrency = document.getElementById('#order_currency').value;
let orderAmount = document.getElementById('#order_amount').value;
document.getElementById('form').action = payParams[environment].url;
document.getElementById('account').value = account;
document.getElementById('terminal').value = terminal;
document.getElementById('pay_accountNumber').value = paymentToken.paymentData;
document.getElementById('card_type').value = cardType;
document.getElementById('order_number').value = orderNo;
document.getElementById('order_amount').value = orderAmount;
document.getElementById('methods').value = 'ApplePay';
let billingId = document.getElementById('billing_id').value;
let billingFirstName = document.getElementById('billing_firstName').value;
let billingLastName = document.getElementById('billing_lastName').value;
let billingEmail = document.getElementById('billing_email').value;
let signString = account + terminal + orderNo + orderCurrency + orderAmount
+ billingId + billingFirstName + billingLastName + billingEmail + payParams[environment].secureCode;
document.getElementById('signValue').value = sha256_digest(signString);
document.getElementById('form').submit();
}