diff --git a/README.md b/README.md index f59b003b..5b66ca2b 100644 --- a/README.md +++ b/README.md @@ -89,4 +89,5 @@ a.n Ibnu Maksum ## SPONSORS -none :( +- [mlink.id](https://mlink.id) +- [https://github.com/sonyinside](https://github.com/sonyinside) diff --git a/system/autoload/Http.php b/system/autoload/Http.php index 0fd4da2b..e4b1982e 100644 --- a/system/autoload/Http.php +++ b/system/autoload/Http.php @@ -40,4 +40,26 @@ class Http curl_close($ch); return $server_output; } + + + public static function postData($url, $array_post, $headers = [], $basic = null) + { + $headers[] = 'Content-Type: application/x-www-form-urlencoded'; + $ch = curl_init(); + curl_setopt($ch, CURLOPT_URL, $url); + curl_setopt($ch, CURLOPT_POST, 1); + curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15); + curl_setopt($ch, CURLOPT_TIMEOUT, 15); + curl_setopt($ch, CURLOPT_VERBOSE, false); + curl_setopt($ch, CURLINFO_HEADER_OUT, false); + curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($array_post)); + curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); + if (!empty($basic)) { + curl_setopt($ch, CURLOPT_USERPWD, $basic); + } + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + $server_output = curl_exec($ch); + curl_close($ch); + return $server_output; + } } diff --git a/system/controllers/order.php b/system/controllers/order.php index db4b5679..3cc1622c 100644 --- a/system/controllers/order.php +++ b/system/controllers/order.php @@ -19,6 +19,7 @@ switch ($action) { $ui->assign('_system_menu', 'history'); $d = ORM::for_table('tbl_payment_gateway') ->where('username', $user['username']) + ->order_by_desc('id') ->find_many(); $paginator = Paginator::bootstrap('tbl_payment_gateway', 'username', $user['username']); $ui->assign('paginator', $paginator); @@ -28,6 +29,9 @@ switch ($action) { $ui->display('user-orderHistory.tpl'); break; case 'package': + if(empty($user['email'])){ + r2(U . 'accounts/profile', 'e', Lang::T("Please enter your email address")); + } $ui->assign('_title', 'Order Plan'); $ui->assign('_system_menu', 'package'); $routers = ORM::for_table('tbl_routers')->find_many(); @@ -102,6 +106,9 @@ switch ($action) { $ui->display('user-orderView.tpl'); break; case 'buy': + if(empty($user['email'])){ + 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")); } diff --git a/system/lan/indonesia/common.lan.php b/system/lan/indonesia/common.lan.php index a3710afb..fe3ad38f 100644 --- a/system/lan/indonesia/common.lan.php +++ b/system/lan/indonesia/common.lan.php @@ -304,3 +304,5 @@ $_L['Will_show_below_user_pages'] = 'Will show below user pages'; $_L['Request_OTP'] = 'Request OTP'; $_L['Verification_Code'] = 'Verification Code'; $_L['SMS_Verification_Code'] = 'SMS Verification Code'; +$_L['Please_enter_your_email_address'] = 'Please enter your email address'; +$_L['Failed_to_create_Paypal_transaction'] = 'Failed to create Paypal transaction.'; diff --git a/ui/ui/app-settings.tpl b/ui/ui/app-settings.tpl index de141b9a..c7539244 100644 --- a/ui/ui/app-settings.tpl +++ b/ui/ui/app-settings.tpl @@ -73,6 +73,7 @@ value="{$_c['telegram_target_id']}" placeholder="12345678"> + You will get Payment and Error notification