Apple Pay BETA
Topics covered on this page
Enable Apple Pay to allow your customers to make purchases using a credit or debit card connected with their Apple Wallet. This guide walks you through the payment flow and steps to implement the service.
Apple Pay transactions will only be proceeded with non-3D Secure.
How to enable
- Supported Countries: Singapore
- Minimum API version:
2017-11-02
To enable Apple Pay, send an email requesting this feature to support@opn.ooo.
Payment flow
Apple Pay supports payments on websites and iOS devices. Customers who choose to make payments using Apple Pay initiate the transaction by tapping or clicking the Apple Pay button embedded in your platform. Customers who have already linked a card to their Apple Wallet will be able to choose their preferred card right away. Those who still need to will be given the option to link a new card.
Once the customer selects their preferred card and confirms the payment, the card will be charged the same way as the normal credit card payments flow. Your account’s current card processing settings may apply to Apple Pay transactions.
Apple Pay transactions will only be proceeded with non-3D Secure.
Using a desktop browser
To start the Apple Pay payment, ❶ the customer selects Apple Pay as their preferred payment method during checkout on your website. ❷ The customer then chooses their preferred credit or debit card linked to their Apple Wallet. Then, reviews and confirms the payment. ❸ Upon confirmation, Opn will send a webhook event (if enabled) indicating that the charge is complete.
Before deploying Apple Pay on your website, make sure your implementation follows the Acceptable Use Guidelines for Apple Pay on the Web.
Using a mobile application
To start the Apple Pay payment, ❶ the customer selects Apple Pay as their preferred payment method on your mobile application. ❷ The customer then chooses their preferred credit or debit card linked to their Apple Wallet. Then, reviews and confirms the payment. ❸ Upon confirmation, Opn will send a webhook event (if enabled) indicating that the charge is complete.
Implementation
Follow the Apple Pay Marketing Guidelines to add Apple Pay payment buttons to your website or iOS app. After the customer taps the button and selects their card, you will receive an Apple Pay token containing the card information. You then send this type of token to our Token API to obtain a card token that is usable on our Charge API.
Opn treats Apple Pay tokens the same way as sensitive card data. Therefore, unless you have a PCI-DSS license, these tokens must first be converted to card tokens before you can use them on your servers. Read more in Collecting Cards.
In summary, make the following API requests to create a charge with Apple Pay.
- Obtain an Apple Pay token from Apple when the user initiates payment through the Apple Pay button.
- Create a card token from Apple Pay token using Omise.js.
- Create a charge using the obtained card token from Step 2.
- After receiving the charge completion webhook event, retrieve the charge to verify its status (optional, but recommended).
The following sequence diagram shows how to obtain the card token.
Configuring an Apple Pay environment
To support Apple Pay on your website or application, you must complete a few setup steps before you can use the Apple Pay web and/or app APIs. Opn provides two options for you to select from.
Option | Supports |
---|---|
1. Use Opn Apple developer account | Web only |
2. Use your Apple developer account | Web and App |
1. Use Opn Apple developer account
You can enable Apple Pay on your website using the provided Opn merchant identifier without requiring you to create an Apple developer account. This method supports only Web integration.
Follow these steps to obtain an Apple Pay merchant ID and merchant identity certificate and verify your domains for the Apple Pay web integration.
- Obtaining Apple Pay merchant ID and Apple merchant identity certificate. You can obtain an Apple merchant ID and an Apple merchant identity certificate from the Opn dashboard.
The merchant identity certificate is a Transport Layer Security (TLS) certificate associated with your merchant ID. It is used to authenticate your sessions with the Apple Pay servers. To ensure uninterrupted service, please download a new certificate from your website before the expiration of the current one.
- Verify your web domains with Opn.
Register your merchant domains where you’ll display the Apple Pay button with Opn via email at support@opn.ooo to receive the domain association file and host this file at
https://[DOMAIN_NAME]/.well-known/apple-developer-merchantid-domain-association
on your website. Then Opn will proceed with verifying your domains.
You must register and verify all top-level domains and subdomains. For example, opn.ooo is the top-level domain, and shop.opn.ooo is the subdomain you must register.
2. Use your Apple developer account
This option enables you to integrate with Apple Pay on both the Web and the app. For detailed instructions on setting it up, refer to these Apple Pay configuration guides. Configuration involves registering a merchant ID, generating certificates, and validating your web domains.
For Opn to accept payments from your Apple merchant ID, you must use a Payment Processing CSR provided by us to create a Payment Processing Certificate with Apple by following these steps.
- Create your Apple merchant Identifier. You need to first enroll in the Apple Developer Program and register your Apple Pay merchant ID.
- Submit Apple merchant ID and get Payment Processing CSR with Opn. Reach out to Opn via email at support@opn.ooo to submit your Apple merchant ID for our system and request a Certificate Signing Request (CSR) for your Payment Processing Certificate. Once received, we will create the CSR and promptly return it to you.
- Create a Payment Processing Certificate with Apple. Please use the Payment Processing CSR from Opn to generate a Payment Processing Certificate on your Apple account.
- Submit Payment Processing certificate to Opn. Once you have obtained the certificate, please download it and submit it to Opn for further processing. Subsequently, your Apple Pay configuration will be visible on the Opn dashboard.
Obtaining an Apple Pay token
With your configuration complete, you can now add an Apple Pay button to your app or website and be able to receive an Apple Pay token.
Please follow the Apple Pay developer documentation to render an Apple Pay button, integrate with Apple APIs, and receive an Apple Pay token.
In the payment request, ensure that the following fields follow these guidelines.
- Field
supportedNetworks
should reflect the supported card brands from the Capability API. - Field
merchantIdentifier
is the Apple Pay merchant identifier.
After that, you will receive a token from Apple Pay. The Apple Pay token should be used within 5 minutes.
{
"data": "...",
"signature": "...",
"header": {
"publicKeyHash": "...",
"ephemeralPublicKey": "...",
"transactionId": "..."
},
"version": "EC_v1",
}
Creating a card token
Once you receive an Apple Pay token, create a card token using the following tokenization parameters.
Name | Type | Description |
---|---|---|
method |
string | (required) Set to applepay string. |
data |
string | (required) Apple Pay token. |
merchant_id |
string | (required) Apple Merchant identifier. |
brand |
string | (required) The selected card brand. (Web, iOS) |
billing_name |
string | (optional, but recommended) Card owner name. |
billing_city |
string | (optional, but recommended) Billing address city. |
billing_country |
string | (optional, but recommended) Billing address country as a two-letter ISO 3166 code. |
billing_postal_code |
string | (optional, but recommended) Billing address postal code. |
billing_state |
string | (optional, but recommended) Billing address state. |
billing_street1 |
string | (optional, but recommended) Billing address street #1. |
billing_street2 |
string | (optional) Billing address street #2. |
billing_phone_number |
string | (optional) Billing address phone number. |
By default, the cardholder's name and billing address won't be attached to a card token, and the name will be displayed as Apple Pay. To override this behavior, supply billing contact fields (Web, iOS) when requesting payment to Apple.
The card token can be used to create a charge within 10 minutes.
For Omise.js, set the token input type to tokenization
as the first argument of the createToken
function and submit the tokenization parameters as the second.
Omise.setPublicKey("your_omise_public_key");
tokenParameters = {
method: 'applepay',
data: '{"data":"Ls06CdzKeOXc1AtBgszMr8JF+DbIOj4LyQcQbVnC+RjihUa+SPwRcIVLzUwaFpHlM4atA3Ls2BXA2mg97WIECfnssAYRGWRcjyKtUqEfNR+tT7ztRCYVGIL4hdNMqTNBk+x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98bNBy/5JuM/oIv99p5sgobYxzZQWkt4N+bQhYcwAAAAAAAA==","header":{"publicKeyHash":"vRQNoc2OWcP7vDrLcGZ8QMnUH784bNV+1mmh65Z/kx4=","ephemeralPublicKey":"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE7uNpkxQ6EFIKMQc/8o68mtrXACyiDGUPVYZUD7ZmtVTCoao41U0w12DdXnDb5HidaYbJzJtoFIr+3q6d4k/h3g==","transactionId":"ac06f094edb34a6fc568ed5847acca0076103f5fe49f5624f941dd420b574268"},"version":"EC_v1"}',
merchant_id: 'merchant.omise.sg.prod',
brand: 'Visa'
};
Omise.createToken('tokenization', tokenParameters, function(statusCode, response) {
console.log(response)
});
For testing, you can create the same request using curl
. Please note that this example must only be used in test mode, as in live mode, Apple Pay tokens must be sent from the client side.
curl https://vault.omise.co/tokens \
-u $OMISE_PUBLIC_KEY: \
-d 'tokenization[method]=applepay' \
--data-urlencode 'tokenization[data]={"data":"kXM89lJuOE+kdG5YoY6YdgSH6j3B3JiEoGUFXAWk0JKiL4Kxl3CQ4A/+A6AK31D/5l9tPnGXa5q65dEeVLcExpFplB0S5zWUdCKZG7KEqD0t4ZQtgFUSG1neFgLX5LvoDo1VtVowhKE33kh+B9S5xYcdIeU1NnKsrmCjA8E9J/FI2MKKXwVK30jxSXFapxpAwwHsp+YHMhLEJ7Bgm2sPOt6A4iQln9CoFVOrtEDYy83ZT66h6NxlUIeQQ+csP4DWYrlc/hjUwFDGQvSFTZbtff0PCsDQ0iZHZBk0/FlzkPRUvLeA3nWDMXw11f8vypTZObJG61hkxEHgaMkv+ZoDXQGP/OHT9qp5QTNxeOqQA/YcYSHxRi3taKjz7/9QT16MBDnTwVaVpxH2ygRXpimqyir99zmx3rXN+0HE80RT6w==","signature":"MIAGCSqGSIb3DQEHAqCAMIACAQExDTALBglghkgBZQMEAgEwgAYJKoZIhvcNAQcBAACggDCCA+MwggOIoAMCAQICCBZjTIsOMFcXMAoGCCqGSM49BAMCM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gQCBQAwCgYIKoZIzj0EAwIDZwAwZAIwOs9yg1EWmbGG+zXDVspiv/QX7dkPdU2ijr7xnIFeQreJ+Jj3m1mfmNVBDY+d6cL+AjAyLdVEIbCjBXdsXfM4O5Bn/Rd8LCFtlk/GcmmCEm9U+Hp9G5nLmwmJIWEGmQ8Jkh0AADGCAYgwggGEAgEBMIGGMHoxLjAsBgNVBAMMJUFwcGxlIEFwcGxpY2F0aW9uIEludGVncmF0aW9uIENBIC0gRzMxJjAkBgNVBAsMHUFwcGxlIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MRMwEQYDVQQKDApBcHBsZSBJbmMuMQswCQYDVQQGEwJVUwIIFmNMiw4wVxcwCwYJYIZIAWUDBAIBoIGTMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTI0MTEyMTA4MjcyM1owKAYJKoZIhvcNAQk0MRswGTALBglghkgBZQMEAgGhCgYIKoZIzj0EAwIwLwYJKoZIhvcNAQkEMSIEII9sGEHDJLuzCpU8I3MSa+hI159SfsfyYsrbybCJKvHbMAoGCCqGSM49BAMCBEcwRQIgJBBtK8EMx5elF4KcIjXaKXnVoq7E4s4Q+fdqt6XL25MCIQCup0MC4kqBa9WIs5Mts1d/gewCugj7pdo5T/kvsx1LdQAAAAAAAA==","header":{"publicKeyHash":"/PbrG6EesIaHQNXliuBMw0EgbgE/CMdsxDClG6JSTaA=","ephemeralPublicKey":"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEsc699NoInfHNeoHCfXFiHR0Mipw2djeazF0D476DYpu3u9CGa8td7i6/u4QZcB69vyCbrJoVro4vVro0FIEjmQ==","transactionId":"2a0b583e5559b4c6213df371a9da2d574d2994435d8d7dc6eaf086155cef0bb6"},"version":"EC_v1"}' \
-d 'tokenization[merchant_id]=merchant.omise.sg.prod' \
-d 'tokenization[brand]=Visa'
{
"object": "token",
"id": "tokn_test_61tjz0z25kdq3vvz3l0",
"livemode": false,
"location": "https://vault.omise.co/tokens/tokn_test_61tjz0z25kdq3vvz3l0",
"used": false,
"charge_status": "unknown",
"card": {
"object": "card",
"id": "card_test_61tjz0yxrc16piwuiy3",
"livemode": false,
"location": null,
"deleted": false,
"street1": null,
"street2": null,
"city": null,
"state": null,
"phone_number": null,
"postal_code": null,
"country": "us",
"financing": "credit",
"bank": "JPMORGAN CHASE BANK N.A.",
"brand": "Visa",
"fingerprint": "lfgpKUT29328scrabNJ0Aj1CVdziBPJP4Oah/WB9O2I=",
"first_digits": null,
"last_digits": "1111",
"name": "Apple Pay",
"expiration_month": 1,
"expiration_year": 2030,
"security_code_check": true,
"tokenization_method": "applepay",
"created_at": "2024-11-21T08:27:38Z"
},
"created_at": "2024-11-21T08:27:38Z"
}
The id
attribute is the token identifier (begins with tokn
).
Creating a charge
Refer to Credit Card Payments to charge a card with the received card token. There are a couple of differences between card tokens that are generated from a specific tokenization method (applepay
) compared to normal ones:
- These card tokens have a field
tokenization_method
to tell what tokenization method was applied on the card. - These card tokens cannot be used in the Customers API.
Additional options
When using a pre-built payment form, you can set additional configuration options to have more control over the Google Pay API. The relevant parameters are as follows.
Data Attribute | Parameter | Description |
---|---|---|
data-applepay-validation-url |
applepayValidationUrl |
The URL to validate your server and obtain a merchant session object for Apple Pay (required when accepting live traffic). |
data-applepay-merchant-id |
applepayMerchantId |
Merchant ID for Apple Pay (required when accepting live traffic). |
data-applepay-request-billing-address |
applepayRequestBillingAddress |
Set to true to attach the cardholder's name and billing address to a card token. Supplying this improves your authorization rate for US, UK, and Candian cardholders. |
The full list of the supported parameters can be found here.
Testing
To complete the whole user journey, you need an Apple account that supports an Apple Wallet and a chargeable card. We recommend using an Apple sandbox tester account and attaching one of the available test cards provided by Apple for the test mode.
You can create a token and a charge with an Omise test key to simulate a successful charge, and the card number will always be 4111 1111 1111 1111
in our system. Please note that the Apple Pay environment configuring process is also required with an Omise test key.