This commit is contained in:
Ibnu Maksum
2022-09-18 00:00:40 +07:00
parent 742e0df1f2
commit e6f8826490
25 changed files with 121 additions and 105 deletions

View File

@ -12,6 +12,7 @@ $ui->assign('_user', $user);
switch ($action) {
case 'voucher':
$ui->assign('_title', $_L['Order_Voucher'] . ' - ' . $config['CompanyName']);
run_hook('customer_view_order'); #HOOK
$ui->display('user-order.tpl');
break;
case 'history':
@ -22,21 +23,24 @@ switch ($action) {
$ui->assign('paginator', $paginator);
$ui->assign('d', $d);
$ui->assign('_title', Lang::T('Order History') . ' - ' . $config['CompanyName']);
run_hook('customer_view_order_history'); #HOOK
$ui->display('user-orderHistory.tpl');
break;
case 'package':
$ui->assign('_title', 'Order PPOE Internet - ' . $config['CompanyName']);
$ui->assign('_title', 'Order Plan - ' . $config['CompanyName']);
$routers = ORM::for_table('tbl_routers')->find_many();
$plans = ORM::for_table('tbl_plans')->where('enabled', '1')->find_many();
$ui->assign('routers', $routers);
$ui->assign('plans', $plans);
$ui->display('user-orderPackage.tpl');
run_hook('customer_view_order_plan'); #HOOK
$ui->display('user-orderPlan.tpl');
break;
case 'unpaid':
$d = ORM::for_table('tbl_payment_gateway')
->where('username', $user['username'])
->where('status', 1)
->find_one();
run_hook('customer_find_unpaid'); #HOOK
if ($d) {
if (empty($d['pg_url_payment'])) {
r2(U . "order/buy/" . $trx['routers_id'] . '/' . $trx['plan_id'], 'w', Lang::T("Checking payment"));
@ -51,6 +55,7 @@ switch ($action) {
$trx = ORM::for_table('tbl_payment_gateway')
->where('username', $user['username'])
->find_one($trxid);
run_hook('customer_view_payment'); #HOOK
// jika tidak ditemukan, berarti punya orang lain
if (empty($trx)) {
r2(U . "order/package", 'w', Lang::T("Payment not found"));
@ -63,11 +68,13 @@ switch ($action) {
if (!file_exists('system/paymentgateway/' . $trx['gateway'] . '.php')) {
r2(U . 'order/view/' . $trxid, 'e', Lang::T("No Payment Gateway Available"));
}
run_hook('customer_check_payment_status'); #HOOK
include 'system/paymentgateway/' . $trx['gateway'] . '.php';
call_user_func($trx['gateway'] . '_validate_config');
call_user_func($_c['payment_gateway'] . '_get_status', $trx, $user);
} else if ($routes['3'] == 'cancel') {
run_hook('customer_cancel_payment'); #HOOK
$trx->pg_paid_response = '{}';
$trx->status = 4;
$trx->paid_date = date('Y-m-d H:i:s');
@ -99,6 +106,7 @@ switch ($action) {
if (!file_exists('system/paymentgateway/' . $_c['payment_gateway'] . '.php')) {
r2(U . 'home', 'e', Lang::T("No Payment Gateway Available"));
}
run_hook('customer_buy_plan'); #HOOK
include 'system/paymentgateway/' . $_c['payment_gateway'] . '.php';
call_user_func($_c['payment_gateway'] . '_validate_config');