QPay
Start accepting payments using QPay, a favorite payment method in Qatar.
To start accepting QPay payments, please contact your Customer Success Manager.
Model | Collecting |
Payment flow | Bank transfer |
Payment method type | Online banking |
One-step payment | |
Authorization | |
Capture | |
Refund | |
Partial refund | |
Chargeback | |
Recurring payment |
Overview
QPay payments follow a two-step process:
Request a payment
For the full API specification, see the API reference.
https://api.checkout.com/payments
Request example
{"amount": 100,"currency": "QAR","source": {"type": "qpay","description": "QPay Demo Payment","language": "en","quantity": "1","national_id": "070AYY010BU234M"}}
Response example
If you receive a 202 Success
response with a status
field set to Pending
, your request was successful.
{"id": "pay_7eil5osdlcdehe62et5aihec4q","status": "Pending","customer": {"id": "cus_mydbq4wrfp3excwlexeefsv3be"},"_links": {"self": {"href": "https://api.sandbox.checkout.com/payments/pay_7eil5osdlcdehe62et5aihec4q"},"redirect": {"href": "https://sbapi.ckotech.co/qpay-external/redirect-to-qpay?pun=52h7saoi5edthll6ceec"}}}
Redirect the customer
Redirect your customer to the redirect
link’s href in the response. This will allow the customer to authorize the payment, before they are transferred to your predefined success or failure URL.
Get details about a payment
You can use the id
found in the payment response, or the cko-session-id
from the success/failure URL (e.g., https://www.checkout.com/order/succeeded?cko-session-id=sid_vii64oquze5u3h2x6hh4rurc4y
) to retrieve details about the payment.
The cko-session-id
expires 15 minutes after being created.
Use the details below to set up your request.
Endpoints
For the full API specification, see the API reference.
https://api.checkout.com/payments/{id}
Response example
{"id": "pay_7eil5osdlcdehe62et5aihec4q","requested_on": "2019-06-20T10:03:42Z","source": {"type": "qpay","description": "QPay Demo Payment","pun": "skqewp72qqxpuckrdf2c"},"amount": 100,"currency": "QAR","payment_type": "Regular","status": "Captured","approved": true,"risk": {"flagged": false},"customer": {"id": "cus_mydbq4wrfp3excwlexeefsv3be"},"_links": {"redirect": {"href": "https://sbapi.ckotech.co/qpay-external/redirect-to-qpay?pun=52h7saoi5edthll6ceec"},"self": {"href": "https://api.sandbox.checkout.com/payments/pay_7eil5osdlcdehe62et5aihec4q"},"actions": {"href": "https://api.sandbox.checkout.com/payments/pay_7eil5osdlcdehe62et5aihec4q/actions"},"refund": {"href": "https://api.sandbox.checkout.com/payments/pay_7eil5osdlcdehe62et5aihec4q/refunds"}}}
Refund a payment
QPay supports both partial and full refunds. You can refund a payment through the Dashboard or by using the refund API.
Cancel a payment
If the customer fails to complete their payment, we will automatically void the payment and send a payment_expired
webhook.
If the customer cancels their payment, we will send a payment_canceled
webhook.
Webhooks
When using QPay, you may receive the following webhooks.
Webhook | Description |
---|---|
| Occurs when a payment request has successfully initiated. |
| Occurs when the customer has approved the payment on the banking page. |
| Occurs when a capture is successful. |
| Occurs when a capture is declined. |
| Occurs when the customer has canceled the payment or the payment has failed. |
| Occurs when the payment has expired. |
| Occurs when a refund request has successfully initiated. |
| Occurs when a refund is successful. |
| Occurs when a refund is declined. |
Testing QPay
To start testing, you'll need to contact your Customer Success Manager or Integrations engineer to activate QPay payments in the sandbox environment.
- Create a QPay transaction as above, following the redirect link in the response to QPay's website.
- Enter the details of one of our test cards:
Card number | Expiry date | PIN |
---|---|---|
|
| (any PIN) |
| (any future date) |
|
- Select Pay. You should then be redirected to your predefined success URL.