data save
This commit is contained in:
@@ -10,18 +10,12 @@ use Firebase\JWT\JWT;
|
||||
class DigiFiBVN extends BaseController
|
||||
{
|
||||
use ResponseTrait;
|
||||
protected $db;
|
||||
public $con_name = 'digifi_db'; // 'wrench_blog';
|
||||
// protected $db;
|
||||
|
||||
var $request;
|
||||
|
||||
function __construct()
|
||||
{
|
||||
try {
|
||||
$this->db = \Config\Database::connect($this->con_name);
|
||||
} catch (Exception $e) {
|
||||
echo 'Caught Data Connect Exception ::: ', $e->getMessage(), "\n";
|
||||
}
|
||||
|
||||
$this->request = \Config\Services::request();
|
||||
}
|
||||
|
||||
@@ -73,14 +67,21 @@ class DigiFiBVN extends BaseController
|
||||
$data = $this->request->getPost();
|
||||
|
||||
if ($data['bvn'] != '') {
|
||||
$addedData = $this->insert_db('bvn_checks',$data);
|
||||
|
||||
$sqL = "INSERT INTO bvn_checks(bvn) VALUES('".$data['bvn']."')";
|
||||
$query = $this->db->query($sqL);
|
||||
if( $addedData["uid"] ==''){
|
||||
$response = [
|
||||
'message' => 'Failure',
|
||||
'call_return' => '100',
|
||||
'token' => ''
|
||||
];
|
||||
return $this->fail($response, 500);
|
||||
}
|
||||
|
||||
$response = [
|
||||
'message' => 'Verification text sent to user',
|
||||
'call_return' => '100',
|
||||
'verification_id' => 'e99c9c7555c97807b86b750cfe6323d15b2b09e561022205dc679534825f2acf'
|
||||
'verification_id' => $addedData["uid"],
|
||||
];
|
||||
|
||||
return $this->respond($response, 200);
|
||||
|
||||
Reference in New Issue
Block a user