CHANGE_RV
This commit is contained in:
parent
ef4271b1c7
commit
0971a687c9
@ -1826,7 +1826,7 @@ class EmployeeRestController extends AdminController
|
|||||||
|
|
||||||
log_message('error', 'STEP 12: Calling post enrollment API with params: ' . json_encode($queryParams));
|
log_message('error', 'STEP 12: Calling post enrollment API with params: ' . json_encode($queryParams));
|
||||||
|
|
||||||
return $restAuthController->callThirdPartyGETAPI($queryParams, 'getClientDetails');
|
return $restAuthController->callThirdPartyGETAPI($queryParams, 'getClientDetails', ['token' => $jwt]);
|
||||||
} else {
|
} else {
|
||||||
log_message('error', 'STEP 13: Unknown token_type: ' . $token_type);
|
log_message('error', 'STEP 13: Unknown token_type: ' . $token_type);
|
||||||
return $this->respond(['status' => 'failed', 'code' => 404, 'data' => []], 404);
|
return $this->respond(['status' => 'failed', 'code' => 404, 'data' => []], 404);
|
||||||
|
|||||||
@ -74,15 +74,37 @@ class RestAuthenticationController extends AdminController
|
|||||||
return $response->getBody();
|
return $response->getBody();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function callThirdPartyGETAPI($queryParams, $endPoint)
|
// public function callThirdPartyGETAPI($queryParams, $endPoint)
|
||||||
|
// {
|
||||||
|
// $client = \Config\Services::curlrequest();
|
||||||
|
// $url = env('POST_ENROLLMENT_BASEURL') . $endPoint;
|
||||||
|
|
||||||
|
// $response = $client->get($url, [
|
||||||
|
// 'query' => $queryParams, // pass as query parameters
|
||||||
|
// 'http_errors' => false // prevent exception on non-200 status
|
||||||
|
// ]);
|
||||||
|
|
||||||
|
// return $response->getBody();
|
||||||
|
// }
|
||||||
|
|
||||||
|
public function callThirdPartyGETAPI($queryParams, $endPoint, $params = [])
|
||||||
{
|
{
|
||||||
$client = \Config\Services::curlrequest();
|
$client = \Config\Services::curlrequest();
|
||||||
$url = env('POST_ENROLLMENT_BASEURL') . $endPoint;
|
$url = env('POST_ENROLLMENT_BASEURL') . $endPoint;
|
||||||
|
|
||||||
$response = $client->get($url, [
|
$options = [
|
||||||
'query' => $queryParams, // pass as query parameters
|
'query' => $queryParams,
|
||||||
'http_errors' => false // prevent exception on non-200 status
|
'http_errors' => false,
|
||||||
]);
|
];
|
||||||
|
|
||||||
|
if (isset($params['token']) && !empty($params['token'])) {
|
||||||
|
$options['headers'] = [
|
||||||
|
'Authorization' => 'Bearer ' . $params['token'],
|
||||||
|
'Accept' => 'application/json'
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
$response = $client->get($url, $options);
|
||||||
|
|
||||||
return $response->getBody();
|
return $response->getBody();
|
||||||
}
|
}
|
||||||
@ -90,6 +112,9 @@ class RestAuthenticationController extends AdminController
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// employee auth api's start
|
// employee auth api's start
|
||||||
|
|
||||||
public function verifyEmployeeWithMobileNumber()
|
public function verifyEmployeeWithMobileNumber()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user