NAPS/QPay

Naps/Qpay is a local payment option in Qatar, usually debit cards.

Overview

NAPS provides multiple payment options for processing transactions in Qatar. One of these options is QPay, which can be used for online payments. This payment method can be utilized through our Tap hosted payment page or via a full redirection to the QPay page to complete the payment.

Note: NAPS/QPay currently supports transactions in Qatari Riyal (QAR) only.

📘

In order to enable this payment method on your Tap account, please make sure to contact your account manager or contact us at [email protected]

QPay Integration

To integration QPay in your website or mobile app, you need to redirect the customers to the QPay page in order for them to enter their card details and process the payment.

Here we will guide you through the integration.

Call the Create a Charge API

First, you need to call the create a charge API and pass the currency as QAR and specify the source.id to be src_qa.qpay

curl --request POST \
     --url https://api.tap.company/v2/charges/ \
     --header 'Authorization: Bearer sk_test_XKokBfNWv6FIYuTMg5sLPjhJ' \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "amount": 1,
  "currency": "QAR",
  "customer_initiated": true,
  "threeDSecure": true,
  "save_card": false,
  "description": "Test Description",
  "metadata": {
    "udf1": "Metadata 1"
  },
  "reference": {
    "transaction": "txn_01",
    "order": "ord_01"
  },
  "receipt": {
    "email": true,
    "sms": true
  },
  "customer": {
    "first_name": "test",
    "middle_name": "test",
    "last_name": "test",
    "email": "[email protected]",
    "phone": {
      "country_code": 965,
      "number": 51234567
    }
  },
  "source": {
    "id": "src_qa.qpay"
  },
  "post": {
    "url": "http://your_website.com/post_url"
  },
  "redirect": {
    "url": "http://your_website.com/redirect_url"
  }
}
'

Redirect Customers to QPay Page

In the charge API response, you will receive the status as INITIATED and you will see a transaction.url that you need to open in a browser for the customer to be redirected to the QPay page and add his card details.

Charge Response

{
  "id": "chg_TS07A0320241133g5RO1906000",
  "object": "charge",
  "live_mode": false,
  "customer_initiated": true,
  "api_version": "V2",
  "method": "CREATE",
  "status": "INITIATED",
  "amount": 1,
  "currency": "QAR",
  "threeDSecure": true,
  "card_threeDSecure": false,
  "save_card": false,
  "merchant_id": "599424",
  "product": "GOSELL",
  "description": "Test Description",
  "metadata": {
    "udf1": "Metadata 1"
  },
  "transaction": {
    "timezone": "UTC+03:00",
    "created": "1718796783000",
    "url": "https://sandbox.payments.tap.company/test_gosell/v2/payment/tap_process.aspx?chg=8D9e9fdEo5N4mrraH0U7ZJbK9Bb0fB0OM2WX34QIF%2bg%3d",
    "expiry": {
      "period": 30,
      "type": "MINUTE"
    },
    "asynchronous": false,
    "amount": 1,
    "currency": "QAR"
  },
  "reference": {
    "transaction": "txn_01",
    "order": "ord_01"
  },
  "response": {
    "code": "100",
    "message": "Initiated"
  },
  "receipt": {
    "email": true,
    "sms": true
  },
  "customer": {
    "first_name": "test",
    "last_name": "test",
    "email": "[email protected]",
    "phone": {
      "country_code": "965",
      "number": "51234567"
    }
  },
  "merchant": {
    "country": "KW",
    "currency": "KWD",
    "id": "599424"
  },
  "source": {
    "object": "source",
    "id": "src_qa.qpay",
    "on_file": false
  },
  "redirect": {
    "status": "PENDING",
    "url": "http://your_website.com/redirect_url"
  },
  "post": {
    "status": "PENDING",
    "url": "http://your_website.com/post_url"
  },
  "activities": [
    {
      "id": "activity_TS06A0620241133c4HR1906047",
      "object": "activity",
      "created": 1718796783000,
      "status": "INITIATED",
      "currency": "QAR",
      "amount": 1,
      "remarks": "charge - created",
      "txn_id": "chg_TS07A0320241133g5RO1906000"
    }
  ],
  "auto_reversed": false
}

🚧

Make sure to open the transaction.url as a full redirection to the URL itself and do not add it in an iframe for the payment to work as expected!

Complete a Payment with QPay

After opening the transaction.url in a browser, the customer will add his card details and then submit it. You can either use the test card added in our documentation if the payment is in sandbox mode, or use a real QPay card to complete the payment.

The user will also be prompted to add an OTP to verify that he is the cardholder. In test mode the OTP can be anything, for example 1234.

Final Charge Response

Once the payment with QPay is done, you will receive the status of the charge either through API or a webhook notification, here is how a CAPTURED QPay payment response looks like.

{
  "id": "chg_TS07A0320241133g5RO1906000",
  "object": "charge",
  "live_mode": false,
  "customer_initiated": true,
  "api_version": "V2",
  "method": "GET",
  "status": "CAPTURED",
  "amount": 1,
  "currency": "QAR",
  "threeDSecure": true,
  "card_threeDSecure": false,
  "save_card": false,
  "product": "GOSELL",
  "description": "Test Description",
  "metadata": {
    "udf1": "Metadata 1"
  },
  "transaction": {
    "timezone": "UTC+03:00",
    "created": "1718796783000",
    "expiry": {
      "period": 30,
      "type": "MINUTE"
    },
    "asynchronous": false,
    "amount": 1,
    "currency": "QAR"
  },
  "reference": {
    "track": "tck_TS03A0520241133Oh491906234",
    "payment": "0519241133062344298",
    "transaction": "txn_01",
    "order": "ord_01",
    "gateway": "00"
  },
  "response": {
    "code": "000",
    "message": "Captured"
  },
  "gateway": {
    "response": {
      "code": "0000",
      "message": "Payment Processed Successfully"
    }
  },
  "card": {
    "object": "card",
    "first_six": "531801",
    "first_eight": "",
    "scheme": "NAPS",
    "brand": "MASTERCARD",
    "type": "DEBIT",
    "last_four": "2742",
    "name": "",
    "expiry": {},
    "issuer_name": "",
    "issuer_country": ""
  },
  "receipt": {
    "id": "200519241133063627",
    "email": true,
    "sms": true
  },
  "customer": {
    "id": "cus_TS05A0520241133Hs491906640",
    "first_name": "test",
    "last_name": "test",
    "email": "[email protected]",
    "phone": {
      "country_code": "965",
      "number": "51234567"
    }
  },
  "merchant": {
    "country": "KW",
    "currency": "KWD",
    "id": "599424"
  },
  "source": {
    "object": "source",
    "type": "CARD_NOT_PRESENT",
    "payment_type": "DEBIT",
    "channel": "INTERNET",
    "id": "src_qa.qpay",
    "on_file": false,
    "payment_method": "QPAY"
  },
  "redirect": {
    "status": "SUCCESS",
    "url": "http://your_website.com/redirect_url"
  },
  "post": {
    "status": "ERROR",
    "url": "http://your_website.com/post_url"
  },
  "activities": [
    {
      "id": "activity_TS06A0620241133c4HR1906047",
      "object": "activity",
      "created": 1718796783000,
      "status": "INITIATED",
      "currency": "QAR",
      "amount": 1,
      "remarks": "charge - created",
      "txn_id": "chg_TS07A0320241133g5RO1906000"
    },
    {
      "id": "activity_TS07A0420241138Fj4q1906156",
      "object": "activity",
      "created": 1718797084156,
      "status": "CAPTURED",
      "currency": "QAR",
      "amount": 1,
      "remarks": "charge - captured",
      "txn_id": "chg_TS07A0320241133g5RO1906000"
    }
  ],
  "auto_reversed": false
}