Skip to content

Commit

Permalink
Customizeable Payment Recharge
Browse files Browse the repository at this point in the history
  • Loading branch information
ibnux committed May 14, 2024
1 parent 895bb26 commit fa45d5f
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
8 changes: 7 additions & 1 deletion system/controllers/plan.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@
if (isset($routes['2']) && !empty($routes['2'])) {
$ui->assign('cust', ORM::for_table('tbl_customers')->find_one($routes['2']));
}
$usings = explode(',', $config['payment_usings']);
$usings = array_filter(array_unique($usings));
if(count($usings)==0){
$usings[] = Lang::T('Cash');
}
$ui->assign('usings', $usings);
run_hook('view_recharge'); #HOOK
$ui->display('recharge.tpl');
break;
Expand Down Expand Up @@ -146,7 +152,7 @@
}

if ($msg == '') {
$gateway = 'Recharge';
$gateway = ucwords($using);
$channel = $admin['fullname'];
$cust = User::_info($id_customer);
list($bills, $add_cost) = User::getBills($id_customer);
Expand Down
5 changes: 3 additions & 2 deletions system/lan/english.json
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,7 @@
"Confirmation_Message": "Confirmation Message",
"You_are_already_logged_in": "You are already logged in",
"Extend": "Extend",
"Created___Expires": "Created \/ Expires",
"Created___Expired": "Created \/ Expired"
"Created___Expired": "Created \/ Expired",
"Bank_Transfer": "Bank Transfer",
"Recharge_Using": "Recharge Using"
}
7 changes: 7 additions & 0 deletions ui/ui/app-settings.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,13 @@
href="https://github.com/hotspotbilling/phpnuxbill/wiki/Themes" target="_blank">Theme
info</a></p>
</div>
<div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Recharge Using')}</label>
<div class="col-md-6">
<input type="text" name="payment_usings" class="form-control" value="{$_c['payment_usings']}" placeholder="{Lang::T('Cash')}, {Lang::T('Bank Transfer')}">
</div>
<p class="help-block col-md-4">This used for admin to select payment in recharge, using comma for every new options</p>
</div>
<div class="form-group">
<label class="col-md-2 control-label">APP URL</label>
<div class="col-md-6">
Expand Down
4 changes: 3 additions & 1 deletion ui/ui/recharge.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@
<label class="col-md-2 control-label">{Lang::T('Using')}</label>
<div class="col-md-6">
<select name="using" class="form-control">
<option value="cash">{Lang::T('Cash')}</option>
{foreach $usings as $using}
<option value="{trim(ucWords($using))}">{trim(ucWords($using))}</option>
{/foreach}
{if $_c['enable_balance'] eq 'yes'}
<option value="balance">{Lang::T('Customer Balance')}</option>
{/if}
Expand Down

0 comments on commit fa45d5f

Please sign in to comment.