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 Only

These examples apply only to merchants using Embedded Integration.

Do not use these examples with Hosted Checkout integrations.

❗️

Security Notice

Never 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 begin

Make sure you have completed:

  • Apple Pay Embedded setup
  • Merchant ID configuration
  • Domain verification
  • Embedded Integration
  • Your Test API Key (x-api-key)
  • HTTPS enabled

Hosted vs Embedded

Hosted CheckoutEmbedded Integration
Checkout UIDigetPayYour website
Apple Pay ButtonDigetPay renders itYou render it
Merchant ValidationDigetPayYour server
Apple Pay TokenDigetPayYour server
Server IntegrationMinimalRequired
Domain VerificationDigetPayYour domain


API base URL

ItemValue
API base URLhttps://api.digetpay.com/v1 (the same for Test and Live)
API keyTest API Key for testing, Live API Key for live payments (x-api-key)

Next steps




Did this page help you?