Testing guide

Validate your integration on the Testing environment.

Use Test Mode with your Test API Key to validate your integration before switching to Live Mode. This guide covers the recommended test flow, checklist, and common mistakes.

📘

Start here: Quick Start if you have not created a payment yet.

🚧

Test Mode only: Test Mode processes demo payments. Do not use your Live API Key, real cards or real customer PII during testing.


Test Mode settings

DigetPay uses one API base URL and one Merchant Dashboard for both Test and Live modes. Your API key decides the mode.

ItemValue
API base URLhttps://api.digetpay.com/v1
Merchant Dashboardhttps://pay.digetpay.com/
Auth headerx-api-key: YOUR_TEST_API_KEY
CheckoutRedirect to the redirectUrl returned by the API
WebhooksTest Webhook Configuration, registered separately from Live
{
  "mode": "test",
  "apiBaseUrl": "https://api.digetpay.com/v1",
  "headers": {
    "x-api-key": "YOUR_TEST_API_KEY"
  }
}

Test Cards

Use the DigetPay Test Cards with your Test API Key to simulate approved, declined, and 3D Secure card payment scenarios in Test Mode.

Note: Apple Pay testing follows a separate validation process and does not use the Test Card numbers listed on the Test Cards page. See the Apple Pay Testing guide for details.


Recommended test flow

  1. Create Payment Link — amount 0.20 SAR, valid customerPhone (e.g. 501223324).
  2. Open redirectUrl and complete payment on hosted checkout with a Test Card.
  3. Obtain the gateway transaction ID (UUID) from the Status API response.
  4. Query Transaction Status — verify transactionStatus: SUCCESS.
  5. Check your Test webhook — confirm the notification reached your server and that your handler confirms the payment with the Status API.
  6. Process Refund — verify result: accepted and refundStatus updates.

Pass criteria: Full flow succeeds when create → pay → status SUCCESS → webhook received → refund accepted all work with the JSON payloads documented in Quick Start.

Sample test payloads

Create payment link:

{
  "merchantOrderId": "TEST-20260619-001",
  "amount": 0.20,
  "currency": "SAR",
  "customerPhone": "501223324",
  "successUrl": "https://your-domain.com/payment/success",
  "failureUrl": "https://your-domain.com/payment/failure"
}

Status check:

{
  "query": {
    "id": "2232e99b-0257-47d5-bbfd-022c8951767f"
  }
}

Refund:

{
  "transactionId": "2232e99b-0257-47d5-bbfd-022c8951767f",
  "amount": 0.20
}

Validation scenarios

Complete the following validation scenarios before switching to Live Mode.

✓ScenarioExpected ResultRelated Guide
☐Create Payment LinkReturns 201 with id and redirectUrl.Quick Start
☐Complete Hosted CheckoutPayment completes successfully on the hosted checkout page.Quick Start
☐Verify Transaction StatusStatus API returns SUCCESS with the correct transaction details.Transaction Status
☐Test Webhook DeliveryYour Test webhook endpoint receives the notification and returns 200.Receiving Webhooks
☐Duplicate Webhook HandlingA repeated webhook does not create a duplicate order or refund.Receiving Webhooks
☐Process Full RefundRefund request is accepted successfully.Process Refund
☐Process Partial RefundPartial refund is accepted with the requested amount.Process Refund
☐Validate Apple Pay (if enabled)Apple Pay payment completes successfully in Test Mode.Apple Pay Testing
☐Invalid API KeyAPI returns 401 Unauthorized.API Reference
☐Missing Required FieldsAPI returns 400 Bad Request.API Reference
❗️

Blocker: If requests with your Test API Key return 401, or the redirectUrl does not load a hosted checkout page, stop testing and contact DigetPay with your merchantOrderId and the error response.


Common mistakes

MistakeFix
Using /payment/checkout/sessionUse /payment/checkout/intiate
Missing customerPhoneRequired on create — use 501223324 format
Using session ID for status/refundUse gateway transaction ID
Using numeric payment ID for refundUse gateway UUID format
Calling POST /payment/s2s/status for a Hosted Checkout paymentUse GET /payment/checkout/status for Hosted Checkout
Using the Live API Key while testingUse your Test API Key in Test Mode
Treating a webhook as proof of paymentConfirm with the Status API before fulfilling
🚧

Important: The checkout session ID from Create Payment Link is not valid for status or refund APIs.


Troubleshooting

SymptomLikely causeAction
401 — merchant not foundAPI key not synced to merchantContact DigetPay support
401 — invalid API keyWrong or replaced keyCheck you are sending your current Test API Key in x-api-key
400 — customerPhoneMissing or invalid phoneSend customerPhone (e.g. 501223324)
Webhook not receivedTest webhook not registeredRegister your URL in the Test Webhook Configuration
Apple Pay — public key mismatchProcessing cert not configuredContact DigetPay support
Refund / status failsWrong ID typeUse gateway transaction UUID

When reporting issues to support, include your merchantOrderId, HTTP status code, and the JSON error response body (redact API keys).


Ready to go live?

When every scenario above passes, complete the Go-Live Checklist and switch to your Live API Key and Live webhook configuration. The API base URL does not change.


Tools


Did this page help you?