diff --git a/application/controllers/Webservices.php b/application/controllers/Webservices.php index 0ee5805..d463476 100644 --- a/application/controllers/Webservices.php +++ b/application/controllers/Webservices.php @@ -2420,6 +2420,9 @@ $this->fail('','','1'); } $mechData = $this->Webservice_model->getMechAmount($transId); + if(empty($mechData)){ + $this->fail('','','1'); + } $amount = $mechData['data']['amount'] * 100; $callback = base_url().'Webservices/verify_payment_api/'.$transId.'/1'; $postdata = array('email' => $mechData['emailId'], @@ -2465,6 +2468,10 @@ if ($request) { $result = json_decode($request, true); } + if(empty($result) || !isset($result['data']) || + !isset($result['data']['authorization_url']) || empty($result['data']['authorization_url'])){ + $this->fail('','','1'); + } $redir = $result['data']['authorization_url']; redirect($redir); } diff --git a/application/models/Webservice_mechanic_model.php b/application/models/Webservice_mechanic_model.php index 8ea03da..e64dd2c 100644 --- a/application/models/Webservice_mechanic_model.php +++ b/application/models/Webservice_mechanic_model.php @@ -7,7 +7,7 @@ /***************************************************************************************/ /****************************************Mobile API's***********************************/ function checkMechanicLogin($userLogData){ - $respArr = array('status'=>'error'); + $respArr = array('status'=>'error'); if(empty($userLogData)){ return $respArr; } @@ -184,6 +184,5 @@ public function start_service($postData = array(),$type = 0){ } return $respArr; } - } ?> diff --git a/application/models/Webservice_model.php b/application/models/Webservice_model.php index f37ac26..9130deb 100644 --- a/application/models/Webservice_model.php +++ b/application/models/Webservice_model.php @@ -638,12 +638,16 @@ class Webservice_model extends CI_Model { return $respArr; } $result = $this->db->get_where('transaction',array('id'=>$transId)); - if(!empty($result) && $result->num_rows() > 0){ - $result = $result->row_array(); - $respArr['status'] = 'success'; - $respArr['data'] = $result; + if(empty($result) || $result->num_rows() <= 0){ + return; } + $result = $result->row_array(); + $respArr['status'] = 'success'; + $respArr['data'] = $result; $custData = $this->db->get_where('customers',array('customer_id'=>$result['customer_id']))->row(); + if(empty($custData)){ + return; + } $respArr['emailId'] = $custData->email; return $respArr; } @@ -1494,6 +1498,7 @@ class Webservice_model extends CI_Model { $respArr['status'] = "success"; $respArr['message'] = "Vehicle Deleted Successfully"; } + return $respArr; } }