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.
| Item | Value |
|---|---|
| API base URL | https://api.digetpay.com/v1 |
| Merchant Dashboard | https://pay.digetpay.com/ |
| Auth header | x-api-key: YOUR_TEST_API_KEY |
| Checkout | Redirect to the redirectUrl returned by the API |
| Webhooks | Test 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
- Create Payment Link — amount
0.20SAR, validcustomerPhone(e.g.501223324). - Open
redirectUrland complete payment on hosted checkout with a Test Card. - Obtain the gateway transaction ID (UUID) from the Status API response.
- Query Transaction Status — verify
transactionStatus: SUCCESS. - Check your Test webhook — confirm the notification reached your server and that your handler confirms the payment with the Status API.
- Process Refund — verify
result: acceptedandrefundStatusupdates.
Pass criteria: Full flow succeeds when create → pay → status
SUCCESS→ webhook received → refundacceptedall 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.
| ✓ | Scenario | Expected Result | Related Guide |
|---|---|---|---|
| ☐ | Create Payment Link | Returns 201 with id and redirectUrl. | Quick Start |
| ☐ | Complete Hosted Checkout | Payment completes successfully on the hosted checkout page. | Quick Start |
| ☐ | Verify Transaction Status | Status API returns SUCCESS with the correct transaction details. | Transaction Status |
| ☐ | Test Webhook Delivery | Your Test webhook endpoint receives the notification and returns 200. | Receiving Webhooks |
| ☐ | Duplicate Webhook Handling | A repeated webhook does not create a duplicate order or refund. | Receiving Webhooks |
| ☐ | Process Full Refund | Refund request is accepted successfully. | Process Refund |
| ☐ | Process Partial Refund | Partial 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 Key | API returns 401 Unauthorized. | API Reference |
| ☐ | Missing Required Fields | API returns 400 Bad Request. | API Reference |
Blocker: If requests with your Test API Key return
401, or theredirectUrldoes not load a hosted checkout page, stop testing and contact DigetPay with yourmerchantOrderIdand the error response.
Common mistakes
| Mistake | Fix |
|---|---|
Using /payment/checkout/session | Use /payment/checkout/intiate |
Missing customerPhone | Required on create — use 501223324 format |
| Using session ID for status/refund | Use gateway transaction ID |
| Using numeric payment ID for refund | Use gateway UUID format |
Calling POST /payment/s2s/status for a Hosted Checkout payment | Use GET /payment/checkout/status for Hosted Checkout |
| Using the Live API Key while testing | Use your Test API Key in Test Mode |
| Treating a webhook as proof of payment | Confirm with the Status API before fulfilling |
Important: The checkout session ID from Create Payment Link is not valid for status or refund APIs.
Troubleshooting
| Symptom | Likely cause | Action |
|---|---|---|
401 — merchant not found | API key not synced to merchant | Contact DigetPay support |
401 — invalid API key | Wrong or replaced key | Check you are sending your current Test API Key in x-api-key |
400 — customerPhone | Missing or invalid phone | Send customerPhone (e.g. 501223324) |
| Webhook not received | Test webhook not registered | Register your URL in the Test Webhook Configuration |
| Apple Pay — public key mismatch | Processing cert not configured | Contact DigetPay support |
| Refund / status fails | Wrong ID type | Use 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
Updated about 2 months ago

