Apple Pay Integration

Ezypay now supports Visa and Mastercard payments via Apple Pay on the Ezypay checkout page. This provides a faster, more secure way for customers to pay using Apple Pay on supported Apple devices (iPhone, iPad, Apple Watch) — helping increase conversion rates.

👉 To learn more about Apple Pay, visit the Apple Pay website.

📘

Pre-requisite

Merchants must contact Ezypay to enable Apple Pay on their account.

How Apple Pay Works

Apple Pay appears as a payment option on the Ezypay-hosted checkout page or Payment capture page. Below is how the process would looks like.

Integration Notes for Developers

Domain Registration

This is required only if you are using Payment capture page .

Apple mandates domain verification for any app or integration that uses Apple Pay with recurring payments. All merchants who wish to enable Apple Pay must complete this domain registration process before Apple Pay can be activated.

When requesting Apple Pay enablement, please provide the following details to Ezypay:

  1. All domains involved in hosting the payment capture flow

    • This includes the domain that hosts the payment capture page.
    • If the payment capture page is embedded on another website via a HTML iframe, both the widget domain and the website domain must be registered.
    • Important: If the payment flow involves multiple domains at any point, every domain involved must be registered with Apple. Missing even one domain will cause Apple Pay to fail.
  2. Provide the Full Qualified Domain Name (FQDN).

  3. Hosting the Apple domain association file

    • Once Ezypay completes the domain registration with Apple, an association file in .txt format will be provided.
    • You must host this file at the following path on each registered domain: <root>/.well-known/apple-developer-merchantid-domain-association
    • Apple validates this file every time the Apple Pay payment sheet is invoked, so it must remain accessible at all times.

Example

TypeURL ExampleAssociation File Path
HTML iframehttps://integrators.domain.comhttps://integrators.domain.com/.well-known/apple-developer-merchantid-domain-association
Websitehttps://merchants.domain.comhttps://merchants.domain.com/.well-known/apple-developer-merchantid-domain-association
🚧

If your payment capture flow spans across multiple domains, register all the domains.

❗️

Failing to do the above will result in the payment sheet opening briefly and then closing automatically. An erorr message will then return in the Payment capture page.


Provide a management URL

This is required only if you are using Payment capture page .

Apple Pay requires integrators to provide a Management URL for recurring payments. This URL must direct users to a web page where they can view, update, or delete the payment method associated with their recurring subscription.

You can supply the management URL in one of the following ways:

  1. During merchant onboarding with Ezypay

    • Provide a fixed management URL as part of the merchant onboarding process.
  2. Dynamically via the payment capture page

    • If you require dynamic control over the management URL, you may pass it as a query string parameter (paymentMethodManagement) when loading the payment capture page:

Important Notes

  • The full URL must be provided, including the scheme (E.g., https://integrators.domain.com/manage/customers).
  • The management URL must be accessible to end users and allow them to manage their recurring Apple Pay payment method. You may request user to login after redirecting to the page.

The URL will appear in the customers' Apple Pay app as screenshot below.


Payload Structure

Integrators need to ensure the correct information is displayed when the payment method details is displayed on their application. When a customer pays using Apple Pay, Ezypay returns a tokenized card payload. Example below:

{  
  "data": {  
      "paymentMethodToken": "785095a8-a40c-4d41-b913-97b1bdcb5f0a",  
      "customerId": "88379c2b-3be2-4e54-b922-b5d3a4815afe",  
      "type": "CARD",  
      "bank": null,  
      "payTo": null,  
      "card": {  
        "first6": "999999",  
        "last4": "0121",  
        "accountHolderName": "Apple Pay + Given Family Name",  
        "type": "VISA",  
        "expiryMonth": "00",  
        "expiryYear": "00",  
        "origin": "applepay",  
        "tokenDetails": {  
          "tokenType": "applepay",  
          "friendlyDisplay": "VISA 0121",  
          "originalLast4": "0121",  
          "tokenFirst6": "481852",  
          "tokenLast4": "3021",  
          "tokenExpiry": "01-30"  
        },  
        "tokenized": true  
      }  
}
{  
  "data": {  
      "paymentMethodToken": "b3945926-ba8b-42fb-b00b-3e50b70d9cee",  
      "customerId": "89d36440-c7c9-4e0d-aab0-c9e38d249390",  
      "type": "CARD",  
      "bank": null,  
      "payTo": null,  
      "card": {  
        "first6": "411111",  
        "last4": "1111",  
        "accountHolderName": "test",  
        "type": "VISA",  
        "expiryMonth": "3",  
        "expiryYear": "27",  
        "origin": null,  
        "tokenDetails": null,  
        "tokenized": false  
      },  
      "invalidReason": null,  
      "lastUsedOn": null,  
      "replacedPaymentMethodData": null,  
      "wallet": null,  
      "valid": true,  
      "primary": true  
  }  
}

Key Fields

Object informationDescription
data.card.paymentMethodTokenEzypay's unique token for the Apple Pay payment method.
data.card.accountHolderNameEzypay provides a fixed template to be used to identify the customer linked to the payment type.
data.card.last4Last four digits of the real card linked to Apple Pay
data.card.typeCard brand (e.g. VISA, Mastercard)
data.card.originIndicates if the payment was made via Apple Pay

Display format

When showing Apple Pay transactions in your UI, use the following format:

[Apple Pay] | Visa **** 0121


Refer to the Apple Pay Marketing Guidelines for official logos and usage rules.

📘

Please refer to the sandbox guide on testing with Apple Pay