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 ForDescription
Custom CheckoutBuild your own payment page and customer experience
Mobile ApplicationsNative Android and iOS payment flows
Subscription PlatformsToken-based recurring payments
Marketplace SolutionsComplete payment lifecycle control
Advanced MerchantsAuthorization, 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/json

Use 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

StepDescription
1Generate the request hash
2Submit a Direct Sale request
3Handle 3-D Secure authentication if required
4Receive the payment webhook notification
5Verify the transaction status
6Capture or void the transaction if required
7Process recurring payments if required

Available APIs


API Endpoints

APIMethodEndpoint
Direct SalePOST/payment/s2s/sale
Transaction StatusPOST/payment/s2s/status/{transactionId}
CapturePOST/payment/s2s/capture
VoidPOST/payment/s2s/void
RecurringPOST/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.

ItemTest ModeLive Mode
Base URLhttps://api.digetpay.com/v1https://api.digetpay.com/v1
API KeyTest API KeyLive API Key
CardsTest Cards onlyReal customer cards
WebhooksTest Webhook ConfigurationLive 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:

  1. Get your Test API Key from the Merchant Dashboard (pay.digetpay.com).
  2. Send Direct Sale requests to https://api.digetpay.com/v1 using Test Cards only. Never use real card data in Test Mode.
  3. Complete 3-D Secure when htmlContent is returned.
  4. Check the result with the Transaction Status API.
  5. Test capture and void on authorized transactions, and recurring payments if you use them.
  6. Test your Test webhook endpoint, including duplicate deliveries.
  7. 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 htmlContent is returned, render it exactly as received and wait for the authentication flow to complete before checking the transaction status.


Related Guides


Did this page help you?