Sending Customized Parameters
PayTabs provides you with the backend packages that make the integrating with PayTabs payment gateway very easy by providing ready-made classes that handle the payment process.
This article is dedicated to walking you through how to send user-defined parameters/values which are parameters that can be passed within the Transaction API request your own "user-defined fields" up to 9 fields, and accordingly, you would receive those fields in the callback response.
Method Specification
Description | For more customizations, 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. |
---|---|
Since | 1.0.0 |
Required | ✘ |
Signature |
|
Sample |
|
Method Parameters:
Udf1
Name | $udf1 |
---|---|
Type | STRING |
Default | - |
Min | 1 |
Max | 255 |
Required | ✘ |
Udf2
Name | $udf2 |
---|---|
Type | STRING |
Default | - |
Min | 1 |
Max | 255 |
Required | ✘ |
Udf3
Name | $udf3 |
---|---|
Type | STRING |
Default | - |
Min | 1 |
Max | 255 |
Required | ✘ |
Udf4
Name | $udf4 |
---|---|
Type | STRING |
Default | - |
Min | 1 |
Max | 255 |
Required | ✘ |
Udf5
Name | $udf5 |
---|---|
Type | STRING |
Default | - |
Min | 1 |
Max | 255 |
Required | ✘ |
Udf6
Name | $udf6 |
---|---|
Type | STRING |
Default | - |
Min | 1 |
Max | 255 |
Required | ✘ |
Udf7
Name | $udf7 |
---|---|
Type | STRING |
Default | - |
Min | 1 |
Max | 255 |
Required | ✘ |
Udf8
Name | $udf8 |
---|---|
Type | STRING |
Default | - |
Min | 1 |
Max | 255 |
Required | ✘ |
Udf9
Name | $udf9 |
---|---|
Type | STRING |
Default | - |
Min | 1 |
Max | 255 |
Required | ✘ |
Expected payment flow behaviour:
- As a merchant you would initiate a payment request per the above Specifications, which include a sample code.
- Then, you will call the method create_pay_page() and return the result to redirect the customer to the payment page.
try {
$paymentPage = paypage::sendTransaction('sale','ecom')
->sendCart("Order_101", 1000.00, 'Order Description')
->sendUserDefined( [ "udf1"=>"UDF1 Test", "udf2"=>"UDF2 Test", "udf3"=>"UDF3 Test"])
->create_pay_page();
return $paymentPage;
} catch (\Exception $e) {
// Handle errors appropriately
return back()->with('error', 'Payment initiation failed: ' . $e->getMessage());
} - After this, your customer would proceed normally with payment by choosing the preferred payment method (if available), and providing his card information.
- Then, he will be redirected to his issuer bank 3DS/OTP page to authenticate the used card
- Finally, he would be redirect to a success/error page accordingly. By this time, you will be able to see his transaction on your merchant dashboard, whether it's accepted/authorized or not.