57 lines
1.5 KiB
PHP
57 lines
1.5 KiB
PHP
<?php
|
|
|
|
defined('BASEPATH') OR exit('No direct script access allowed');
|
|
/*
|
|
* handlethe return for money top up from flutrerwave here
|
|
*/
|
|
class Fltw extends WRB_Controller {
|
|
|
|
function __construct()
|
|
{
|
|
parent::__construct();
|
|
|
|
//Load URL helper
|
|
$this->load->helper('url');
|
|
|
|
//Load session library
|
|
$this->load->library('session');
|
|
}
|
|
|
|
//Displays social login links
|
|
public function index() {
|
|
|
|
}
|
|
|
|
public function complete() {
|
|
$in= [];
|
|
// //https://oameye.work.wrenchboard.com/dash?status=successful&tx_ref=wrench-1161918567&transaction_id=3631794
|
|
|
|
$in['tx_ref'] = $this->input->get('tx_ref');
|
|
$in['transaction_id'] = $this->input->get('transaction_id');
|
|
$in['return_status'] = $this->input->get('status'); // this cabe back as string, I need INT
|
|
|
|
if ( $in['tx_ref'] !='' && $in['transaction_id'] !='' && $in['return_status']!='' ){
|
|
switch ($in['return_status']){
|
|
case 'successful':
|
|
$in['status'] = 5;
|
|
break;
|
|
default:
|
|
$in['status'] = 0;
|
|
break;
|
|
}
|
|
|
|
$in['action'] = WRENCHBOARD_ACCOUNT_COMPLETE_TOPUP;
|
|
$this->load->model('backend_model');
|
|
$out = array();
|
|
$res = $this->backend_model->wrenchboard_api($in, $out);
|
|
if ($res > 0) {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
redirect('/dash', 'refresh');
|
|
}
|
|
|
|
}
|