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
| Feature | Hosted Checkout | Embedded Integration |
|---|---|---|
| Checkout UI | DigetPay Checkout | Your Website |
| Apple Pay Button | Automatically displayed by DigetPay | You implement it |
| Merchant Validation | Handled by DigetPay | Your server |
| Domain Verification | DigetPay domain | Your domain |
| Apple Pay Code | Not required | Required |
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
| Requirement | Description |
|---|---|
| Apple Developer Account | Merchant ID and Merchant Certificate |
| Domain Verification | Verify your HTTPS domain with Apple |
| HTTPS Website | Apple Pay only works over HTTPS |
| Safari / iOS | Customer must use a supported Apple Pay device |
| Embedded Integration Enabled | Enabled by DigetPay |
| Valid API Key | Merchant 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:
- Receive the Apple Pay payment token.
- Send the token to your backend.
- Call:
POST /payment/s2s/sale
- 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
| Environment | Base URL |
|---|---|
| Fin Staging | https://fin-api.digetpay.com/v1 |
| Production | https://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
- Embedded Integration Overview
- Request Hash (MD5)
- Apple Pay Domain Verification
- Apple Pay Code Examples
Next Steps
Updated 14 days ago
