Apple Pay
Last updated: November 6, 2024
Information
Apple Pay is also available through Flow. Flow enables you to accept payments on your website using Checkout.com's global network of payment methods with a single integration.
Apple Pay enables customers to authenticate card payments using Touch ID or Face ID. This eliminates the need for them to manually enter their card and shipping details.
To process Apple Pay payments in Kuwait, you must use the KNET network. For the integration instructions, see Apple Pay via KNET.
Note
If you plan to process Apple Pay payments through an entity outside of the European Economic Area (EEA) or United Kingdom (UK), contact your Account Manager or [email protected].
Apple Pay transactions benefit from liability shift due to Apple's built-in authentication mechanisms. Additional authentication from the issuer is not required.
To avoid issues with transactions performed on your app or website, you must:
- provide the correct country code in your payment request
- display the final amount on the payment sheet
Information
For more information, see the Apple documentation for Strong Customer Authentication and Complying with regional regulations.
If the issuer returns an ECI value for the transaction, the value will indicate which party is liable. If the issuer does not return an ECI value, the transaction is not eligible for liability shift.
Card networks may downgrade a transaction's liability shift during the authorization stage, despite the ECI value indicating the downgrade occurred during authentication. The liability shift outcome is determined after authorization.
Before you can accept Apple Pay payments, you need to set up and configure Apple Pay.
Note
If you process Mada cards through Apple Pay outside of Saudi Arabia, you're required to enforce the use of the Visa or Mastercard schemes instead.
To start setting up Apple Pay, you need the following:
- an Apple Developer account (learn more about enrollment requirements)
- a domain with a valid TLS certificate (meaning your domain should start with
https
) - access to a Secure Shell (SSH) terminal
- access to upload files to your server
Information
We recommend that you create separate Merchant IDs for your test and live environments.
- In your Apple Developer account, go to the Add Merchant IDs section, select Merchant IDs and select Continue.
- Add a useful description, like
merchant id for test environment
. - Enter your desired Merchant ID name in the Identifier section. We recommend that you use a descriptive name to indicate both the domain and the environment you will use it in. For example,
merchant.com.mywebsite.sandbox
.
Next, you need to submit a Certificate Signing Request (CSR) using the following endpoint:
post
https://api.checkout.com/applepay/signing-requests
You can use the protocol_version
field to specify whether to use the EC or RSA protocol for the CSR encryption.
For the full API specification, see the API reference.
1{2"protocol_version": "ec_v1"3}
1{2"content": "-----BEGIN CERTIFICATE REQUEST-----MIIBSTCB8AIBADCBjzELMAkGA1UEBhMCR0IxDzANBgNVBAgMBkxvbmRvbjEPMA0GA1UEBwwGTG9uZG9uMRUwEwYDVQQKDAxDaGVja291dC5jb20xCzAJBgNVBA8MAklUMRUwEwYDVQQDDAxjaGVja291dC5jb20xIzAhBgkqhkiG9w0BCQEWFHN1cHBvcnRAY2hlY2tvdXQuY29tMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEwjiZ410yhHCkwa04OfrPb0e5bqt4FncefJwAbFpcqARTWefYZNvLyYkV68PmAKoO7cthfAFVfoVNqXBEGzjg1TAKBggqhkjOPQQDAgNIADBFAiAcgJLboQK3GBQX/K5ghNzbcw4mnVcVk/rUmkIxu0M28gIhALO01kH13CZzMkAhRhnkeCUPaP+IqUqQaDdZL8d5xgFc-----END CERTIFICATE REQUEST-----"3}
- On your desktop, create a new plain text file and name it
cko.csr
. - Paste the entire value returned in the response's
content
field into the newcko.csr
file and save it. For example, yourcko.csr
file's contents should look similar to the following:
1-----BEGIN CERTIFICATE REQUEST-----MIIBSTCB8AIBADCBjzELMAkGA1UEBhMCR0IxDzANBgNVBAgMBkxvbmRvbjEPMA0GA1UEBwwGTG9uZG9uMRUwEwYDVQQKDAxDaGVja291dC5jb20xCzAJBgNVBA8MAklUMRUwEwYDVQQDDAxjaGVja291dC5jb20xIzAhBgkqhkiG9w0BCQEWFHN1cHBvcnRAY2hlY2tvdXQuY29tMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEwjiZ410yhHCkwa04OfrPb0e5bqt4FncefJwAbFpcqARTWefYZNvLyYkV68PmAKoO7cthfAFVfoVNqXBEGzjg1TAKBggqhkjOPQQDAgNIADBFAiAcgJLboQK3GBQX/K5ghNzbcw4mnVcVk/rUmkIxu0M28gIhALO01kH13CZzMkAhRhnkeCUPaP+IqUqQaDdZL8d5xgFc-----END CERTIFICATE REQUEST-----
Information
The CSR has a Time to Live (TTL) period of 24 hours. You must create your Apple Pay Payment Processing Certificate within this timeframe. If you miss the TTL period, you must generate a new CSR.
- Sign in to your Apple Developer account, go to the Merchant IDs list section, and select the Merchant ID you created in step 1.
- In the Apple Pay Payment Processing Certificate section, select Create Certificate.
- Respond No to the question about processing in China and select Continue.
- Upload the
cko.csr
file from the previous step and select Continue. - Select Download to retrieve your payment processing certificate. The certificate file name is
apple_pay.cer
.
- Encode the
apple_pay.cer
in base64 using the following command. The command will create a new file namedbase64_converted.cer
.
1openssl x509 -inform der -in apple_pay.cer -out base64_converted.cer
- To enable Checkout.com to use the payment certificate to decrypt Apple Pay tokens and convert them to Checkout.com card tokens, upload the file to the following endpoint:
post
https://api.checkout.com/applepay/certificates
To get a detailed view of all required and optional fields, see our API reference.
1curl --location --request POST 'https://api.sandbox.checkout.com/applepay/certificates' \2--header 'Authorization: Bearer pk_xxxxxxxxxxxxxxxxxxxxxxxxxx' \3--header 'Content-Type: application/json' \4--data-raw '{5"content": "MIIEfTCCBCOgAwIBAgIID/asezaWNycwCgYIKoZIzj0EAwIwgYAxNDAyBgNVBAMMK0FwcGxlIFdvcmxkd2lkZSBEZXZlbG9wZXIgUmVsYXRpb25zIENBIC0gRzIxJjAkBgNVBAsMHUFwcGxlIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MRMwEQYDVQQKDApBcHBsZSBJbmMuMQswCQYDVQQGEwJVUzAeFw0yMTA2MTExMzQ0MjVaFw0yMzA3MTExMzQ0MjRaMIGuMS0wKwYKCZImiZPyLGQBAQwdbWVyY2hhbnQuY29tLmNoZWNrb3V0LnNhbmRib3gxQzBBBgNVBAMMOkFwcGxlIFBheSBQYXltZW50IFByb2Nlc3Npbmc6bWVyY2hhbnQuY29tLmNoZWNrb3V0LnNhbmRib3gxEzARBgNVBAsMCkUzMlhCUUs0UTUxFjAUBgNVBAoMDUNoZWNrb3V0IEx0ZC4xCzAJBgNVBAYTAkdCMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEsvyUM9D1cssldH+VPptEn4VAw/Q6ovJuHVlyBSRaPGLHFce04lCiT/x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17:32:28.000Z",5"valid_until": "2025-01-01T17:32:28.000Z"6}
Information
You must have a valid TLS certificate on your domain (meaning it begins with https
).
- Sign in to your Apple Developer account, go to the Merchant IDs list section and select the Merchant ID you created in step 1.
- Under the Merchant Domains section, select Add Domain.
- Enter your domain and select Save.
- Select Download and you'll get a
.txt
file. - Upload this file to your server so it's accessible at the following location (replacing
yourdomain.com
with the URL of your domain):https://yourdomain.com/.well-known/apple-developer-merchantid-domain-association
. To do this, create a folder called.well-known
in the root directory of your website and put the.txt
file in that folder. - Once you've uploaded the file, select Verify.
- Open a terminal and create a
.csr
and.key
file using this command:
1openssl req -out uploadMe.csr -new -newkey rsa:2048 -nodes -keyout certificate_sandbox.key
- In the prompt, enter your details, and when asked for a password, leave it blank and select Enter. This will generate two files:
uploadMe.csr
andcertificate_sandbox.key
. - Sign in to your Apple Developer account, go to the Merchant IDs list section and select the Merchant ID you created in step 1.
- Under the Apple Pay Merchant Identity Certificate section, select Create Certificate.
- Upload the
uploadMe.csr
file you just created from your terminal. - Select Continue and then select Download to get your
.cer
file. It will probably be namedmerchant_id.cer
. - Convert this
.cer
file into a.pem
file so you can use it in your code. Enter the following command in your terminal:
1openssl x509 -inform der -in merchant_id.cer -out certificate_sandbox.pem
Validate your Apple Pay certificate and private key files:
1curl -gv \2--data '{3"merchantIdentifier": "merchant.com.mywebsite.sandbox",4"displayName": "merchant id for test environment",5"domainName": "sandbox.mywebsite.com"6}' \7--cert /path/to/certificate_sandbox.pem \8--key /path/to/certificate_sandbox.key \9https://apple-pay-gateway.apple.com/paymentservices/paymentSession
If you followed the above steps correctly, you should now have the following:
- a Merchant ID (for example,
merchant.com.mywebsite.sandbox
) - Checkout.com linked to your Merchant ID
- a domain verified by Apple
- a
.key
and a.pem
certificate file
Information
We recommend that you repeat the above steps so you have a Merchant ID, domain (it can be the same domain) and certificates for your test environment and your production environment. You should use descriptive names for each environment to avoid mismatches.
Information
If you use an ecommerce platform where we support Apple Pay, such as Magento or WooCommerce, the files and certificates you created in the previous configuration steps are enough to complete your integration. Just follow the instructions provided by your particular platform.
Follow Apple Pay's integration documentation to integrate Apple Pay:
- Apple Pay Web — see a demo
- Apple Pay Mobile
You can extract the billing address that the customer set up in their Apple Pay wallet for use in your payment requests.
Set the requiredBillingContactFields: ["postalAddress"]
parameter when you create the ApplePaySession
on the front end.
If done correctly, you should see the billing address displayed in the Apple Pay payment sheet. To specify a different billing address that you have stored on file for the customer, add the billingContact
object. For example:
1requiredBillingContactFields: ["postalAddress"],2billingContact: {3givenName: "Jia Tsang",4addressLines: "123 Anywhere St",5locality: "Anytown",6postalCode: "123456",7administrativeArea: "AL",8country: "US"9}
The billing address is included in the object returned in the onpaymentauthorized()
callback, which is sent to your back end and included in your payment request to Checkout.com.
You can extract the email address and phone number that the customer set up in their Apple Pay wallet for use in your payment requests.
Set the requiredShippingContactFields: ["phone", "email"]
parameter when you create the ApplePaySession
on the front end.
If done correctly, you should see the email address and phone number displayed in the Apple Pay payment sheet. To specify a different email address or phone number that you have stored on file for the customer, add the shippingContact
object. For example:
1requiredShippingContactFields: ["name", "phone", "email"],2shippingContact: {3phoneNumber: "555-0100",4emailAddress: "[email protected]"5}
The email address and phone number are included in the object returned in the onpaymentauthorized()
callback, which is sent to your back end and included in your payment request to Checkout.com.
Once you've completed the integration steps, you will be able to display the Apple Pay button and validate an Apple Pay Session (required for the web version).
For an in-depth view, see the following payment flow walkthrough:
Here's a diagram of the full payment flow:
Once you've set up and configured Apple Pay, you're ready to accept Apple Pay payments through our payment gateway.
After your customer validates their transaction with biometrics, Apple will generate a payment token.
The first step in processing an Apple Pay transaction is to convert this Apple Pay token into a Checkout.com card token. Alternatively, if you want to decrypt the Apple Pay token yourself and process a payment, skip to step 2.
For the full API specification, see the API reference.
post
https://api.checkout.com/tokens
1{2"type": "applepay",3"token_data": {4"version": "EC_v1",5"data": "t7GeajLB9skXB6QSWfEpPA4WPhDqB7ekdd+F7588arLzvebKp3P0TekUslSQ8nkuacUgLdks2IKyCm7U3O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CBEgwRgIhAKunK47QEr/ZjxPlVl+etzVzbKA41xPLWtO01oUOlulmAiEAiaFH9F9LK6uqTFAUW/WIDkHWiFuSm5a3NVox7DlyIf0AAAAAAAA=",7"header": {8"ephemeralPublicKey": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEX1ievoT8DRB8T5zGkhHZHeDr0oBmYEgsDSxyT0MD0IZ2Mpfjz2LdWq6LUwSH9EmxdPEzMunsZKWMyOr3K/zlsw==",9"publicKeyHash": "tqYV+tmG9aMh+l/K6cicUnPqkb1gUiLjSTM9gEz6Nl0=",10"transactionId": "3cee89679130a4b2617c76118a1c62fd400cd45b49dc0916d5b951b560cd17b4"11}12}13}
1{2"type": "applepay",3"token": "tok_ymu4qlccztkedmd6b7c3hcf6ae",4"expires_on": "2019-10-21T10:48:35Z",5"expiry_month": 8,6"expiry_year": 2023,7"scheme": "Visa",8"last4": "6222",9"bin": "481891",10"card_type": "DEBIT",11"card_category": "CONSUMER",12"issuer": "Test Bank",13"issuer_country": "GB",14"product_id": "F",15"product_type": "Visa Classic"16}
Using the token (tok_...)
you got in the response above, make a standard payment request.
Although the field is optional, including the customer's billing address in your payment requests can help to:
- reduce interchange fees
- enable the issuer to perform Address Verification Service (AVS) checks
- improve acceptance rates
Similarly, including the customer's email address and phone number in your payment requests can help to enrich data for reporting and fraud screening purposes.
You can use your front end to extract the customer's billing address, email address, and phone number from their Apple Pay Wallet, and include them in your payment request.
For the full API specification, see the API reference.
post
https://api.checkout.com/payments
1{2"source": {3"type": "token",4"token": "tok_ymu4qlccztkedmd6b7c3hcf6ae"5},6"billing_address":{7"address_line1": "123 Anywhere St.",8"city": "Anytown",9"state": "AL",10"zip": "123456",11"country": "US"12},13"phone": {14"country_code": "1",15"number": "555-0100"16},17"customer": {18"email": "[email protected]"19},20"amount": 6500,21"currency": "USD"22}
If you get a 201 Success
response and the approved
field is true
, your payment was successful. If the transaction failed, it's likely that the payment request was made with an invalid/expired card, or a valid card with an insufficient available balance.
To test Apple Pay payments, you'll need the following:
- an Apple Pay compatible device
- a sandbox Apple Pay wallet, which you can add a test card to (see Test Cards for Apps and the Web on Apple Pay's sandbox testing page)
For more information about testing, see our testing resources.
Note
When testing in a sandbox environment, you cannot use a real Apple Pay wallet with real cards.
If something goes wrong, make sure you're using the correct keys, merchant ID and certificates. This is the most common issue we encounter. We recommend using descriptive names for your merchant IDs to clearly separate between your test and production environments.
If you don't have a card in your Apple Pay wallet, or you have a card that is not accepted based on the settings configured for Apple Pay (supported networks), your Apple Pay button might not be displayed if you display it conditionally (session.canMakePaymentsWithActiveCard(...))
.
When validating the Apple Pay Session, make sure that:
- you're using the correct merchant ID, and the correct
.key
and.pem
certificates associated with it - if you configured your merchant ID in sandbox, you're using the sandbox environment