Paytabs 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.
This article is dedicated to walking you through how to handle the payment response sent from PayTabs after the payment. Handling the response right will empower you to make sure to handle the user experience according to the payment status as well as and updating the order status in your database.
In this article, you will be going to know how to handle the payment response:
To get the best out of this article, it's highly recommended to check our Five ways of receiving transaction response solution article.
via The Return URL response
According to the used integration type flow clarified in Step 5 - Handle the payment response | Response Flow solution article, you will receive the below response payload. However, it is worth mentioning that the main reason for this type of response on the return page is to customize the return page either to a successful or failed payment route.
acquirerMessage=&acquirerRRN=&cartId=CART%231001&customerEmail=mohammed.elrayes%40paytabs.com&respCode=G10046&respMessage=Authorised&respStatus=A&signature=3701705571119d23923a8677db0d5ae9086988c02b9bbfd354f80d84954d2f9a&token=&tranRef=TST2231101374414
Parameter | Sample Response | Actual Data | Nullable | Purpose |
00:Approved | 00:Approved | ✔ | Indicates the response message as received from the acquirer bank | |
234115208294 | 234115208294 | ✔ | Indicates the RRN as received from the acquirer bank | |
CART%231001 | CART#1001 | ❌ | Indicates the Cart ID as received from the Merchant side on creating the payment | |
mohammed.elrayes⏎ | mohammed.elrayes⏎ | ❌ | Indicates the customer email as stored on the transaction details | |
03656D | 03656D | ❌ | Indicates the response code | |
Authorised | Authorised | ❌ | Indicates the response message | |
A | A | ❌ | Indicates the response status. | |
3701705571119d2⏎ | 3701705571119d2⏎ | ✔ | The signature can be used to validate the response, making sure it's coming from Paytabs side. | |
2C4652BD67A3E⏎ | 2C4652BD67A3E⏎ | ✔ | Only if the card has been tokenized (have a token created representing this card) the card token would be returned within the response. | |
TST2231101374414 | TST2231101374414 | ❌ | Indicates the Transaction Reference as on Paytabs. |
Verify the Return Response
It's highly recommended to verify the Return response first. Verifying the received object is a mandatory step to ensure that the request source is Paytabs itself. To know how to perform this, kindly check our How to verify the response received from PayTabs? (Signature Verification) solution article.
However, we highly recommend you to NOT only rely on this response as it might be affected bu the customer behavior and to rely entirly on the post payment responses clarified in the next step.
⌂ 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 previuos step "Step 4 - Accepting the payment" kindly click here. ⇨ And to navigate to the next step in the integration process "Step 6 - Handle the post payment responses" kindly click here.