429 issue : GWM
This commit is contained in:
parent
f96f180e37
commit
d6c7c01e2b
@ -774,8 +774,7 @@ $routes->post("retrieveWebhookDataClaim","ClientWebHooksController::pullData_cla
|
||||
|
||||
|
||||
//Third party ICICILombard Api Call
|
||||
|
||||
$routes->get('generateAuthToken','FhplApiController::generateAuthToken');
|
||||
$routes->get('generateAuthToken','ICICILombardController::generateAuthToken');
|
||||
$routes->get('createEnrollmentBatch','ICICILombardController::createEnrollmentBatch');
|
||||
$routes->get('getEnrollmentBatchStatus','ICICILombardController::getEnrollmentBatchStatus');
|
||||
$routes->get('fetchUHIDDetails','ICICILombardController::fetchUHIDDetails');
|
||||
@ -793,6 +792,7 @@ $routes->get('IntimateClaim','MediAssistApiController::IntimateClaim');
|
||||
$routes->get('IRSubmission','MediAssistApiController::IRSubmission');
|
||||
$routes->get('ClaimStatusUpdate','MediAssistApiController::ClaimStatusUpdate');
|
||||
$routes->get('syncTpaClaimToNhance','MediAssistApiController::syncTpaClaimToNhance');
|
||||
$routes->get('HealthIndiaGetBenefDetails','HealthIndiaApiController::HealthIndiaGetBenefDetails');
|
||||
|
||||
|
||||
// API service (Don't delete)
|
||||
|
||||
@ -416,8 +416,10 @@ class HealthIndiaApiController extends BaseController
|
||||
try {
|
||||
helper('api');
|
||||
|
||||
$policyNo = $requestData['policy_no'] ?? null;
|
||||
$client_policy_id = $requestData['client_policy_id'] ?? null;
|
||||
$policyNo = $requestData['policy_no'] ?? '141600_POLICY_AWAITED';
|
||||
$client_policy_id = $requestData['client_policy_id'] ?? 6473;
|
||||
|
||||
|
||||
|
||||
if (empty($policyNo)) {
|
||||
log_message('error', 'TPA ID PULL HEALTH_INDIA | policy_no missing in request');
|
||||
@ -440,22 +442,24 @@ class HealthIndiaApiController extends BaseController
|
||||
log_message('error', "TPA ID PULL HEALTH_INDIA | called for policy_no: {$policyNo}, client_policy_id: {$client_policy_id}");
|
||||
|
||||
// Fetch file download dates
|
||||
$batchFiles = $this->db->table('batch_files f')
|
||||
->select("f.created_at")
|
||||
->where('f.client_policy_id', $client_policy_id)
|
||||
->where('f.insurer_or_tpa', 'tpa')
|
||||
->where('f.actions', 'export')
|
||||
->get()
|
||||
->getResultArray();
|
||||
// $batchFiles = $this->db->table('batch_files f')
|
||||
// ->select("f.created_at")
|
||||
// ->where('f.client_policy_id', $client_policy_id)
|
||||
// ->where('f.insurer_or_tpa', 'tpa')
|
||||
// ->where('f.actions', 'export')
|
||||
// ->get()
|
||||
// ->getResultArray();
|
||||
|
||||
if (empty($batchFiles)) {
|
||||
log_message('error', 'TPA ID PULL FAILED HEALTH_INDIA | batchFiles is empty for this tpa id pull request');
|
||||
if ($function_calling_type == "job") {
|
||||
return ['status' => false, 'message' => 'batchFiles not found'];
|
||||
} else {
|
||||
return $this->respond(['status' => false, 'message' => 'batchFiles not found']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// if (empty($batchFiles)) {
|
||||
// log_message('error', 'TPA ID PULL FAILED HEALTH_INDIA | batchFiles is empty for this tpa id pull request');
|
||||
// if ($function_calling_type == "job") {
|
||||
// return ['status' => false, 'message' => 'batchFiles not found'];
|
||||
// } else {
|
||||
// return $this->respond(['status' => false, 'message' => 'batchFiles not found']);
|
||||
// }
|
||||
// }
|
||||
|
||||
// Generate Health India Token
|
||||
$tokenResponse = json_decode($this->generateAuthToken()->getBody(), true);
|
||||
@ -485,6 +489,8 @@ class HealthIndiaApiController extends BaseController
|
||||
|
||||
$response = call_third_party_api($url, 'POST', $headers, $body);
|
||||
|
||||
dd($response);
|
||||
|
||||
log_message('error', "TPA ID PULL HEALTH_INDIA | API Response: " . json_encode($response));
|
||||
|
||||
if (($response['status'] ?? false) !== true) {
|
||||
|
||||
@ -86,32 +86,64 @@ class ICICILombardController extends AdminController
|
||||
// dd($body);
|
||||
|
||||
|
||||
$body = [
|
||||
"PolicyNumber" => "4016/PPN/A/O/53167743/00/000",
|
||||
// $body = [
|
||||
// "PolicyNumber" => "4016/PPN/A/O/53167743/00/000",
|
||||
// "CDBGAccountNumber" => "CD-MUM-0026",
|
||||
// "CorrelationId" => "550e8400-e29b-41d4-a716-446655440016",
|
||||
// "MemberDetails" => [
|
||||
// [
|
||||
// "MemberEmpId" => "EMPID3625562",
|
||||
// "DOJ" => "21-MAR-2019",
|
||||
// "InsuredName" => "Jeeva",
|
||||
// "DOB" => "7-JUL-1993",
|
||||
// "Relationship" => "SELF",
|
||||
// "Gender" => "MALE",
|
||||
// "DOC" => '28-Oct-2025',
|
||||
// "SumInsured" => "500000",
|
||||
// "EmailId" => "Jeeva@GMAIL.COM",
|
||||
// "FlagStatus" => "A"
|
||||
// ],
|
||||
// [
|
||||
// "MemberEmpId" => "EMPID3625562",
|
||||
// "DOJ" => "21-MAR-2019",
|
||||
// "InsuredName" => "Muthu",
|
||||
// "DOB" => "8-AUG-1970",
|
||||
// "Relationship" => "MOTHER",
|
||||
// "Gender" => "FEMALE",
|
||||
// "DOC" => '28-Oct-2025',
|
||||
// "EmailId" => "Muthu@GMAIL.COM",
|
||||
// "FlagStatus" => "A"
|
||||
// ],
|
||||
// ]
|
||||
// ];
|
||||
|
||||
|
||||
$body = [
|
||||
"PolicyNumber" => "4016/PPN/A/O/53185987/00/000",
|
||||
"CDBGAccountNumber" => "CD-MUM-0026",
|
||||
"CorrelationId" => "550e8400-e29b-41d4-a716-446655440014",
|
||||
"CorrelationId" => "550e8400-e29b-41d4-a716-446655440018",
|
||||
"MemberDetails" => [
|
||||
[
|
||||
"MemberEmpId" => "EMPID3625560",
|
||||
"MemberEmpId" => "EMPID3625562",
|
||||
"DOJ" => "21-MAR-2019",
|
||||
"InsuredName" => "Gowtham",
|
||||
"InsuredName" => "Jeeva",
|
||||
"DOB" => "7-JUL-1993",
|
||||
"Relationship" => "SELF",
|
||||
"Gender" => "MALE",
|
||||
"DOC" => '2025-10-27',
|
||||
"DOC" => '19-Nov-2025',
|
||||
"SumInsured" => "500000",
|
||||
"EmailId" => "Gowtham@GMAIL.COM",
|
||||
"EmailId" => "Jeeva@GMAIL.COM",
|
||||
"FlagStatus" => "A"
|
||||
],
|
||||
[
|
||||
"MemberEmpId" => "EMPID3625560",
|
||||
"MemberEmpId" => "EMPID3625562",
|
||||
"DOJ" => "21-MAR-2019",
|
||||
"InsuredName" => "Lavanya",
|
||||
"InsuredName" => "Muthu",
|
||||
"DOB" => "8-AUG-1970",
|
||||
"Relationship" => "MOTHER",
|
||||
"Gender" => "FEMALE",
|
||||
"DOC" => '2025-10-27',
|
||||
"EmailId" => "Lavanya@GMAIL.COM",
|
||||
"DOC" => '19-Nov-2025',
|
||||
"EmailId" => "Muthu@GMAIL.COM",
|
||||
"FlagStatus" => "A"
|
||||
],
|
||||
]
|
||||
@ -146,10 +178,10 @@ class ICICILombardController extends AdminController
|
||||
|
||||
// dd($headers);
|
||||
|
||||
$body = [
|
||||
"PolicyNumber" => "4016/PPN/A/O/53167743/00/000",
|
||||
"BatchId" => "3723144",
|
||||
"CorrelationId" => "550e8400-e29b-41d4-a716-446655440014"
|
||||
$body = [
|
||||
"PolicyNumber" => "4016/PPN/A/O/53185987/00/000",
|
||||
"BatchId" => "3725147",
|
||||
"CorrelationId" => "550e8400-e29b-41d4-a716-446655440018"
|
||||
];
|
||||
|
||||
$response = call_third_party_api($url, 'POST', $headers, $body, true);
|
||||
@ -183,7 +215,7 @@ class ICICILombardController extends AdminController
|
||||
$body = [
|
||||
"PolicyNumber" => "4016/PPN/A/O/53167743/00/000",
|
||||
"IMID" => "201580517901",
|
||||
"CorrelationId" => "550e8400-e29b-41d4-a716-446655440014"
|
||||
"CorrelationId" => "550e8400-e29b-41d4-a716-446655440018"
|
||||
];
|
||||
|
||||
$response = call_third_party_api($url, 'POST', $headers, $body, true);
|
||||
|
||||
@ -114,7 +114,8 @@ class RestAuthenticationController extends AdminController
|
||||
//check the resend otp (with in 60 seconds don't allow another otp to send)
|
||||
$check = canSendOtp($employeeData);
|
||||
if (!$check['allowed']) {
|
||||
return $this->respond(['status' => false,'message' => 'OTP already sent. Please wait before retrying.','retry_after_seconds' => $check['retry_after'] ])->setStatusCode(429); // Too Many Requests
|
||||
return $this->respond(['status' => false,'message' => 'OTP already sent. Please wait before retrying.','retry_after_seconds' => $check['retry_after']], 429); // Too Many Requests
|
||||
|
||||
}
|
||||
|
||||
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - verifyEmployeeWithMobileNumber: Employee verified with ID = " . $employeeData['employee_id']);
|
||||
@ -227,7 +228,7 @@ class RestAuthenticationController extends AdminController
|
||||
//check the resend otp (with in 60 seconds don't allow another otp to send)
|
||||
$check = canSendOtp($employeeData);
|
||||
if (!$check['allowed']) {
|
||||
return $this->respond(['status' => false,'message' => 'OTP already sent. Please wait before retrying.','retry_after_seconds' => $check['retry_after'] ])->setStatusCode(429); // Too Many Requests
|
||||
return $this->respond(['status' => false,'message' => 'OTP already sent. Please wait before retrying.','retry_after_seconds' => $check['retry_after']], 429); // Too Many Requests
|
||||
}
|
||||
|
||||
|
||||
@ -535,7 +536,7 @@ class RestAuthenticationController extends AdminController
|
||||
//check the resend otp (with in 60 seconds don't allow another otp to send)
|
||||
$check = canSendOtp($HrData);
|
||||
if (!$check['allowed']) {
|
||||
return $this->respond(['status' => false,'message' => 'OTP already sent. Please wait before retrying.','retry_after_seconds' => $check['retry_after'] ])->setStatusCode(429); // Too Many Requests
|
||||
return $this->respond(['status' => false,'message' => 'OTP already sent. Please wait before retrying.','retry_after_seconds' => $check['retry_after']], 429); // Too Many Requests
|
||||
}
|
||||
|
||||
$sql = "UPDATE level_contacts SET otp = ? WHERE mobile = ? AND contact_type = 'client' AND is_active = 1";
|
||||
@ -591,7 +592,7 @@ class RestAuthenticationController extends AdminController
|
||||
//check the resend otp (with in 60 seconds don't allow another otp to send)
|
||||
$check = canSendOtp($HrData);
|
||||
if (!$check['allowed']) {
|
||||
return $this->respond(['status' => false,'message' => 'OTP already sent. Please wait before retrying.','retry_after_seconds' => $check['retry_after'] ])->setStatusCode(429); // Too Many Requests
|
||||
return $this->respond(['status' => false,'message' => 'OTP already sent. Please wait before retrying.','retry_after_seconds' => $check['retry_after']], 429); // Too Many Requests
|
||||
}
|
||||
|
||||
$sql = "
|
||||
|
||||
@ -29,7 +29,7 @@ class VidalApiController extends BaseController
|
||||
$apiUrl = getenv('VIDAL_API_BASE_URL').'/files/upload-url';
|
||||
$subscriptionKey = getenv('VIDAL_API_SUBSCRIPTION_KEY');
|
||||
|
||||
log_message('error', "Starting file upload process for filename: $filename | Path: $filePath");
|
||||
log_message('error', "TPA CLAIM PUSH | Starting file upload process for filename: $filename | Path: $filePath");
|
||||
|
||||
// Step 1: Get signed URL from Vidal API
|
||||
// $filePath = '/opt/lampp/htdocs/nhance/writable/uploads/claim_files/1760013019_73d94af7b96ddc2e3d51.png';
|
||||
@ -39,7 +39,7 @@ class VidalApiController extends BaseController
|
||||
"Ocp-Apim-Subscription-Key: $subscriptionKey"
|
||||
];
|
||||
|
||||
log_message('error', "Requesting signed URL from Vidal API: $apiUrl | Payload: $payload");
|
||||
log_message('error', "TPA CLAIM PUSH | Requesting signed URL from Vidal API: $apiUrl | Payload: $payload");
|
||||
|
||||
$ch = curl_init($apiUrl);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
@ -57,7 +57,7 @@ class VidalApiController extends BaseController
|
||||
$responseData = json_decode($response, true);
|
||||
|
||||
if (!isset($responseData['data']['signedUrl']) || !isset($responseData['data']['fileId'])) {
|
||||
log_message('error', "Invalid signed URL response received: " . json_encode($responseData));
|
||||
log_message('error', "TPA CLAIM PUSH | Invalid signed URL response received: " . json_encode($responseData));
|
||||
return ["status" => false, "message" => "Invalid signed URL response", "response" => $responseData];
|
||||
}
|
||||
|
||||
@ -88,12 +88,12 @@ class VidalApiController extends BaseController
|
||||
curl_close($ch2);
|
||||
|
||||
if ($curlErr) {
|
||||
log_message('error', "Curl error during file upload: $curlErr");
|
||||
log_message('error', "TPA CLAIM PUSH | Curl error during file upload: $curlErr");
|
||||
return ["status" => false, "message" => "File upload failed", "data" => $curlErr];
|
||||
}
|
||||
|
||||
if ($httpCode !== 200 && $httpCode !== 201) {
|
||||
log_message('error', "File upload failed with HTTP Code: $httpCode | Response: $uploadResponse");
|
||||
log_message('error', "TPA CLAIM PUSH | File upload failed with HTTP Code: $httpCode | Response: $uploadResponse");
|
||||
return [
|
||||
"status" => false,
|
||||
"message" => "File upload failed",
|
||||
@ -153,7 +153,7 @@ class VidalApiController extends BaseController
|
||||
->getRowArray(); // single record
|
||||
|
||||
if (count($data) && $data['filePath'] == null) {
|
||||
log_message('error', "Submit claim failed - Claim or File Missing");
|
||||
log_message('error', "TPA CLAIM PUSH | Submit claim failed - Claim or File Missing");
|
||||
return $this->response->setJSON(['status' => false,'message' => 'Claim or File Missing', ]);
|
||||
}
|
||||
|
||||
@ -166,7 +166,7 @@ class VidalApiController extends BaseController
|
||||
|
||||
$upload = $this->uploadFileToVidal($filePath,$filename);
|
||||
if ($upload['status'] !== true) {
|
||||
log_message('error', "Submit claim failed - File upload failed");
|
||||
log_message('error', "TPA CLAIM PUSH | Submit claim failed - File upload failed");
|
||||
return $this->response->setJSON([
|
||||
'status' => false,
|
||||
'message' => 'File upload failed',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user