Apple Pay Code
PHP, Node.js, Python, and Java examples for embedded Apple Pay integration.
With Hosted Checkout, Apple Pay is displayed automatically on the DigetPay payment page.
With Embedded Integration, you build the checkout on your own domain, render the Apple Pay button, validate the merchant session with Apple, receive the Apple Pay payment token, then securely send the payment request from your backend to DigetPay.
Embedded Integration OnlyThese examples apply only to merchants using Embedded Integration.
Do not use these examples with Hosted Checkout integrations.
Security NoticeNever send Apple Pay payment tokens directly from browser JavaScript to DigetPay.
Always send the payment token to your backend first, then call DigetPay APIs securely from your server.
Before you beginMake sure you have completed:
- Apple Pay Embedded setup
- Merchant ID configuration
- Domain verification
- Embedded Integration
- Fin API Key
- HTTPS enabled
Hosted vs Embedded
| Hosted Checkout | Embedded Integration | |
|---|---|---|
| Checkout UI | DigetPay | Your website |
| Apple Pay Button | DigetPay renders it | You render it |
| Merchant Validation | DigetPay | Your server |
| Apple Pay Token | DigetPay | Your server |
| Server Integration | Minimal | Required |
| Domain Verification | DigetPay | Your domain |
Staging vs production
| Environment | API base |
|---|---|
| Fin staging | https://fin-api.digetpay.com/v1 |
| Production | https://api.digetpay.com/v1 |
Next steps
Updated about 1 month ago
