Adding A New Gateway

adding your own personalized payment gateway to PHPTRAVELS
To add your own payment gateway to PHPTRAVELS follow below guide line
01. login to your admin panel as and navigate to payment gateways from general settings
02. from payment gateways page click on add as below
03. On the payment gateway adding page add all your credentials as below markup with red line. you can add your.
we will only add the payment gateways credentials later we we will fetch these credentials from client app to proceed with payment. you can add your credentials under the c1 c2 c3 c4 c5 inputs and rest of the fields are mandatory such as developer URL production URL gateway status and so on.
04. All good now we need to add the image of payment gateway which we used to show on checkout page as you can see below marked red lines on payment gateway.
image of payment gateway
05. Place your payment gateways image under the path as below
app/themes/default/assets/img/gateways/ your-gateway .png
make sure the image name of your payment gateway must match to your payment gateways name as it is case sensitive and all characters should be small follow by dash if there is spaces. For example Gateway Name : Union Pay Image Name : union-pay.png Final results
06. All done from the backend API side and client side for gateway image now we have to move to the actual work which is coding of payment gateway.
Navigate to file
Copy the file paypal.php and then paste it then rename it to your gateway name such as union-pay.php Then edit the file union-pay.php ( your payment gateway name ) 07. Now remove all the code from the file and add below code to the file
// gateway name
$router->post('payment/union-pay', function() {
include "app/core/pay_params.php";
// add your javascrpt here
// below is the params to use for your gateway as for credentials we will use c1 c2 c3 c4 c5 c6 find detailed params below
gateway URL <?=$url?>
credential keys <?=$c1?> <?=$c2?> <?=$c3?> <?=$c4?> <?=$c5?>
success URL <?=$success_url?>
return on invoice URL <?=$invoice_url?>
order details <?=$price?> <?=$currency?> <?=$desc?>
buyer details <?=$client_email?>
$body = "<a href="payment_link" onclick="" class="pay" style="background:#445a7d"/>'.T::paynow.'</a>";
include "app/core/pay_view.php";
<?php });
you will need to add your code above customize your payment gateway and then pass anchor link to $body = "<a href="payment_link" or if you are integrating SPA gateway with popup or any JS based onpage payment you need to setup onclick function to call using body = onclick="your_func"
Once all job is done and you should need to test your gateway please make sure to destroy browsers session using sd means session destroy it will return back to your website with newly fetch data from main server API
t is super easy to integrate any level of payment gateway to PHPTRAVELS still if you found any hassle or hurdles please feel free to contact us directly on our livechat or shoot us email to our mailbox at [email protected]
Last modified 3mo ago