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

check details on [Return Page Response | Acquirer Message [acquirerMessage]]

234115208294

234115208294

 

Indicates the RRN as received from the acquirer bank

check details on [Return Page Response | Acquirer Retrieval Reference Number [acquirerRRN]]

CART%231001

CART#1001

Indicates the Cart ID as received from the Merchant side on creating the payment

check details on [Return Page Response | Cart ID [cartId]]

mohammed.elrayes⏎
%40paytabs.com

mohammed.elrayes⏎
@paytabs.com

Indicates the customer email as stored on the transaction details

check details on [Return Page Response | Customer Email [customerEmail]]

03656D

03656D

Indicates the response code

check details on [Return Page Response | Response Code [respCode]]

Authorised

Authorised

Indicates the response message

check details on [Return Page Response | Response Message [respMessage]]

A

A

Indicates the response status.
This status can be used from your system side to decide the transaction status. Only (A) can be considered a successful transaction. 
  
check details on [Return Page Response | Response Status [respStatus]]

3701705571119d2⏎
3923a8677db0d5a⏎
e9086988c02b9bb⏎
fd354f80d84954d2⏎
f9a

3701705571119d2⏎
3923a8677db0d5a⏎
e9086988c02b9bb⏎
fd354f80d84954d2⏎
f9a

 

The signature can be used to validate the response, making sure it's coming from Paytabs side. 
  
check details on [Return Page Response | Signature [signature]]

2C4652BD67A3E⏎
936C6B490FC65⏎
8B75B1

2C4652BD67A3E⏎
936C6B490FC65⏎
8B75B1

 

Only if the card has been tokenized (have a token created representing this card) the card token would be returned within the response. 
  
check details on [Return Page Response | Card Token [token]]

TST2231101374414

TST2231101374414

Indicates the Transaction Reference as on Paytabs. 
  
check details on [Return Page Response | Transaction Reference [tranRef]]




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.