From 8d7b1c6ff0ddf9264af5191605fe222382135250 Mon Sep 17 00:00:00 2001 From: Ibnu Maksum Date: Thu, 8 Sep 2022 17:09:21 +0700 Subject: [PATCH] xendit without callback OK --- system/autoload/Paymentgateway.php | 20 +- system/autoload/Recharge.php | 374 ++++++++++++++++++++++++++++ system/controllers/order.php | 137 +++++++++- system/lan/indonesia/common.lan.php | 24 +- ui/ui/hotspot-add.tpl | 2 +- ui/ui/hotspot-edit.tpl | 2 +- ui/ui/pppoe-add.tpl | 2 +- ui/ui/pppoe-edit.tpl | 2 +- ui/ui/routers-add.tpl | 2 +- ui/ui/routers-edit.tpl | 2 +- ui/ui/user-orderHotspot.tpl | 2 +- ui/ui/user-orderView.tpl | 89 +++++++ 12 files changed, 625 insertions(+), 33 deletions(-) create mode 100644 system/autoload/Recharge.php create mode 100644 ui/ui/user-orderView.tpl diff --git a/system/autoload/Paymentgateway.php b/system/autoload/Paymentgateway.php index 5236295c..4a6b231e 100644 --- a/system/autoload/Paymentgateway.php +++ b/system/autoload/Paymentgateway.php @@ -8,15 +8,15 @@ if($_app_stage = 'Live'){ $xendit_server = 'https://api.xendit.co/v2/'; $midtrans_server = 'https://api.midtrans.com'; - $moota_server = 'https://api.xendit.co/v2/'; + $tripay_server = 'https://tripay.co.id/api/transaction/create'; }else{ $xendit_server = 'https://api.xendit.co/v2/'; $midtrans_server = 'https://api.sandbox.midtrans.com'; - $moota_server = 'https://api.xendit.co/v2/'; + $tripay_server = 'https://tripay.co.id/api-sandbox/transaction/create'; } -function create_invoice_xendit($trxID, $amount, $phone, $description){ +function xendit_create_invoice($trxID, $amount, $phone, $description){ global $xendit_server,$_c; $json = [ 'external_id' => $trxID, @@ -31,12 +31,12 @@ function create_invoice_xendit($trxID, $amount, $phone, $description){ 'invoice_paid' => ['whatsapp','sms'], 'invoice_expired' => ['whatsapp','sms'] ], - 'success_redirect_url' => APP_URL, - 'failure_redirect_url' => APP_URL + 'payment_methods ' => explode(',',$_c['xendit_channel']), + 'success_redirect_url' => U.'order/view/'.$trxID, + 'failure_redirect_url' => U.'order/view/'.$trxID ]; - return json_decode(postJsonData($xendit_server, $json, [ - 'Authorization: Basic '.$_c['xendit_secret'] - ]),true); + + return json_decode(postJsonData($xendit_server.'invoices', $json, ['Authorization: Basic '.base64_encode($_c['xendit_secret_key'].':')]),true); /* { "id": "631597513897510bace2459d", #gateway_trx_id @@ -55,10 +55,10 @@ function create_invoice_xendit($trxID, $amount, $phone, $description){ */ } -function get_invoice_xendit($xendittrxID){ +function xendit_get_invoice($xendittrxID){ global $xendit_server,$_c; return json_decode(getData($xendit_server.'invoices/'.$xendittrxID, [ - 'Authorization: Basic '.$_c['xendit_secret'] + 'Authorization: Basic '.base64_encode($_c['xendit_secret_key'].':') ]),true); /* { diff --git a/system/autoload/Recharge.php b/system/autoload/Recharge.php new file mode 100644 index 00000000..c332c464 --- /dev/null +++ b/system/autoload/Recharge.php @@ -0,0 +1,374 @@ +where('id', $id_customer)->find_one(); + $p = ORM::for_table('tbl_plans')->where('id', $plan_id)->where('enabled', '1')->find_one(); + $b = ORM::for_table('tbl_user_recharges')->where('customer_id', $id_customer)->find_one(); + + $mikrotik = Router::_info($router_name); + if($p['validity_unit']=='Months'){ + $date_exp = date("Y-m-d", strtotime('+'.$p['validity'].' month')); + }else if($p['validity_unit']=='Days'){ + $date_exp = date("Y-m-d", strtotime('+'.$p['validity'].' day')); + }else if($p['validity_unit']=='Hrs'){ + $datetime = explode(' ',date("Y-m-d H:i:s", strtotime('+'.$p['validity'].' hour'))); + $date_exp = $datetime[0]; + $time = $datetime[1]; + }else if($p['validity_unit']=='Mins'){ + $datetime = explode(' ',date("Y-m-d H:i:s", strtotime('+'.$p['validity'].' minute'))); + $date_exp = $datetime[0]; + $time = $datetime[1]; + } + + if ($p['type'] == 'Hotspot') { + if ($b) { + if(!$_c['radius_mode']){ + try { + $iport = explode(":", $mikrotik['ip_address']); + $client = new RouterOS\Client($iport[0], $mikrotik['username'], $mikrotik['password'], ($iport[1]) ? $iport[1] : null); + } catch (Exception $e) { + die("Unable to connect to the router.
".$e->getMessage()); + } + + $printRequest = new RouterOS\Request( + '/ip hotspot user print .proplist=name', + RouterOS\Query::where('name', $c['username']) + ); + $userName = $client->sendSync($printRequest)->getProperty('name'); + $removeRequest = new RouterOS\Request('/ip/hotspot/user/remove'); + $client( + $removeRequest + ->setArgument('numbers', $userName) + ); + /* iBNuX Added: + * Time limit to Mikrotik + * 'Time_Limit', 'Data_Limit', 'Both_Limit' + */ + $addRequest = new RouterOS\Request('/ip/hotspot/user/add'); + if ($p['typebp'] == "Limited") { + if ($p['limit_type'] == "Time_Limit") { + if ($p['time_unit'] == 'Hrs') + $timelimit = $p['time_limit'] . ":00:00"; + else + $timelimit = "00:" . $p['time_limit'] . ":00"; + $client->sendSync( + $addRequest + ->setArgument('name', $c['username']) + ->setArgument('profile', $p['name_plan']) + ->setArgument('password', $c['password']) + ->setArgument('limit-uptime', $timelimit) + ); + } else if ($p['limit_type'] == "Data_Limit") { + if ($p['data_unit'] == 'GB') + $datalimit = $p['data_limit'] . "000000000"; + else + $datalimit = $p['data_limit'] . "000000"; + $client->sendSync( + $addRequest + ->setArgument('name', $c['username']) + ->setArgument('profile', $p['name_plan']) + ->setArgument('password', $c['password']) + ->setArgument('limit-bytes-total', $datalimit) + ); + } else if ($p['limit_type'] == "Both_Limit") { + if ($p['time_unit'] == 'Hrs') + $timelimit = $p['time_limit'] . ":00:00"; + else + $timelimit = "00:" . $p['time_limit'] . ":00"; + if ($p['data_unit'] == 'GB') + $datalimit = $p['data_limit'] . "000000000"; + else + $datalimit = $p['data_limit'] . "000000"; + $client->sendSync( + $addRequest + ->setArgument('name', $c['username']) + ->setArgument('profile', $p['name_plan']) + ->setArgument('password', $c['password']) + ->setArgument('limit-uptime', $timelimit) + ->setArgument('limit-bytes-total', $datalimit) + ); + } + } else { + $client->sendSync( + $addRequest + ->setArgument('name', $c['username']) + ->setArgument('profile', $p['name_plan']) + ->setArgument('password', $c['password']) + ); + } + } + + $b->customer_id = $id_customer; + $b->username = $c['username']; + $b->plan_id = $plan_id; + $b->namebp = $p['name_plan']; + $b->recharged_on = $date_only; + $b->expiration = $date_exp; + $b->time = $time; + $b->status = "on"; + $b->method = "admin"; + $b->routers = $router_name; + $b->type = "Hotspot"; + $b->save(); + + // insert table transactions + $t = ORM::for_table('tbl_transactions')->create(); + $t->invoice = "INV-" . _raid(5); + $t->username = $c['username']; + $t->plan_name = $p['name_plan']; + $t->price = $p['price']; + $t->recharged_on = $date_only; + $t->expiration = $date_exp; + $t->time = $time; + $t->method = "admin"; + $t->routers = $router_name; + $t->type = "Hotspot"; + $t->save(); + } else { + if(!$_c['radius_mode']){ + try { + $iport = explode(":", $mikrotik['ip_address']); + $client = new RouterOS\Client($iport[0], $mikrotik['username'], $mikrotik['password'], ($iport[1]) ? $iport[1] : null); + } catch (Exception $e) { + die("Unable to connect to the router.
".$e->getMessage()); + } + + /* iBNuX Added: + * Time limit to Mikrotik + * 'Time_Limit', 'Data_Limit', 'Both_Limit' + */ + $addRequest = new RouterOS\Request('/ip/hotspot/user/add'); + if ($p['typebp'] == "Limited") { + if ($p['limit_type'] == "Time_Limit") { + if ($p['time_unit'] == 'Hrs') + $timelimit = $p['time_limit'] . ":00:00"; + else + $timelimit = "00:" . $p['time_limit'] . ":00"; + $client->sendSync( + $addRequest + ->setArgument('name', $c['username']) + ->setArgument('profile', $p['name_plan']) + ->setArgument('password', $c['password']) + ->setArgument('limit-uptime', $timelimit) + ); + } else if ($p['limit_type'] == "Data_Limit") { + if ($p['data_unit'] == 'GB') + $datalimit = $p['data_limit'] . "000000000"; + else + $datalimit = $p['data_limit'] . "000000"; + $client->sendSync( + $addRequest + ->setArgument('name', $c['username']) + ->setArgument('profile', $p['name_plan']) + ->setArgument('password', $c['password']) + ->setArgument('limit-bytes-total', $datalimit) + ); + } else if ($p['limit_type'] == "Both_Limit") { + if ($p['time_unit'] == 'Hrs') + $timelimit = $p['time_limit'] . ":00:00"; + else + $timelimit = "00:" . $p['time_limit'] . ":00"; + if ($p['data_unit'] == 'GB') + $datalimit = $p['data_limit'] . "000000000"; + else + $datalimit = $p['data_limit'] . "000000"; + $client->sendSync( + $addRequest + ->setArgument('name', $c['username']) + ->setArgument('profile', $p['name_plan']) + ->setArgument('password', $c['password']) + ->setArgument('limit-uptime', $timelimit) + ->setArgument('limit-bytes-total', $datalimit) + ); + } + } else { + $client->sendSync( + $addRequest + ->setArgument('name', $c['username']) + ->setArgument('profile', $p['name_plan']) + ->setArgument('password', $c['password']) + ); + } + } + + $d = ORM::for_table('tbl_user_recharges')->create(); + $d->customer_id = $id_customer; + $d->username = $c['username']; + $d->plan_id = $plan_id; + $d->namebp = $p['name_plan']; + $d->recharged_on = $date_only; + $d->expiration = $date_exp; + $d->time = $time; + $d->status = "on"; + $d->method = "admin"; + $d->routers = $router_name; + $d->type = "Hotspot"; + $d->save(); + + // insert table transactions + $t = ORM::for_table('tbl_transactions')->create(); + $t->invoice = "INV-" . _raid(5); + $t->username = $c['username']; + $t->plan_name = $p['name_plan']; + $t->price = $p['price']; + $t->recharged_on = $date_only; + $t->expiration = $date_exp; + $t->time = $time; + $t->method = "admin"; + $t->routers = $router_name; + $t->type = "Hotspot"; + $t->save(); + } + sendTelegram( "#$c[username] #buy #Hotspot \n".$p['name_plan']. + "\nRouter: ".$router_name. + "\nGateway: ".$gateway. + "\nChannel: ".$channel. + "\nPrice: ".$p['price']); + } else { + + if ($b) { + if(!$_c['radius_mode']){ + try { + $iport = explode(":", $mikrotik['ip_address']); + $client = new RouterOS\Client($iport[0], $mikrotik['username'], $mikrotik['password'], ($iport[1]) ? $iport[1] : null); + } catch (Exception $e) { + die("Unable to connect to the router.
".$e->getMessage()); + } + $printRequest = new RouterOS\Request( + '/ppp secret print .proplist=name', + RouterOS\Query::where('name', $c['username']) + ); + $userName = $client->sendSync($printRequest)->getProperty('name'); + + $removeRequest = new RouterOS\Request('/ppp/secret/remove'); + $client( + $removeRequest + ->setArgument('numbers', $userName) + ); + + $addRequest = new RouterOS\Request('/ppp/secret/add'); + $client->sendSync( + $addRequest + ->setArgument('name', $c['username']) + ->setArgument('service', 'pppoe') + ->setArgument('profile', $p['name_plan']) + ->setArgument('password', $c['password']) + ); + } + + $b->customer_id = $id_customer; + $b->username = $c['username']; + $b->plan_id = $plan_id; + $b->namebp = $p['name_plan']; + $b->recharged_on = $date_only; + $b->expiration = $date_exp; + $b->time = $time; + $b->status = "on"; + $b->method = "admin"; + $b->routers = $router_name; + $b->type = "PPPOE"; + $b->save(); + + // insert table transactions + $t = ORM::for_table('tbl_transactions')->create(); + $t->invoice = "INV-" . _raid(5); + $t->username = $c['username']; + $t->plan_name = $p['name_plan']; + $t->price = $p['price']; + $t->recharged_on = $date_only; + $t->expiration = $date_exp; + $t->time = $time; + $t->method = "admin"; + $t->routers = $router_name; + $t->type = "PPPOE"; + $t->save(); + } else { + if(!$_c['radius_mode']){ + try { + $iport = explode(":", $mikrotik['ip_address']); + $client = new RouterOS\Client($iport[0], $mikrotik['username'], $mikrotik['password'], ($iport[1]) ? $iport[1] : null); + } catch (Exception $e) { + die("Unable to connect to the router.
".$e->getMessage()); + } + $addRequest = new RouterOS\Request('/ppp/secret/add'); + $client->sendSync( + $addRequest + ->setArgument('name', $c['username']) + ->setArgument('service', 'pppoe') + ->setArgument('profile', $p['name_plan']) + ->setArgument('password', $c['password']) + ); + } + + $d = ORM::for_table('tbl_user_recharges')->create(); + $d->customer_id = $id_customer; + $d->username = $c['username']; + $d->plan_id = $plan_id; + $d->namebp = $p['name_plan']; + $d->recharged_on = $date_only; + $d->expiration = $date_exp; + $d->time = $time; + $d->status = "on"; + $d->method = "admin"; + $d->routers = $router_name; + $d->type = "PPPOE"; + $d->save(); + + // insert table transactions + $t = ORM::for_table('tbl_transactions')->create(); + $t->invoice = "INV-" . _raid(5); + $t->username = $c['username']; + $t->plan_name = $p['name_plan']; + $t->price = $p['price']; + $t->recharged_on = $date_only; + $t->expiration = $date_exp; + $t->time = $time; + $t->method = "admin"; + $t->routers = $router_name; + $t->type = "PPPOE"; + $t->save(); + } + sendTelegram( "#$c[username] #buy #PPPOE \n".$p['name_plan']. + "\nRouter: ".$router_name. + "\nGateway: ".$gateway. + "\nChannel: ".$channel. + "\nPrice: ".$p['price']); + } + + $in = ORM::for_table('tbl_transactions')->where('username', $c['username'])->order_by_desc('id')->find_one(); + + sendWhatsapp($c['username'], "*$_c[CompanyName]*\n". + "$_c[address]\n". + "$_c[phone]\n". + "\n\n". + "INVOICE: *$in[invoice]*\n". + "$_L[Date] : $date_now\n". + "$_L[Sales] : $gateway $channel\n". + "\n\n". + "$_L[Type] : *$in[type]*\n". + "$_L[Plan_Name] : *$in[plan_name]*\n". + "$_L[Plan_Price] : *$_c[currency_code] ".number_format($in['price'],2,$_c['dec_point'],$_c['thousands_sep'])."*\n\n". + "$_L[Username] : *$in[username]*\n". + "$_L[Password] : **********\n\n". + "$_L[Created_On] :\n*".date($_c['date_format'], strtotime($in['recharged_on']))." $in[time]*\n". + "$_L[Expires_On] :\n*".date($_c['date_format'], strtotime($in['expiration']))." $in[time]*\n". + "\n\n". + "$_c[note]"); + return true; +} \ No newline at end of file diff --git a/system/controllers/order.php b/system/controllers/order.php index ae6cd587..1a069c19 100644 --- a/system/controllers/order.php +++ b/system/controllers/order.php @@ -1,39 +1,152 @@ assign('_system_menu', 'order'); $action = $routes['1']; $user = User::_info(); $ui->assign('_user', $user); -//Client Page -$bill = User::_billing(); -$ui->assign('_bill', $bill); +require('system/autoload/Paymentgateway.php'); +require('system/autoload/Recharge.php'); switch ($action) { case 'voucher': - $ui->assign('_title', $_L['Order_Voucher'].' - '. $config['CompanyName']); + $ui->assign('_title', $_L['Order_Voucher'] . ' - ' . $config['CompanyName']); $ui->display('user-order.tpl'); break; case 'ppoe': - $ui->assign('_title', 'Order PPOE Internet- '. $config['CompanyName']);$routers = ORM::for_table('tbl_routers')->find_many(); + $ui->assign('_title', 'Order PPOE Internet - ' . $config['CompanyName']); + $routers = ORM::for_table('tbl_routers')->find_many(); $plans = ORM::for_table('tbl_plans')->where('type', 'PPPOE')->where('enabled', '1')->find_many(); - $ui->assign('routers',$routers); + $ui->assign('routers', $routers); $ui->assign('plans', $plans); $ui->display('user-orderPPOE.tpl'); break; case 'hotspot': - $ui->assign('_title', 'Order Hotspot Internet- '. $config['CompanyName']); + $ui->assign('_title', 'Order Hotspot Internet - ' . $config['CompanyName']); $routers = ORM::for_table('tbl_routers')->find_many(); $plans = ORM::for_table('tbl_plans')->where('type', 'Hotspot')->where('enabled', '1')->find_many(); - $ui->assign('routers',$routers); + $ui->assign('routers', $routers); $ui->assign('plans', $plans); $ui->display('user-orderHotspot.tpl'); break; + case 'view': + $trxid = $routes['2'] * 1; + $trx = ORM::for_table('tbl_payment_gateway') + ->where('username', $user['username']) + ->find_one($trxid); + if ($routes['3'] == 'check') { + if ($trx['gateway'] == 'xendit') { + $result = xendit_get_invoice($trx['gateway_trx_id']); + if ($result['status'] == 'PENDING') { + r2(U . "order/view/" . $trxid, 'w', Lang::T("Transaction still unpaid.")); + } else if ($result['status'] == 'PAID' && $trx['status'] != 2) { + + if (!rechargeUser($user['id'], $trx['routers'], $trx['plan_id'], 'xendit', $result['payment_method'] . ' ' . $result['payment_channel'])) { + r2(U . "order/view/" . $trxid, 'd', Lang::T("Failed to activate your Package, try again later.")); + } + + $trx->pg_paid_response = json_encode($result); + $trx->payment_method = $result['payment_method']; + $trx->payment_channel = $result['payment_channel']; + $trx->paid_date = date('Y-m-d H:i:s', strtotime($result['updated'])); + $trx->status = 2; + $trx->save(); + + r2(U . "order/view/" . $trxid, 's', Lang::T("Transaction has been paid.")); + } else if ($result['status'] == 'EXPIRED') { + $trx->pg_paid_response = json_encode($result); + $trx->status = 3; + $trx->save(); + r2(U . "order/view/" . $trxid, 'd', Lang::T("Transaction expired.")); + }else if($trx['status'] == 2){ + r2(U . "order/view/" . $trxid, 'd', Lang::T("Transaction has been paid..")); + } + r2(U . "order/view/" . $trxid, 'd', Lang::T("Unknown Command.")); + } else if ($trx['gateway'] == 'midtrans') { + } else if ($trx['gateway'] == 'tripay') { + } + } else if ($routes['3'] == 'cancel') { + $trx->pg_paid_response = json_encode($result); + $trx->status = 4; + $trx->save(); + $trx = ORM::for_table('tbl_payment_gateway') + ->where('username', $user['username']) + ->find_one($trxid); + } + if (empty($trx)) { + r2(U . "home", 'e', Lang::T("Transaction Not found")); + } + $router = ORM::for_table('tbl_routers')->find_one($trx['routers_id']); + $plan = ORM::for_table('tbl_plans')->find_one($trx['plan_id']); + $bandw = ORM::for_table('tbl_bandwidth')->find_one($plan['id_bw']); + $ui->assign('trx', $trx); + $ui->assign('router', $router); + $ui->assign('plan', $plan); + $ui->assign('bandw', $bandw); + $ui->assign('_title', 'TRX #' . $trxid . ' - ' . $config['CompanyName']); + $ui->display('user-orderView.tpl'); + break; + case 'hotspot-buy': + if (empty($_c['xendit_secret_key'])) { + r2(U . "order/hotspot", 'e', Lang::T("Admin has not yet setup Xendit payment gateway, please tell admin")); + } + $router = ORM::for_table('tbl_routers')->where('enabled', '1')->find_one($routes['2'] * 1); + $plan = ORM::for_table('tbl_plans')->where('enabled', '1')->find_one($routes['3'] * 1); + if (empty($router) || empty($plan)) { + r2(U . "order/hotspot", 'e', Lang::T("Plan Not found")); + } + if ($_c['payment_gateway'] == 'xendit') { + $d = ORM::for_table('tbl_payment_gateway') + ->where('username', $user['username']) + ->where('status', 1) + ->find_one(); + if ($d) { + if ($d['pg_url_payment']) { + r2(U . "order/view/" . $d['id'], 'w', Lang::T("You already have unpaid transaction, cancel it or pay it.")); + } + $id = $d['id']; + } else { + $d = ORM::for_table('tbl_payment_gateway')->create(); + $d->username = $user['username']; + $d->gateway = 'xendit'; + $d->plan_id = $plan['id']; + $d->plan_name = $plan['name_plan']; + $d->routers_id = $router['id']; + $d->routers = $router['name']; + $d->price = $plan['price']; + $d->created_date = date('Y-m-d H:i:s'); + $d->status = 1; + $d->save(); + $id = $d->id(); + } + if ($id) { + $result = xendit_create_invoice($id, $plan['price'], $user['username'], $plan['name_plan']); + if (!$result['id']) { + r2(U . "order/hotspot", 'e', Lang::T("Failed to create transaction.")); + } + $d = ORM::for_table('tbl_payment_gateway') + ->where('username', $user['username']) + ->where('status', 1) + ->find_one(); + $d->gateway_trx_id = $result['id']; + $d->pg_url_payment = $result['invoice_url']; + $d->pg_request = json_encode($result); + $d->expired_date = date('Y-m-d H:i:s', strtotime($result['expiry_date'])); + $d->save(); + header('Location: ' . $result['invoice_url']); + exit(); + } else { + r2(U . "order/view/" . $d['id'], 'w', Lang::T("Failed to create Transaction..")); + } + } else if ($_c['payment_gateway'] == 'midtrans') { + } else if ($_c['payment_gateway'] == 'tripay') { + } + break; default: $ui->display('404.tpl'); -} - +} \ No newline at end of file diff --git a/system/lan/indonesia/common.lan.php b/system/lan/indonesia/common.lan.php index 4c4b7e68..85f02afd 100644 --- a/system/lan/indonesia/common.lan.php +++ b/system/lan/indonesia/common.lan.php @@ -252,7 +252,23 @@ $_L['Cannot_be_change_after_saved'] = 'Cannot be change after saved'; $_L['Explain_Coverage_of_router'] = 'Jelaskan Cakupan wilayah hotspot'; $_L['Name_of_Area_that_router_operated'] = 'Nama Lokasi/Wilayah Router beroperasi'; -$_L['Payment_Notification_URL_Recurring_Notification_URL_Pay_Account_Notification_URL'] = 'Payment Notification URL, Recurring Notification URL, Pay Account Notification URL'; -$_L['Finish_Redirect_URL_Unfinish_Redirect_URL_Error_Redirect_URL'] = 'Finish Redirect URL, Unfinish Redirect URL, Error Redirect URL'; -$_L['Status'] = 'Status'; -$_L['Status'] = 'Status'; +$_L['Payment_Notification_URL_Recurring_Notification_URL_Pay_Account_Notification_URL'] = 'Payment Notification URL, Recurring Notification URL, Pay Account Notification URL'; +$_L['Finish_Redirect_URL_Unfinish_Redirect_URL_Error_Redirect_URL'] = 'Finish Redirect URL, Unfinish Redirect URL, Error Redirect URL'; +$_L['Status'] = 'Status'; +$_L['Plan_Not_found'] = 'Plan Not found'; +$_L['Failed_to_create_transaction'] = 'Failed to create transaction.'; +$_L['Seller_has_not_yet_setup_Xendit_payment_gateway'] = 'Seller has not yet setup Xendit payment gateway'; +$_L['Admin_has_not_yet_setup_Xendit_payment_gateway_please_tell_admin'] = 'Admin has not yet setup Xendit payment gateway, please tell admin'; +$_L['Buy_this_your_active_package_will_be_overwrite'] = 'Buy this? your active package will be overwrite'; +$_L['Buy_this_your_active_package_will_be_overwrite'] = 'Buy this? your active package will be overwrite'; +$_L['You_already_have_unpaid_transaction_cancel_it_or_pay_it'] = 'You already have unpaid transaction, cancel it or pay it.'; +$_L['Transaction_Not_found'] = 'Transaction Not found'; +$_L['PAY_NOW'] = 'PAY NOW'; +$_L['Cancel_it'] = 'Cancel it?'; +$_L['UNPAID'] = 'UNPAID'; +$_L['expired'] = 'expired'; +$_L['Check_for_Payment'] = 'Check for Payment'; +$_L['Transaction_still_unpaid'] = 'Transaction still unpaid.'; +$_L['Paid_Date'] = 'Paid Date'; +$_L['Transaction_has_been_paid'] = 'Transaction has been paid.'; +$_L['PAID'] = 'PAID'; diff --git a/ui/ui/hotspot-add.tpl b/ui/ui/hotspot-add.tpl index de8d0096..3a363fe9 100644 --- a/ui/ui/hotspot-add.tpl +++ b/ui/ui/hotspot-add.tpl @@ -20,7 +20,7 @@
- +

{Lang::T('Cannot be change after saved')}

diff --git a/ui/ui/hotspot-edit.tpl b/ui/ui/hotspot-edit.tpl index 95b7407c..ddd6b18e 100644 --- a/ui/ui/hotspot-edit.tpl +++ b/ui/ui/hotspot-edit.tpl @@ -21,7 +21,7 @@
- +
diff --git a/ui/ui/pppoe-add.tpl b/ui/ui/pppoe-add.tpl index 70046ac9..9cd57e37 100644 --- a/ui/ui/pppoe-add.tpl +++ b/ui/ui/pppoe-add.tpl @@ -20,7 +20,7 @@
- +
diff --git a/ui/ui/pppoe-edit.tpl b/ui/ui/pppoe-edit.tpl index a5e71948..3ad69f9d 100644 --- a/ui/ui/pppoe-edit.tpl +++ b/ui/ui/pppoe-edit.tpl @@ -21,7 +21,7 @@
- +
diff --git a/ui/ui/routers-add.tpl b/ui/ui/routers-add.tpl index 70c3a71f..a97a7a8c 100644 --- a/ui/ui/routers-add.tpl +++ b/ui/ui/routers-add.tpl @@ -21,7 +21,7 @@
- +

{Lang::T('Name of Area that router operated')}

diff --git a/ui/ui/routers-edit.tpl b/ui/ui/routers-edit.tpl index a78ac2b1..16405e77 100644 --- a/ui/ui/routers-edit.tpl +++ b/ui/ui/routers-edit.tpl @@ -21,7 +21,7 @@
- +

{Lang::T('Name of Area that router operated')}

diff --git a/ui/ui/user-orderHotspot.tpl b/ui/ui/user-orderHotspot.tpl index 3be9c4f4..8b5d6727 100644 --- a/ui/ui/user-orderHotspot.tpl +++ b/ui/ui/user-orderHotspot.tpl @@ -34,7 +34,7 @@
diff --git a/ui/ui/user-orderView.tpl b/ui/ui/user-orderView.tpl new file mode 100644 index 00000000..14a463de --- /dev/null +++ b/ui/ui/user-orderView.tpl @@ -0,0 +1,89 @@ +{include file="sections/user-header.tpl"} +
+
+
+
+ +
+
+
{$router['name']}
+
+ {$router['description']} +
+
+
+
+ + + + + + + + + + + {if $trx['status']==2} + + + + + {/if} + + + + + + + + + + + + + {if $plan['type'] eq 'Hotspot'} + + + + + {if $plan['typebp'] eq 'Limited'} + {if $plan['limit_type'] eq 'Time_Limit' or $plan['limit_type'] eq 'Both_Limit'} + + + + + {/if} + {if $plan['limit_type'] eq 'Data_Limit' or $plan['limit_type'] eq 'Both_Limit'} + + + + + {/if} + {/if} + {/if} + + + + + + + + + +
{Lang::T('Status')}{if $trx['status']==1}{Lang::T('UNPAID')}{elseif $trx['status']==2}{Lang::T('PAID')}{elseif $trx['status']==3}{Lang::T('FAILED')}{elseif $trx['status']==4}{Lang::T('CANCELED')}{else}{Lang::T('UNKNOWN')}{/if}
{Lang::T('expired')}{date($_c['date_format'], strtotime($trx['expired_date']))} {date('H:i', strtotime($trx['expired_date']))}
{Lang::T('Paid Date')}{date($_c['date_format'], strtotime($trx['paid_date']))} {date('H:i', strtotime($trx['paid_date']))}
{$_L['Plan_Name']}{$plan['name_plan']}
{$_L['Plan_Price']}{$plan['price']}
{Lang::T('Type')}{$plan['type']}
{Lang::T('Plan_Type')}{Lang::T($plan['typebp'])}
{Lang::T('Time_Limit')}{$ds['time_limit']} {$ds['time_unit']}
{Lang::T('Data_Limit')}{$ds['data_limit']} {$ds['data_unit']}
{$_L['Plan_Validity']}{$plan['validity']} {$plan['validity_unit']}
{$_L['Bandwidth_Plans']}{$bandw['name_bw']}
{$bandw['rate_down']}{$bandw['rate_down_unit']}/{$bandw['rate_up']}{$bandw['rate_up_unit']}
+
+ {if $trx['status']==1} + + + {/if} +
+
+
+{include file="sections/user-footer.tpl"}