This commit is contained in:
2022-08-06 22:23:51 -04:00
parent 1168903d26
commit 1600fd4815
3 changed files with 46 additions and 6 deletions
+14
View File
@@ -637,6 +637,20 @@ class Member extends Users_Controller {
$data = $this->getSessionArray();
$data['amount'] = $this->input->post('amount')+0;
//https://oameye.work.wrenchboard.com/dash?status=successful&tx_ref=wrench-1161918567&transaction_id=3631794
$data['tx_ref'] = 'wrench-'.rand(1000000000,9999999999);
$data['currency'] = "NGN";
$data['customer_email'] = $_SESSION['username'];
$data['customer_phone_number'] = '';
$data['customer_name'] = $_SESSION['firstname'].' '.$_SESSION['lastname'];
$data['consumer_id'] = $_SESSION['member_id'];
$data['consumer_mac'] = $_SESSION['member_id']."-912ba-1192a";
$data['redirect_url'] = "https://oameye.work.wrenchboard.com/dash";
$this->load->library('table');
$this->table->set_template($this->template);
+1 -1
View File
@@ -26,7 +26,7 @@
<!--end::Label-->
<!--begin::Col-->
<div class="col-lg-8 fv-row">
<input type="text" name="company" class="form-control form-control-lg form-control-solid" placeholder="Company name" value="0" />
<input type="text" name="amount" style="text-align:right;" class="form-control form-control-lg form-control-solid" placeholder="Amount" value="0" />
</div>
<!--end::Col-->
</div>
@@ -16,7 +16,6 @@
<!--begin::Content-->
<div id="kt_account_settings_profile_details" class="collapse show">
<!--begin::Form-->
<form id="start_top_up" action="/member/starttopup" class="form" method="post">
<!--begin::Card body-->
<div class="card-body border-top p-9">
<div class="row mb-6">
@@ -25,7 +24,7 @@
<!--end::Label-->
<!--begin::Col-->
<div class="col-lg-8 fv-row">
<input type="text" name="company" class="form-control form-control-lg form-control-solid" placeholder="Company name" value="0" />
<input type="text" readonly style="text-align:right;" class="form-control form-control-lg form-control-solid" value="<?=$amount?>" />
</div>
<!--end::Col-->
</div>
@@ -33,10 +32,9 @@
<!--end::Card body-->
<!--begin::Actions-->
<div class="card-footer d-flex justify-content-end py-6 px-9">
<button type="submit" class="btn btn-sx btn-primary" id="kt_account_profile_details_submit">Continue</button>
<button type="submit" class="btn btn-sx btn-primary" onclick="makePayment()" id="make_payment">Make Payment</button>
</div>
<!--end::Actions-->
</form>
<!--end::Form-->
</div>
<!--end::Content-->
@@ -125,6 +123,34 @@
</div>
</div>
<script src="https://checkout.flutterwave.com/v3.js"></script>
<script type="text/javascript">
<!--
function makePayment() {
FlutterwaveCheckout({
public_key: "FLWPUBK_TEST-54c90141b028789d671067bd72f781a9-X",
tx_ref: "<?=$tx_ref?>",
amount: <?=$amount?>,
currency: "<?=$currency?>",
payment_options: "card, banktransfer, ussd",
redirect_url: "<?=$redirect_url?>",
meta: {
consumer_id: <?=$consumer_id?>,
consumer_mac: "<?=$consumer_mac?>",
},
customer: {
email: "<?=$customer_email?>",
phone_number: "<?=$customer_phone_number?>",
name: "<?=$customer_name?>",
},
customizations: {
title: "WrenchBoard Topup",
description: "WrebchBoard Account Topup Payment",
logo: " https://dashboard.wrenchboard.com/assets/ext/images/wrenchboard.png",
},
});
}
// -->
</script>