We recommend this method if you are PCI certified to a minimum of SAQ D-Merchant. This is because the card details will be handled by your system.


In this article you will be going to know about:


Postman Endpoint Example


For the purposes of this article, you will need to use the following postman endpoint example for testing and integrating, for proceeding with this please click here.



Payment Flow

  1. Your website will display its own card entry form and will be ensuring that you capture the required details including the card number, expiry date, and security code. When the customer completed the form, the details will be submitted to your own servers.
  2. Your servers then must send a payment request to the PayTabs gateway. The customers' card details must be included in that request.
  3. In case that the card used is 3DS enrolled, the API response will return a redirect URL, which you must navigate the cardholder to, to complete his payment. Otherwise, in case that the card used is non 3DS, the payment result will be returned in the API response itself.


You must ensure that your servers do not record or log the card details in any way.



Sample Request Payload

After receiving the card details from your payment page, you must send a payment request using the transaction API. 

You will need to include the card details and customer details within the payment request.


Post{{domain}}/payment/request


Request for 3DS cards


{
    "profile_id": {{profile_id}},
    "tran_type": "sale",
    "tran_class": "ecom",
    "cart_id": "cart_11111",
    "cart_currency": "AED",
    "cart_amount": 12.3,
    "cart_description": "Description of the items/services",
    "paypage_lang": "en",
    "customer_details": {
        "name": "first last",
        "email": "[email protected]",
        "phone": "0522222222",
        "street1": "address street",
        "city": "dubai",
        "state": "du",
        "country": "AE",
        "zip": "12345",
        "ip": "1.1.1.1"
    },
    "shipping_details": {
        "name": "name1 last1",
        "email": "[email protected]",
        "phone": "971555555555",
        "street1": "street2",
        "city": "dubai",
        "state": "dubai",
        "country": "AE",
        "zip": "54321",
        "ip": "2.2.2.2"
    },
    "callback": "{{callback_url}}",
    "return": "{{return_url}}",
    "card_details": {
        "pan": "4000000000000002",
        "cvv": "123",
        "expiry_month": 12,
        "expiry_year": 2022
    }
}

Request for non 3DS cards


{
    "profile_id": {{profile_id}},
    "tran_type": "sale",
    "tran_class": "ecom",
    "cart_id": "cart_11111",
    "cart_currency": "AED",
    "cart_amount": 12.3,
    "cart_description": "Description of the items/services",
    "paypage_lang": "en",
    "customer_details": {
        "name": "first last",
        "email": "[email protected]",
        "phone": "0522222222",
        "street1": "address street",
        "city": "dubai",
        "state": "du",
        "country": "AE",
        "zip": "12345",
        "ip": "1.1.1.1"
    },
    "shipping_details": {
        "name": "name1 last1",
        "email": "[email protected]",
        "phone": "971555555555",
        "street1": "street2",
        "city": "dubai",
        "state": "dubai",
        "country": "AE",
        "zip": "54321",
        "ip": "2.2.2.2"
    },
    "callback": "{{callback_url}}",
    "return": "{{return_url}}",
    "card_details": {
        "pan": "4111111111111111",
        "cvv": "123",
        "expiry_month": 12,
        "expiry_year": 2022
    }
}

Sample Response Payload


Response with redirect URL (3DS Cards)

{
  "tran_ref": "TST2033600019179",
  "tran_type": "Sale",
  "cart_id": "cart_11111",
  "cart_description": "Description of the items/services",
  "cart_currency": "AED",
  "cart_amount": "12.3",
  "return": "https://webhook.site/92ac6a52-256d-434b-bde8-94b1e73d3aa1",
  "redirect_url": "https://secure.paytabs.com/payment/page/00C5499B82E406E003415A157D77D5FD9CBCCE3E537AD06E5865E7CA/redirect",
  "customer_details": {
    "name": "first last",
    "email": "[email protected]",
    "phone": "0522222222",
    "street1": "address street",
    "city": "dubai",
    "state": "DU",
    "country": "AE",
    "ip": "1.1.1.1"
  },
  "shipping_details": {
    "name": "name1 last1",
    "email": "[email protected]",
    "phone": "971555555555",
    "street1": "street2",
    "city": "dubai",
    "state": "DU",
    "country": "AE",
    "ip": "2.2.2.2"
  },
  "payment_info": {
    "card_type": "Credit",
    "card_scheme": "Visa",
    "payment_description": "4000 00## #### 0002"
  }
}


Response with payment result (non 3DS Cards)

{
  "tran_ref": "TST2033600019178",
  "tran_type": "Sale",
  "cart_id": "cart_11111",
  "cart_description": "Description of the items/services",
  "cart_currency": "AED",
  "cart_amount": "12.3",
  "return": "https://webhook.site/92ac6a52-256d-434b-bde8-94b1e73d3aa1",
  "customer_details": {
    "name": "first last",
    "email": "[email protected]",
    "phone": "0522222222",
    "street1": "address street",
    "city": "dubai",
    "state": "DU",
    "country": "AE",
    "ip": "1.1.1.1"
  },
  "shipping_details": {
    "name": "name1 last1",
    "email": "[email protected]",
    "phone": "971555555555",
    "street1": "street2",
    "city": "dubai",
    "state": "DU",
    "country": "AE",
    "ip": "2.2.2.2"
  },
  "payment_result": {
    "response_status": "A",
    "response_code": "831000",
    "response_message": "Authorised",
    "acquirer_message": "100:ACCEPT",
    "acquirer_rrn": "033618116239",
    "transaction_time": "2020-12-01T18:32:47Z"
  },
  "payment_info": {
    "card_type": "Credit",
    "card_scheme": "Visa",
    "payment_description": "4111 11## #### 1111"
  },
  "token": "JfN1DVwmwVrSS5t4bP11CQ2t6gDyEp5T"
}