Merge pull request #122 from Focuslinkstech/Development

We are excited to introduce a new feature
This commit is contained in:
iBNu Maksum 2024-03-12 09:06:43 +07:00 committed by GitHub
commit 4e23918999
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 64 additions and 14 deletions

View File

@ -267,18 +267,39 @@ switch ($action) {
$ui->display('user-sendPlan.tpl');
break;
case 'buy':
$ui->assign('_title', Lang::T('Select Payment Gateway'));
$ui->assign('_system_menu', 'package');
if (strpos($user['email'], '@') === false) {
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')) {
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
include $PAYMENTGATEWAY_PATH . DIRECTORY_SEPARATOR . $config['payment_gateway'] . '.php';
call_user_func($config['payment_gateway'] . '_validate_config');
include $PAYMENTGATEWAY_PATH . DIRECTORY_SEPARATOR . $gateway . '.php';
call_user_func($gateway . '_validate_config');
if ($routes['2'] == 'radius') {
$router['id'] = 0;

View File

@ -6,12 +6,11 @@
<div class="panel-body row">
{foreach $pgs as $pg}
<div class="col-sm-4 mb20">
<a href="{$_url}paymentgateway/{$pg}"
class="btn btn-block btn-{if $pg==$_c['payment_gateway']}success{else}default{/if}">{ucwords($pg)}</a>
<a href="{$_url}paymentgateway/{$pg}" class="btn btn-block btn-default">{ucwords($pg)}</a>
</div>
{/foreach}
</div>
<div class="panel-footer">
<!-- <div class="panel-footer">
<form method="post">
<div class="form-group row">
<label class="col-md-2 control-label">Payment Gateway</label>
@ -28,7 +27,7 @@
</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"}