Apple Pay Embedded

Implement Apple Pay on your own checkout when using Embedded Integration.

With Embedded Integration, you build the checkout experience on your own website. Apple Pay is implemented on your domain using Apple Pay JS, merchant validation, domain verification, and server-side token processing, while DigetPay securely processes the payment.

🚧

This guide applies only to Embedded Integration merchants. If you're using Hosted Checkout, see Apple Pay Hosted.

❗️

Never send Apple Pay payment tokens directly from browser JavaScript to DigetPay. Always send the token to your backend, then call the Embedded Sale API from your server.

📘

Complete implementation examples are available in the Apple Pay Code Examples guide.


Hosted vs Embedded

FeatureHosted CheckoutEmbedded Integration
Checkout UIDigetPay CheckoutYour Website
Apple Pay ButtonAutomatically displayed by DigetPayYou implement it
Merchant ValidationHandled by DigetPayYour server
Domain VerificationDigetPay domainYour domain
Apple Pay CodeNot requiredRequired

High-Level Flow

sequenceDiagram
    participant Browser as Safari Browser
    participant Merchant as Your Server
    participant Apple as Apple Pay
    participant API as DigetPay API

    Browser->>Merchant: Load checkout page
    Merchant->>Browser: ApplePaySession configuration
    Browser->>Apple: Customer authorizes payment
    Apple-->>Browser: Apple Pay payment token
    Browser->>Merchant: POST payment token
    Merchant->>API: POST /payment/s2s/sale
    API-->>Merchant: Payment result
    Merchant->>Browser: Success or Failure

Prerequisites

RequirementDescription
Apple Developer AccountMerchant ID and Merchant Certificate
Domain VerificationVerify your HTTPS domain with Apple
HTTPS WebsiteApple Pay only works over HTTPS
Safari / iOSCustomer must use a supported Apple Pay device
Embedded Integration EnabledEnabled by DigetPay
Valid API KeyMerchant x-api-key
📘

Before going live, DigetPay must register your production domain with Apple. Contact the DigetPay integration team during the Go-Live process.


Implementation Steps

1. Verify Your Domain

Host the Apple verification file on your website.

https://yourdomain.com/.well-known/apple-developer-merchantid-domain-association

After hosting the file, complete domain verification from your Apple Developer account.


2. Display the Apple Pay Button

Create an Apple Pay button using Apple Pay JS and initialize an ApplePaySession on supported Safari devices.


3. Merchant Validation

When Apple requests merchant validation, your backend must communicate with Apple using your Merchant Identity Certificate and return the merchant session to the browser.


4. Process the Payment

After customer authorization:

  1. Receive the Apple Pay payment token.
  2. Send the token to your backend.
  3. Call:
POST /payment/s2s/sale
  1. Receive the payment result from DigetPay.
🚧

The exact Apple Pay token mapping depends on your gateway configuration. Contact DigetPay Integration Team before your first production deployment.


API Environments

EnvironmentBase URL
Fin Staginghttps://fin-api.digetpay.com/v1
Productionhttps://api.digetpay.com/v1

Security Notes

❗️

Never expose:

  • Merchant Certificates
  • Merchant Private Keys
  • Apple Pay Payment Tokens
  • Merchant Validation Requests

All sensitive operations must be performed on your backend.


Related Guides


Next Steps



Did this page help you?