We are excited to introduce a new feature

I am delighted to announce that a highly requested feature has been added to Nuxbill! We now support Multiple Payment Gateways, allowing customers to choose their preferred payment method. This update brings greater flexibility and convenience to our users.
This commit is contained in:
Focuslinkstech 2024-03-11 09:34:25 +01:00 committed by Ibnu Maksum
parent f885b8e8a3
commit 61c1d25096
No known key found for this signature in database
GPG Key ID: 7FC82848810579E5
3 changed files with 64 additions and 14 deletions

View File

@ -267,18 +267,39 @@ switch ($action) {
$ui->display('user-sendPlan.tpl'); $ui->display('user-sendPlan.tpl');
break; break;
case 'buy': case 'buy':
$ui->assign('_title', Lang::T('Select Payment Gateway'));
$ui->assign('_system_menu', 'package');
if (strpos($user['email'], '@') === false) { if (strpos($user['email'], '@') === false) {
r2(U . 'accounts/profile', 'e', Lang::T("Please enter your email address")); r2(U . 'accounts/profile', 'e', Lang::T("Please enter your email address"));
} }
if ($config['payment_gateway'] == 'none') {
r2(U . 'home', 'e', Lang::T("No Payment Gateway Available"));
}
if (!file_exists($PAYMENTGATEWAY_PATH . DIRECTORY_SEPARATOR . $config['payment_gateway'] . '.php')) { if (!file_exists($PAYMENTGATEWAY_PATH . DIRECTORY_SEPARATOR . $config['payment_gateway'] . '.php')) {
r2(U . 'home', 'e', Lang::T("No Payment Gateway Available")); r2(U . 'home', 'e', Lang::T("No Payment Gateway Available"));
} }
require_once $PAYMENTGATEWAY_PATH . DIRECTORY_SEPARATOR . $config['payment_gateway'] . '.php';
$files = scandir($PAYMENTGATEWAY_PATH);
foreach ($files as $file) {
if (pathinfo($file, PATHINFO_EXTENSION) == 'php') {
$pgs[] = str_replace('.php', '', $file);
}
}
$ui->assign('pgs', $pgs);
$ui->assign('route2', $routes[2]);
$ui->assign('route3', $routes[3]);
//$ui->assign('plan', $plan);
$ui->display('user-selectGateway.tpl');
break;
case 'pay_now':
$gateway = $_POST['gateway'];
//$routes[2] = $_GET['route2'];
//$routes[3] = $_GET['route3'];
if ($gateway == 'none') {
r2(U . 'order/buy/' . $routes[2] . '/' . $routes[3], 'e', Lang::T("No Payment Gateway Selected"));
}
run_hook('customer_buy_plan'); #HOOK run_hook('customer_buy_plan'); #HOOK
include $PAYMENTGATEWAY_PATH . DIRECTORY_SEPARATOR . $config['payment_gateway'] . '.php'; include $PAYMENTGATEWAY_PATH . DIRECTORY_SEPARATOR . $gateway . '.php';
call_user_func($config['payment_gateway'] . '_validate_config'); call_user_func($gateway . '_validate_config');
if ($routes['2'] == 'radius') { if ($routes['2'] == 'radius') {
$router['id'] = 0; $router['id'] = 0;

View File

@ -1,17 +1,16 @@
{include file="sections/header.tpl"} {include file="sections/header.tpl"}
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12">
<div class="panel panel-info panel-hovered"> <div class="panel panel-info panel-hovered">
<div class="panel-heading">{Lang::T('Payment Gateway')}</div> <div class="panel-heading">{Lang::T('Payment Gateway')}</div>
<div class="panel-body row"> <div class="panel-body row">
{foreach $pgs as $pg} {foreach $pgs as $pg}
<div class="col-sm-4 mb20"> <div class="col-sm-4 mb20">
<a href="{$_url}paymentgateway/{$pg}" <a href="{$_url}paymentgateway/{$pg}" class="btn btn-block btn-default">{ucwords($pg)}</a>
class="btn btn-block btn-{if $pg==$_c['payment_gateway']}success{else}default{/if}">{ucwords($pg)}</a> </div>
</div>
{/foreach} {/foreach}
</div> </div>
<div class="panel-footer"> <!-- <div class="panel-footer">
<form method="post"> <form method="post">
<div class="form-group row"> <div class="form-group row">
<label class="col-md-2 control-label">Payment Gateway</label> <label class="col-md-2 control-label">Payment Gateway</label>
@ -28,7 +27,7 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div> -->
</div>
</div> </div>
</div> {include file="sections/footer.tpl"}
{include file="sections/footer.tpl"}

View File

@ -0,0 +1,30 @@
{include file="sections/user-header.tpl"}
<div class="row">
<div class="col-sm-12">
<div class="panel panel-info panel-hovered">
<div class="panel-heading">{Lang::T('Available Payment Gateway')}</div>
<div class="panel-footer">
<form method="post" action="{$_url}order/pay_now/{$route2}/{$route3}">
<div class="form-group row">
<label class="col-md-2 control-label">Payment Gateway</label>
<div class="col-md-8">
<select name="gateway" id="gateway" class="form-control">
<option value="none" selected="selected">None</option>
{foreach $pgs as $pg}
<option value="{$pg}">
{ucwords($pg)}</option>
{/foreach}
</select>
</div>
<div class="col-md-2">
<button type="submit" class="btn btn-block btn-primary">{Lang::T('Pay Now')}</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
{include file="sections/user-footer.tpl"}