Hosted Checkout Overview
End-to-end hosted checkout — payment links, card, Mada, and Apple Pay.
Hosted Checkout Overview
The Hosted Checkout integration is the recommended way to accept online payments with DigetPay. Your application creates a payment session, receives a redirectUrl, redirects the customer to the DigetPay hosted payment page, and verifies the payment result after checkout.
With Hosted Checkout, sensitive payment data never passes through your application, helping reduce PCI DSS scope while providing a secure and optimized payment experience.
New to DigetPay? Complete the Quick Start guide first, then return here for the complete Hosted Checkout workflow.
Recommended integration: Hosted Checkout provides the fastest implementation with the lowest PCI compliance requirements.
Why choose Hosted Checkout?
Card data is securely collected and processed by DigetPay. Your servers never receive PAN, CVV, or Apple Pay tokens.
Create a payment session, redirect the customer, and verify the payment status using only a few API calls.
Support cards, Mada, Apple Pay, and additional payment methods without implementing each payment flow yourself.
Includes 3D Secure authentication, payment status tracking, refunds, and webhook notifications.
Payment Flow
End-to-end payment lifecycle
sequenceDiagram
autonumber
participant Merchant as Your Server
participant API as DigetPay API
participant Customer
participant Checkout as Hosted Checkout
participant Gateway
Merchant->>API: Create Payment Link
API-->>Merchant: redirectUrl
Merchant->>Customer: Redirect customer
Customer->>Checkout: Complete payment
Checkout->>Gateway: Process transaction
Gateway-->>Checkout: APPROVED / DECLINED
Checkout-->>Customer: successUrl / failureUrl
API->>Merchant: Webhook notification (recommended)
Merchant->>API: Query Transaction Status
opt Refund
Merchant->>API: Process Refund
end
Critical: Your server must always confirm payment with the Transaction Status API. A redirect to
successUrldoes not guarantee that the payment succeeded, and a webhook is a notification that something changed, not proof of payment.
The same flow and the same API base URL (https://api.digetpay.com/v1) apply in Test Mode and Live Mode. Your Test API Key runs demo payments, and your Live API Key processes real payments.
Integration Steps
1. Create a payment session
Your server creates a Hosted Checkout session and receives a redirectUrl for the customer.
See Create Payment Link for the API details.
2. Redirect the customer
Redirect the customer to the redirectUrl returned by DigetPay. Use it exactly as returned; do not hard-code or build the checkout URL yourself.
The checkout page is fully hosted by DigetPay. You do not need to build an iframe or embed card fields in your application.
3. Customer completes payment
The customer selects an available payment method and completes the payment on the DigetPay hosted checkout page.
Additional authentication, such as 3D Secure, is handled as part of the checkout experience when required.
4. Verify the payment
After checkout completes, verify the payment with the Transaction Status API before fulfilling the order. A webhook notification can tell you when to check, but it does not replace the status check.
Never rely only on the browser redirect,
successUrl, or a webhook notification to determine payment success.
5. Process refunds (Optional)
Use the Refund API whenever a full or partial refund is required.
What the Customer Sees
The customer pays on the hosted page returned by redirectUrl. Your server never receives the customer's card data.
flowchart LR A[Your store] -->|Redirect| B[DigetPay Checkout] B --> C[Select payment method] C --> D[Pay] D --> E[successUrl / failureUrl]
The hosted checkout page is rendered by DigetPay after the customer is redirected to redirectUrl.
Checkout Page
The customer can:
- Review the payment amount and order information.
- Select an available payment method.
- Complete additional authentication such as 3D Secure when required.
- Complete the payment and return to the merchant application.
Send
customerPhonewhen creating the payment link if you want Apple Pay to be available on checkout.
PCI benefit: Card entry, 3-D Secure, and Apple Pay are handled on DigetPay infrastructure rather than by your application.
Payment Methods Available
| Method | Supported Networks | Notes |
|---|---|---|
| Card | Visa, Mastercard, Mada, Amex | 3-D Secure when required by issuer |
| Saved Card | Prior cards for returning customers | Same email at link creation |
| Apple Pay | Safari / iOS | Requires customerPhone at link creation |
See Payment Methods for more details.
Your Integration Responsibilities
| You Build | DigetPay Builds |
|---|---|
| Create payment link | Checkout UI |
Redirect to redirectUrl | Card / Mada form |
| Handle return URLs | 3-D Secure |
| Confirm payment with the Status API (webhook as a trigger) | Apple Pay button |
See Hosted Checkout Code for implementation examples.
Success and Failure URLs
successUrl and failureUrl are your own pages. Set them to HTTPS URLs on your application, in both Test Mode and Live Mode.
| Outcome | Example |
|---|---|
| Success | https://your-domain.com/payment/success |
| Failure | https://your-domain.com/payment/failure |
Do not point these URLs at DigetPay-hosted pages. They are for navigation only. Landing on
successUrlis not proof of payment, so always confirm the final status on your server with the Status API.
Best Practices
- Always verify payments with the Status API. Use webhooks as notifications that tell you when to check.
- Store the gateway transaction ID for future operations such as refunds.
- Include
customerPhonewhen creating payment links to support Apple Pay and other payment methods. - Never fulfill orders directly from the
successUrl. - Never handle or store card data in your application when using Hosted Checkout.
- Use the
redirectUrlreturned by the API. Do not build checkout URLs yourself. - Test your integration in Test Mode with your Test API Key and Test Cards before switching to your Live API Key.
- Configure and verify your Live webhook separately from your Test webhook before processing live transactions.
API Reference
Next Steps
Related Guides
To go live, complete the Go-Live Checklist, switch to your Live API Key and Live webhook configuration, and verify your webhook endpoint before processing live transactions.
Updated about 2 months ago


