ClickPay provides you with a collection of API endpoints which used to process all payments, regardless of if they are through either your own payment pages, the managed payment pages, or if you are using the hosted payment pages.
Managed Form integration type is suitable for merchants with PCI SAQ A-EP. To know more about the Hosted Payment Page PCI DSS merchant requirements, please check this article.
In this article, we will go through the main parameters that are required for making the managed form requests; and we will clarify each parameter's purpose of use and whether it's required or not, as shown in the below table to assist you more in handling those parameters within your own code. We highly recommend that you and your team check our "3.1.2 - PT2 API Endpoints | Payment workflow | Managed Form" solution article first to understand the business/logic this configuration option relay on.
This is Part one of the two parts of understanding how to initiate a payment request via the Managed Form integration type as clarified in our Step 3.2.2 Managed Form | Initiating the Payment Request solution article. You can find the first part in Step 3.2.2.1 Managed Form | Initiating the payment | Frontend Side.
In this article, you will be going to know about:
- The Endpoint and Related Postman Collection
- The Minimum Required Parameters
- The Available Optional Parameters
- Sample Request Payload
- Sample Response Payload
The Endpoint and Related Postman Collection
In this tutorial, we will rely on the ClickPay Hosted Payment Page API Endpoint, mentioned on ClickPay API endpoints postman collection, which you can access from here. The endpoint will need to be accessed with a POST request on the below-mentioned URL
Post | {{domain}}/payment/request |
Please note that not using the proper endpoint URI {{domain}} will lead to authentication issues within your responses. To find the your proper domain you can read our What Is My (Region)/(endpoint URL)? solution article.
At the end of Step 3.2.2.1 Managed Form | Initiating the payment | Frontend Side, you will receive the payment token, which you will use along with the following parameters to initiate the server-side request that will be sent to ClickPay
The Minimum Required Parameters
To initiate a payment request using this integration type, there are minimum required parameters that need to be passed with valid information. The specification of these required parameters is clarified below:
Parameter | Data Type | Min | Max | Required | Purpose |
INT | Accept only valid profile number | ✔ | The merchant Profile ID you can get from your PayTavs dashboard. For more information please check our How to get your account information from PT2 Dashboard? solution article. To know more about this parameter please click here. | ||
STRING | Valid string from this list | ✔ | the identification of the type of the transaction. To know more about these types please check our What is the "tran_type" (transaction type)? solution article. To know more about this parameter please click here. | ||
STRING | Valid string from this list | ✔ | the identification of the category/class this transaction will follow, such as eCommerce, Recurring, etc. To know more about these types please check our What is the "tran_class" (transaction class)? solution article. To know more about this parameter please click here. | ||
STRING | 1 | 64 | ✔ | Indicates the cart/order id at the merchant end to easily relate the transaction to To know more about this parameter please click here. | |
STRING | 1 | 128 | ✔ | Indicates the cart/order description at the merchant end to easily relate the transaction to To know more about this parameter please click here. | |
STRING | Valid string from the following list: • AED • BHD • EGP • EUR • GBP • HKD • IDR • INR • IQD • JOD •JPY • KWD • MAD • OMR • PKR • QAR • SAR • USD
Accepts both upper- and lower-case characters | ✔ | Indicates the transaction currency, which the customer will be charged with. To know more about this parameter please click here. | ||
DECIMAL | 0.01 | 9999999999.99 | ✔ | Indicates the amount of the transaction the customer is about to be charged To know more about this parameter please click here. |
Now in order to create a payment request through a Managed Form, you will need - in addition to the general required parameters mentioned above- to include new parameters required specific to the Managed Form. Find below the Additional required parameters for Manage Form:
Parameter | Required | Purpose |
✔ | Valid payment token To know more about this parameter please click here. | |
✔ | Indicates the customer details for this payment. To know more about this parameter please click here. | |
✔ | ||
✔ | ||
✔ | ||
✔ | ||
✔ | City Code or City name | |
✔ | State/Province Code or State/Province name | |
✔ | ||
✔ | ||
customer_details.ip | ✔ |
The Available Optional Parameters
Besides the above-mentioned required parameters, ClickPay provides you with several optional parameters, each of which empowers you with a different feature and the ability to customize your payment request as much as possible it could be. The specification of these optional parameters is clarified below:
Parameter | Required | Purpose |
❌ | The callback response is a server-to-server POST response that is sent (to a pre-defined HTTPS URL) with the full detailed transaction information once the payment process has ended (whether the customer cancels, paid, or failed to pay). It does not depend on the customer's actions; the response will be sent anyway.
| |
❌ | Indicates the shipping details for this payment. If provided, the payment page will be prefilled with the provided data. To know more about this parameter please click here. | |
❌ | ||
❌ | ||
❌ | ||
❌ | ||
❌ | ||
❌ | ||
❌ | ||
❌ | ||
❌ | The tokenization format the generated token should follow | |
❌ | For more customization, you can pass to the Transaction API request your own "user-defined fields" up to 9 fields, and accordingly, you would receive those fields in the callback response.
| |
❌ | ||
❌ | ||
❌ | ||
❌ | ||
❌ | ||
❌ | ||
❌ | ||
❌ | ||
❌ |
Sample Request Payload
The below sample request payload will show you how you can pass the above-mentioned parameters, which are needed to be passed with valid values to perform a request.
Sample Response Payload
Once the managed form request is validated and initiated, you will receive the following response, There are two scenarios that would change the workflow, as shown below:
Via Non-3DSecure Cards
If the card does NOT require 3DSecure authentication from the cardholder and issuer side, You will receive a response like the following:
You can notice that the payment is already made, A transaction has been created, and you are already receiving the payment results, unlike the following scenario, since the issuer required no 3DSecure, the transaction had been created.Via 3DSecured Cards
If the card does require the 3DSecure authentication from the cardholder and issuer side, You will receive a response like the following:
Regarding Step 3.1.2 Managed Form | Payment Workflow, by initiating the payment, and if the card is 3DSecured, you will receive the redirect URL (redirect_url) within the response. Use this URL to redirect your client browser to the issuer 3DSecure page.Once the cardholder authenticates using the card (E.G., via OTP), the customer will be redirected back to the return page if it had been set or to the ClickPay default transaction result page if no return page was set. To check more about this, you can navigate to the return URL parameter solution article.
⌂ To get familiar with the whole process and the other steps, kindly navigate to our "The PT2 API Endpoints Integration Manual" solution article.
⇦ And to get familiar with the rest of the steps regarding the previous step "Step 2 - Configure the integration method" kindly click here.
⇦ And to get familiar with the rest of the steps regarding the current step "Step 3 - Initiating the payment" click here.
⇨ And to navigate to the next step in the integration process "Step 4 - Accepting the payment" kindly click here.