PayTabs Laravel Package makes integration with the PayTabs payment gateway very easy by providing a ready-made payment class that handles the card entry and, billing & shipping information and completes the missing details.
To void a transaction means that the previously authorized/held amount from a previous auth transaction will be released back to the cardholder's bank account from his own bank side, as it was kept on hold there. In this article, we walk you through how to use and manage the below function:
Paypage::void('tran_ref','order_id','amount','void description');
Void requests are available for ONLY authenticated "Auth" transactions that are NOT fully captured yet.
Through out the article we will use the transaction types clarified in our What is "tran_type"? solution article.
Transaction Reference
The Parameter Tag/Name | tran_ref |
Example | $tran_ref = "TST2016700000692"; |
Data Type | STRING |
Required | ✔ |
Purpose | Indicates the reference to the "Auth" transaction you want to capture. |
Validation Rules | Accept only valid "Auth" transaction references. |
Order Id
The Parameter Tag/Name | order_id |
Example | $order_id = "CART#1001"; |
Data Type | STRING |
Required | ✔ |
Purpose | Indicates the cart id to the transaction you want to create. |
Amount
The Parameter Tag/Name | amount |
Example | $amount = 100.50 |
Data Type | DECIMAL |
Required | ✔ |
Purpose | Indicates the amount you want to void, either the full amount for a void or partial one for a release. |
Validation Rules | Accept only decimal amounts, which must be less than or equal to the authorized amount that has not been captured yet. |
Description
The Parameter Tag/Name | description |
Example | $description = "order description"; |
Data Type | STRING |
Required | ✔ |
Purpose | Indicates the cart/order description at your end to easily relate this transaction to. It might contain the reason for the capture. |
Sample Response Payload
Sample Response Payload
⌂ To get familiar with the whole process and the other steps, kindly navigate to our "The Laravel Packge Integration Manual" solution article.
⇦ And to get familiar with the rest of the steps regarding the current step "Step 7 - Manage Transactions" kindly click here.
⇦ And to navigate to the previous step in the integration process "Step 6 - Handle the post payment responses" kindly click here.