QPay
Start accepting payments using QPay, a favorite payment method in Qatar.
To start accepting QPay payments, please contact your customer success manager.
Process a QPay payment
QPay payments follow a two-step process:
Step 1: Request a QPay payment
The request
Use the following details to set up your payment request.
Endpoints
Live
Sandbox
Header parameters
Header | Value |
---|---|
|
|
|
|
Body parameters
The table below describes the minimum recommended fields. You can find the full list, as well as complete request and response examples, in our API reference.
Field name | Description |
---|---|
| The payment amount. |
| The currency in which the payment is being made (three-letter ISO 4217 code). Set this to |
| Details about the payment source. |
| The type of payment source. Set this to |
| A description of the transaction.\ Maximum of 255 characters (after UTF-8 URL encoding). |
| The customer's preferred language (2-letter ISO code). Set this to either |
| The quantity (minimum value of |
| The national ID of the customer.\ Maximum of 32 characters. |
Request example
{
"amount": 100,
"currency": "QAR",
"source": {
"type": "qpay",
"description": "QPay Demo Payment",
"language": "en",
"quantity": "1",
"national_id": "070AYY010BU234M"
}
}
The response
If you receive a 202 Success
response with a status
field set to Pending
, your request was successful.
Response example
{
"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"
}
}
}
Step 2: 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 QPay payment
You can use the payment_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.
The request
Use the details below to set up your request.
Endpoint
Live
Sandbox
Header and path parameters
Header | Value |
---|---|
|
|
|
|
Path | Value |
---|---|
| The payment ID, found in the payment response, or the session ID from the success/failure URL. |
The response
Response example
{
"id": "pay_7eil5osdlcdehe62et5aihec4q",
"requested_on": "2019-06-20T10:03:42Z",
"source": {
"type": "qpay",
"description": "QPay Demo Payment"
},
"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 QPay payment
QPay supports both partial and full refunds. You can refund a payment through the Hub or by using the refund API.
Cancel a QPay 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.
Testing QPay
To start testing, you'll need to:
- create a test account, and
- 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 following details:
  -   Card number: 4215 3755 0088 3243
  -   Card expiry date: 06 | 2020 -
Click "Continue".
-
Enter a debit card pin – you can dial in any four- or six-digit number – and then click "Pay".
-
You should then be redirected to your predefined success URL.
Can we help?
Thanks for using Checkout.com. If you need any help or just have a question, please get in touch with our support team at [email protected].
Updated 5 months ago