QPay
Last updated: April 29, 2022
Start accepting payments using QPay, a favorite payment method in Qatar.
Information
To start accepting QPay payments, please contact your Account Manager.
Model | GW only |
---|---|
Payment flow | Redirect |
Payment method type | Wallet |
One-step payment | |
Authorization | |
Capture | |
Refund | |
Partial refund | |
Chargeback | |
Recurring payment |
QPay payments follow a two-step process:
For the full API specification, see the API reference.
post
https://api.checkout.com/payments
1{2"amount": 100,3"currency": "QAR",4"source": {5"type": "qpay",6"description": "QPay Demo Payment",7"language": "en",8"quantity": "1",9"national_id": "070AYY010BU234M"10}11}
If you receive a 202 Success
response with a status
field set to Pending
, your request was successful.
1{2"id": "pay_7eil5osdlcdehe62et5aihec4q",3"status": "Pending",4"customer": {5"id": "cus_mydbq4wrfp3excwlexeefsv3be"6},7"_links": {8"self": {9"href": "https://api.sandbox.checkout.com/payments/pay_7eil5osdlcdehe62et5aihec4q"10},11"redirect": {12"href": "https://sbapi.ckotech.co/qpay-external/redirect-to-qpay?pun=52h7saoi5edthll6ceec"13}14}15}
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.
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.
Note
The cko-session-id
expires 15 minutes after being created.
Use the details below to set up your request.
For the full API specification, see the API reference.
GET
https://api.checkout.com/payments/{id}
1{2"id": "pay_7eil5osdlcdehe62et5aihec4q",3"requested_on": "2019-06-20T10:03:42Z",4"source": {5"type": "qpay",6"description": "QPay Demo Payment",7"pun": "skqewp72qqxpuckrdf2c"8},9"amount": 100,10"currency": "QAR",11"payment_type": "Regular",12"status": "Captured",13"approved": true,14"risk": {15"flagged": false16},17"customer": {18"id": "cus_mydbq4wrfp3excwlexeefsv3be"19},20"_links": {21"redirect": {22"href": "https://sbapi.ckotech.co/qpay-external/redirect-to-qpay?pun=52h7saoi5edthll6ceec"23},24"self": {25"href": "https://api.sandbox.checkout.com/payments/pay_7eil5osdlcdehe62et5aihec4q"26},27"actions": {28"href": "https://api.sandbox.checkout.com/payments/pay_7eil5osdlcdehe62et5aihec4q/actions"29},30"refund": {31"href": "https://api.sandbox.checkout.com/payments/pay_7eil5osdlcdehe62et5aihec4q/refunds"32}33}34}
QPay supports both partial and full refunds. You can refund a payment through the Hub or by using the refund API.
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.
Note
To start testing, you'll need to:
- create a test account, and
- contact your Account 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) |
|
- Click Pay. You should then be redirected to your predefined success URL.