Skip to main content

Testing

This page includes test card numbers and magic amounts to make sure your integration works as planned. Use them to trigger different flows and ensure they are handled accordingly.

Test Cards

For expiration date you can use any future date. For the security code (CVC), use any random 3 digits.

Mastercard

CardSupports 3DS
5123 4500 0000 0008✔️
2223 0000 0000 0007 (Insufficient Funds)✔️

Visa

CardSupports 3DS
4242 4242 4242 4242✔️

NAPS

CardSupports 3DSOTPCVVExpiry
4215 3755 0088 3243✔️123494412/30

Apple Pay & Google Pay

To test Apple Pay and Google Pay in the sandbox environment, use the magic amounts below to simulate specific outcomes. Pass them as the amount.value in your Create Payment request — no real payment processing occurs. The request and response structure is identical to production, so your integration will transition seamlessly when you switch to live keys.

Successful Transactions

The following amounts will simulate a successful Apple Pay or Google Pay transaction:

Amount (QAR)
11.00
17.77
20.00
100.01
123.45

Failed Transactions

The following amounts will simulate a "failed" Apple Pay or Google Pay transaction with a specific failure reason:

Amount (QAR)Failure ReasonFailure Message
12.34insufficient_fundsThere is an insufficient balance in your bank account. Please use a different card or another payment method.
13.13refused_by_issuerThe customer's card issuing bank has declined the transaction. Please use a different card or another payment method.
14.00generic_declineThe card has been declined for an unknown reason. Please check your card details and try again.
15.00withdrawal_count_limit_exceededThe card has exceeded the withdrawal limit. Please use a different card or another payment method.
16.00possible_fraudThe card issuer indicated a security issue with this card and is suspected of fraud or stolen. If you believe this to be an error, please contact your bank.

Example

Request

POST /payments HTTP/1.1
Content-Type: application/json

{
"method": "applepay",
"amount": {
"value": "11.00",
"currency": "QAR"
},
"description": "Order #1337",
"applePayToken": "{\"paymentData\": {\"version\": \"EC_v1\", \"data\": \"vK3Bbr...lg==\"}}",
"redirectUrl": "https://example.com",
"metadata": {
"order": 1755
}
}

Response

{
"id": "pt_6CVWLUT7fxhbWZZS88",
"resource": "payment",
"mode": "test",
"amount": {
"value": "11.00",
"currency": "QAR"
},
"amountNet": {
"value": "10.50",
"currency": "QAR"
},
"amountRemaining": {
"value": "11.00",
"currency": "QAR"
},
"description": "Order #1337",
"method": "applepay",
"redirectUrl": "https://example.com",
"webhookUrl": null,
"status": "succeeded",
"organizationId": "22858676",
"sequenceType": "oneoff",
"metadata": {
"order": 1755
},
"createdAt": "2022-03-25T21:31:15.843917",
"paidAt": "2022-03-25T21:31:15.500235",
"_links": {
"self": {
"href": "https://api.dibsy.one/v2/payments/pt_6CVWLUT7fxhbWZZS88",
"type": "application/hal+json"
},
"dashboard": {
"href": "http://dashboard.dibsy.one/payments/pt_6CVWLUT7fxhbWZZS88",
"type": "text/html"
},
"documentation": {
"href": "http://api.dibsy.dev/#operation/Create%20Payment",
"type": "text/html"
}
}
}