From 4df27da465c19530c1f78ca2ce5586fff1b8e625 Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Wed, 17 Jul 2024 11:00:41 -0400 Subject: [PATCH] fix verifications --- app/Controllers/DigiFiBVN.php | 51 +++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/app/Controllers/DigiFiBVN.php b/app/Controllers/DigiFiBVN.php index 4d110c9..99bc900 100644 --- a/app/Controllers/DigiFiBVN.php +++ b/app/Controllers/DigiFiBVN.php @@ -54,6 +54,13 @@ class DigiFiBVN extends BaseController 'firstname' =>'firstname-'.rand(1,1000), 'lastname' => 'lastname-'.rand(1,1000) ]; + + $udata = [ + 'bvn' => $data['bvn'], + 'firstname' => $results["firstname"], + 'lastname' => $results["lastname"], + ]; + $customer = $this->insert_db('customers',$udata); } } @@ -123,6 +130,50 @@ class DigiFiBVN extends BaseController return $this->fail($response, 500); } + /* + *| Type | Collation | Nullable | Default +-------------+-----------------------------+-----------+----------+---------------------------------------- + id | integer | | not null | nextval('bvn_checks_id_seq'::regclass) + uid | uuid | | | uuid_generate_v4() + bvn | character varying(15) | | not null | + status | integer | | | 1 + added | timestamp without time zone | | | now() + updated | timestamp without time zone | | | now() + firstname | character varying(35) | | | + lastname | character varying(35) | | | + middlename | character varying(35) | | | + gender | character varying(5) | | | + birthdate | timestamp without time zone | | | + phone | character varying(35) | | | + nationality | character varying(15) | | | +Indexes: + "bvn_checks_id_key" UNIQUE CONSTRAINT, btree (id) + + "bvn": "10000000001", + "firstname": "John", + "lastname": "Doe", + "middlename": "Favor", + "phone": "080000000001", + "birthdate": "1944-04-04", + "gender": "m", + "nationality": "Nigerian", + + */ + $bvn = $data['bvn']; + + $firstname = $bvnData["res"]["data"]["firstname"]; + $lastname = $bvnData["res"]["data"]["lastname"]; + $middlename = $bvnData["res"]["data"]["middlename"]; + $phone = $bvnData["res"]["data"]["phone"]; + $birthdate = $bvnData["res"]["data"]["birthdate"]; + $gender = $bvnData["res"]["data"]["gender"]; + $nationality = $bvnData["res"]["data"]["nationality"]; + + + + $sqlUpdate = "UPDATE bvn_checks SET firstname ='$firstname', lastname='$lastname', middlename='$middlename' , phone='$phone' , birthdate='$birthdate' , gender='$gender' , nationality='$nationality' WHERE bvn = '$bvn' "; + $query = $this->db->query($sqlUpdate); + $response = [ 'message' => 'Verification text sent to user', 'call_return' => '100',