After a transaction process comes to end, you can easily depend on the mentioned methods to update your system with the transaction/payment status to proceed with your order business flow process, such as shipping the order once the payment is authenticated, unlocking the products locked quantities after the payment is failed and so.
TABLE OF CONTENTS
- What is Transaction Response?
- 1 - Return Response
- 2 - Callback Response
- 3 - IPN Response
- 4 - SendGrid
- 5 - Query Transaction API Endpoint
What is Transaction Response?
The transaction response is the information you will receive from ClickPay after the transaction process comes to an end whether is it authorized, declined, canceled, etc.
1 - Return Response
What is the Return Response using POST?
The return response is a POST response that is sent from the client browser (Cardholder) with the basic transaction information only after the payment came to an end (whether the customer cancels, paid, or failed to pay) and redirects the customer back to your system.
Return Payload Sample
acquirerMessage= &acquirerRRN= &cartId=cart_11111 &customerEmail=email%40domain.com &respCode=G77803 &respMessage=Authorised &respStatus=A &token= &tranRef=SFT202860000xxxx
The "acquirerRPN", "respCode", ... will be different on your Live profiles because they are sent from the bank side. (Read more about Response Code and Response Status on the article "What is: Response_code vs the Response_status?")
If the return URL passed as HTTP (Not HTTPS) it will sent as GET response instead with empty payload
You will receive a "return" response if you supplied a return URL in the payment request payload as shown below.
What is the Return Response using GET?
The return response is a Get response that is sent from the client browser (Cardholder) with the basic transaction information only after the payment came to an end (whether the customer cancels, paid, or failed to pay) and redirects the customer back to your system.
Return Payload Sample
https://webhook.site/631b2c7c-ab4f-4019-8320-b1bc7fbc5dc6?cartId=cart_11111&respCode=G61682&respStatus=A&signature=9c4d3dfc0c2ec1b90676f8f071b5d376523cc7600e4b0ff13acf8090450d4e7e&tranRef=TST2333900019021
Parameter | Description |
---|---|
cartId | The merchant unique reference |
respCode | The result Code for merchant internal usage |
respStatus | Transaction Status |
signature | Unique for each transaction |
tranRef | Clickpay transaction unique reference |
To Get the payment result as get parameters after redirection to return page, you need to pass "return_using_get" with (true) value.
"return_using_get":true
You will receive a "return" response if you supplied a return URL in the payment request payload as shown below.
2 - Callback Response
What is the Callback Response?
The return response is a server-to-server POST response that is sent (to pre-defined HTTPS) with full detailed transaction information only after the payment came to an end (whether the customer cancels, paid, or failed to pay).
Callback Response Sample
{ "tran_ref": "SFT202860000xxxxx", "cart_id": "cart_11111", "cart_description": "Description of the items", "cart_currency": "SAR", "cart_amount": "12.3", "customer_details": { "name": "first last", "email": "[email protected]", "phone": "0522222222", "street1": "address street", "city": "riyadh", "state": "riyadh", "country": "SA", "ip": "10.0.0.1" }, "shipping_details": { "name": "name last1", "email": "[email protected]", "phone": "0555555555", "street1": "street2", "city": "riyadh", "state": "riyadh", "country": "SA", "ip": "10.0.0.1" }, "payment_result": { "response_status": "A", "response_code": "G77803", "response_message": "Authorised", "transaction_time": "2020-10-12T04:43:23Z" }, "payment_info": { "card_type": "Credit", "card_scheme": "Visa", "payment_description": "4111 11## #### 1111" }
You will receive a "callback" response only if you supplied a callback URL in the payment request payload as shown below.
3 - IPN Response
What is the IPN Response?
The IPN response is an instant payment notification response that will be sent to the pre-configured IPN listener (URL), only according to the cases/events that you configured the event type in (Sale, Auth, Refund, etc).
For more about what is the IPN, its different types, and how to configure a one, kindly check our "How to configure Instant payment notification (IPN)?" solution article
4 - SendGrid
What is the SendGrid?
SendGrid is a customer communication platform for transaction and marketing emails. In other words, a tool that allows you and your clients to receive emails about each transaction detail.
To know more about the SendGrid and how to configure it, kindly check our "How to integrate my ClickPay account with my SendGrid account?" solution article
5 - Query Transaction API Endpoint
What is the Query Transaction API endpoint?
The query transaction is an endpoint API that allows you to fetch its details, to know more about its status, type, etc. You can use this endpoint as it will return the details of the requested transaction.
Response Payload Sample
{ "tran_ref": "SFT202860000xxxxx", "cart_id": "cart_11111", "cart_description": "Description of the items", "cart_currency": "SAR", "cart_amount": "12.3", "customer_details": { "name": "first last", "email": "[email protected]", "phone": "0522222222", "street1": "address street", "city": "riyadh", "state": "riyadh", "country": "SA", "ip": "10.0.0.1" }, "shipping_details": { "name": "name last1", "email": "[email protected]", "phone": "055555555", "street1": "street2", "city": "riyadh", "state": "riyadh", "country": "SA", "ip": "10.0.0.1" }, "payment_result": { "response_status": "A", "response_code": "G77803", "response_message": "Authorised", "transaction_time": "2020-10-12T04:43:23Z" }, "payment_info": { "card_type": "Credit", "card_scheme": "Visa", "payment_description": "4111 11## #### 1111" }
The "Query transaction API " response payload is same as the "callback" response one.
To know more about this endpoint and how to use it, kindly check our "Follow Up API endpoints" solution article.