Merge pull request #12 from hotspotbilling/Development

Fixing some code to be able integrate with paypal payment gateway
This commit is contained in:
iBNu Maksum 2022-12-14 15:33:01 +07:00 committed by GitHub
commit 50e55744ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 79 additions and 18 deletions

View file

@ -89,4 +89,5 @@ a.n Ibnu Maksum
## SPONSORS
none :(
- [mlink.id](https://mlink.id)
- [https://github.com/sonyinside](https://github.com/sonyinside)

View file

@ -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;
}
}

View file

@ -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"));
}

View file

@ -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.';

View file

@ -73,6 +73,7 @@
value="{$_c['telegram_target_id']}" placeholder="12345678">
</div>
</div>
<small id="emailHelp" class="form-text text-muted">You will get Payment and Error notification</small>
</div>
<div class="panel-heading">SMS OTP Registration</div>
<div class="panel-body">
@ -85,6 +86,7 @@
</p>
</div>
</div>
<small id="emailHelp" class="form-text text-muted">You can use WhatsApp in here too. <a href="https://wa.nux.my.id/login" target="_blank">Free Server</a></small>
</div>
<div class="panel-heading">Whatsapp Notification</div>
<div class="panel-body">

View file

@ -3,7 +3,9 @@
<div class="row">
<div class="col-sm-6">
<div class="box box-hovered mb20 box-primary">
<div class="box-header"><h3 class="box-title">Discussions</h3></div>
<div class="box-header">
<h3 class="box-title">Discussions</h3>
</div>
<div class="box-body">Get help from community</div>
<div class="box-footer">
<a href="https://github.com/hotspotbilling/phpnuxbill/discussions" target="_blank"
@ -13,7 +15,9 @@
</div>
<div class="col-sm-6">
<div class="box box-hovered mb20 box-primary">
<div class="box-header"><h3 class="box-title">Feedback</h3></div>
<div class="box-header">
<h3 class="box-title">Feedback</h3>
</div>
<div class="box-body">
Feedback and Bug Report
</div>
@ -28,7 +32,9 @@
<div class="row">
<div class="col-sm-6">
<div class="box box-hovered mb20 box-primary">
<div class="box-header"><h3 class="box-title">Donasi</h3></div>
<div class="box-header">
<h3 class="box-title">Donasi</h3>
</div>
<div class="box-body">Untuk pengembangan lebih baik, donasi ke iBNuX, donasi akan membantu terus
pengembangan aplikasi</div>
<div class="table-responsive">
@ -59,7 +65,9 @@
</div>
<div class="col-sm-6">
<div class="box box-hovered mb20 box-primary">
<div class="box-header"><h3 class="box-title">Donations</h3></div>
<div class="box-header">
<h3 class="box-title">Donations</h3>
</div>
<div class="box-body">
Donations will help to continue phpnuxbill development
</div>
@ -94,7 +102,9 @@
<div class="row">
<div class="col-sm-6">
<div class="box box-hovered mb20 box-primary">
<div class="box-header"><h3 class="box-title">Chat with me</h3></div>
<div class="box-header">
<h3 class="box-title">Chat with me</h3>
</div>
<div class="box-body">Paid Support?<br>donation confirmation?<br>Or ask any Donation Alternative</div>
<div class="box-footer">
<a href="https://t.me/ibnux" target="_blank" class="btn btn-primary btn-lg btn-block">Telegram</a>
@ -108,26 +118,43 @@
</div>
<div class="col-sm-6">
<div class="box box-primary box-hovered mb20 activities">
<div class="box-header"><h3 class="box-title">PHPNUXBILL</h3></div>
<div class="box-header">
<h3 class="box-title">PHPNUXBILL</h3>
</div>
<div class="box-body">
{$_L['Welcome_Text_Admin']}
</div>
<div class="box-footer" id="currentVersion">ver</div>
<div class="box-footer" id="latestVersion">ver</div>
<div class="box-footer">
<a href="https://github.com/hotspotbilling/phpnuxbill/releases" target="_blank" class="btn btn-primary btn-lg btn-block">Get Latest Version</a>
<a href="https://github.com/hotspotbilling/phpnuxbill/releases" target="_blank"
class="btn btn-primary btn-lg btn-block">Get Latest Version</a>
</div>
</div>
<div class="box box-primary box-hovered mb20 activities">
<div class="box-header">
<h3 class="box-title">Free WhatsApp Gateway and Telegram Bot creater</h3>
</div>
<div class="box-body">
There is a Telegram bot wizard in here
</div>
<div class="box-footer">
<a href="https://wa.nux.my.id/login" target="_blank"
class="btn btn-primary btn-lg btn-block">wa.nux.my.id</a>
</div>
</div>
</div>
</div>
<script>
window.addEventListener('DOMContentLoaded', function() {
$.getJSON( "./version.json?"+Math.random(), function( data ) {
$('#currentVersion').html('Current Version: '+data.version);
});
$.getJSON( "https://raw.githubusercontent.com/hotspotbilling/phpnuxbill/master/version.json?"+Math.random(), function( data ) {
$('#latestVersion').html('Latest Version: '+data.version);
$.getJSON("./version.json?" + Math.random(), function(data) {
$('#currentVersion').html('Current Version: ' + data.version);
});
$.getJSON("https://raw.githubusercontent.com/hotspotbilling/phpnuxbill/master/version.json?" + Math
.random(),
function(data) {
$('#latestVersion').html('Latest Version: ' + data.version);
});
});
</script>
{include file="sections/footer.tpl"}

View file

@ -32,7 +32,7 @@
<div class="col-md-4">
<div class="panel panel-info">
<div class="panel-heading">{$_L['Registration_Info']}</div>
<div class="panel-body" style="max-height:375px;overflow:scroll;">
<div class="panel-body">
{include file="$_path/../pages/Registration_Info.html"}
</div>
</div>

View file

@ -46,7 +46,7 @@
<div class="col-md-4">
<div class="panel panel-primary">
<div class="panel-heading">{$_L['Registration_Info']}</div>
<div class="panel-body" style="height:375px;max-height:375px;overflow:scroll;">
<div class="panel-body">
{include file="$_path/../pages/Registration_Info.html"}
</div>
</div>

View file

@ -32,7 +32,7 @@
<div class="col-md-4">
<div class="panel panel-primary">
<div class="panel-heading">{$_L['Registration_Info']}</div>
<div class="panel-body" style="height:375px;max-height:375px;overflow:scroll;">
<div class="panel-body">
{include file="$_path/../pages/Registration_Info.html"}
</div>
</div>

View file

@ -31,7 +31,7 @@
<div class="col-md-4 col-md-offset-2">
<div class="panel panel-info">
<div class="panel-heading">{$_L['Announcement']}</div>
<div class="panel-body" style="max-height:296px;overflow:scroll;">
<div class="panel-body">
{include file="$_path/../pages/Announcement.html"}
</div>
</div>

View file

@ -1,3 +1,3 @@
{
"version": "6.1.2"
"version": "2022.12.14"
}