Embedded Integration Overview
Server-side card payments, capture, void, and recurring on your checkout UI.
Embedded Integration Overview
Embedded Integration gives you complete control over your checkout experience by allowing your secure backend to communicate directly with DigetPay APIs. This integration supports direct sales, authorization and capture, void transactions, recurring payments, and server-to-server payment management.
PCI DSS Required
Your application processes cardholder data directly. You are responsible for meeting the PCI DSS requirements applicable to your integration. If you do not require a fully customized checkout experience, we recommend using Hosted Checkout.
Backend Only
Never submit card information directly from browser JavaScript. Card details, request hash generation, and all DigetPay API calls must be handled by your secure backend.
Need code samples?
PHP, Node.js, Python, and Java examples are available later in this guide.
When to Use Embedded Integration
| Recommended For | Description |
|---|---|
| Custom Checkout | Build your own payment page and customer experience |
| Mobile Applications | Native Android and iOS payment flows |
| Subscription Platforms | Token-based recurring payments |
| Marketplace Solutions | Complete payment lifecycle control |
| Advanced Merchants | Authorization, capture, void, and recurring payments |
Payment Flow
sequenceDiagram
autonumber
participant Customer
participant Merchant as Your Backend
participant DigetPay
participant Gateway
Customer->>Merchant: Enter card details
Merchant->>Merchant: Generate Request Hash
Merchant->>DigetPay: POST /payment/s2s/sale
DigetPay->>Gateway: Process payment
Gateway-->>DigetPay: APPROVED / DECLINED / 3DS
DigetPay-->>Merchant: Payment response
opt 3DS Required
Merchant->>Customer: Render htmlContent
end
opt Webhook
DigetPay-->>Merchant: Payment notification
end
Merchant->>DigetPay: Check transaction status
opt Authorized transaction
Merchant->>DigetPay: Capture or Void
end
opt Saved card
Merchant->>DigetPay: Recurring payment
end
Authentication
All Embedded Integration endpoints require the following request headers:
x-api-key: YOUR_TEST_OR_LIVE_API_KEY
Content-Type: application/jsonUse your Test API Key for demo payments and your Live API Key for real payments. The API base URL is the same for both.
The Direct Sale API additionally requires a request hash generated by your backend before sending the request.
Hash Formula
MD5(
UPPERCASE(
reverse(customerEmail)
+
apiKey
+
reverse(first6 + last4)
)
)Here apiKey is the same Test or Live API Key you send in the x-api-key header for that request.
Generate the request hash on your backend immediately before calling the Direct Sale API. Never expose your API key or hash generation logic to the client.
Integration Steps
| Step | Description |
|---|---|
| 1 | Generate the request hash |
| 2 | Submit a Direct Sale request |
| 3 | Handle 3-D Secure authentication if required |
| 4 | Receive the payment webhook notification |
| 5 | Verify the transaction status |
| 6 | Capture or void the transaction if required |
| 7 | Process recurring payments if required |
Available APIs
Create a card payment.
Retrieve the latest payment status.
Capture an authorized transaction.
Cancel an authorization before settlement.
Charge a previously saved payment token.
Learn how to generate the MD5 request hash.
API Endpoints
| API | Method | Endpoint |
|---|---|---|
| Direct Sale | POST | /payment/s2s/sale |
| Transaction Status | POST | /payment/s2s/status/{transactionId} |
| Capture | POST | /payment/s2s/capture |
| Void | POST | /payment/s2s/void |
| Recurring | POST | /payment/s2s/recurring |
API Base URL and Modes
All Embedded endpoints use one base URL for both Test Mode and Live Mode. The API key you send decides the mode.
| Item | Test Mode | Live Mode |
|---|---|---|
| Base URL | https://api.digetpay.com/v1 | https://api.digetpay.com/v1 |
| API Key | Test API Key | Live API Key |
| Cards | Test Cards only | Real customer cards |
| Webhooks | Test Webhook Configuration | Live Webhook Configuration |
To go live, switch the API key and webhook configuration. The base URL and the endpoint paths do not change.
Testing in Test Mode
Use Test Mode to validate the full lifecycle before you accept real cards:
- Get your Test API Key from the Merchant Dashboard (pay.digetpay.com).
- Send Direct Sale requests to
https://api.digetpay.com/v1using Test Cards only. Never use real card data in Test Mode. - Complete 3-D Secure when
htmlContentis returned. - Check the result with the Transaction Status API.
- Test capture and void on authorized transactions, and recurring payments if you use them.
- Test your Test webhook endpoint, including duplicate deliveries.
- When everything passes, complete the Go-Live Checklist and switch to your Live API Key and Live webhook configuration.
See the Testing Guide for Test Card values and scenarios.
Code Examples
Best Practices
Recommended implementation
- Generate the request hash on your backend.
- Never expose card data or API keys to the browser.
- Use webhooks as notifications that a payment changed. A webhook alone is not proof of payment.
- Verify payment status with the Transaction Status API before fulfilling any order.
- Store transaction IDs for future capture, void, refund, or recurring operations.
- Keep Test and Live API keys and webhook URLs separate.
3-D Secure
Some card issuers require 3-D Secure authentication. When
htmlContentis returned, render it exactly as received and wait for the authentication flow to complete before checking the transaction status.
Related Guides
Updated about 2 months ago

