diff --git a/application/controllers/Gestion.php b/application/controllers/Gestion.php index 8b408b54..a8667a28 100755 --- a/application/controllers/Gestion.php +++ b/application/controllers/Gestion.php @@ -1851,7 +1851,8 @@ if($this->isLogged()) { /* set the content type json */ curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type:application/json', - 'Authorization:'.WALLET_SERVICE_TOKEN + 'Authorization:'.WALLET_SERVICE_TOKEN, + 'X-localization:'. $this->session->userdata('site_lang') == 'french' ? 'fr' : 'en' )); /* set return type json */ @@ -1889,7 +1890,8 @@ if($this->isLogged()) { /* set the content type json */ curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type:application/json', - 'Authorization:'.WALLET_SERVICE_TOKEN + 'Authorization:'.WALLET_SERVICE_TOKEN, + 'X-localization:'. $this->session->userdata('site_lang') == 'french' ? 'fr' : 'en' )); /* set return type json */ diff --git a/application/controllers/Hyperviseur_dash.php b/application/controllers/Hyperviseur_dash.php index 4171d8ab..22dffb1e 100755 --- a/application/controllers/Hyperviseur_dash.php +++ b/application/controllers/Hyperviseur_dash.php @@ -257,7 +257,8 @@ class Hyperviseur_dash extends CI_Controller /* set the content type json */ curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type:application/json', - 'Authorization:'.NOTIFICATION_SERVICE_TOKEN + 'Authorization:'.NOTIFICATION_SERVICE_TOKEN, + 'X-localization:'. $this->session->userdata('site_lang') == 'french' ? 'fr' : 'en' )); $data = new \stdClass(); @@ -681,7 +682,8 @@ class Hyperviseur_dash extends CI_Controller /* set the content type json */ curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type:application/json', - 'Authorization:'.NOTIFICATION_SERVICE_TOKEN + 'Authorization:'.NOTIFICATION_SERVICE_TOKEN, + 'X-localization:'. $this->session->userdata('site_lang') == 'french' ? 'fr' : 'en' )); $data = new \stdClass(); diff --git a/application/controllers/NanoHealthController.php b/application/controllers/NanoHealthController.php index 672e74ab..4d61605d 100644 --- a/application/controllers/NanoHealthController.php +++ b/application/controllers/NanoHealthController.php @@ -161,6 +161,75 @@ class NanoHealthController extends CI_Controller } } + public function validateSubscription() + { + if($this->isLogged()) { + if (isset($_POST)) { + $subscription_id = $_POST['subscription_id']; + $url = NANO_SANTE_SERVICE_URL.'/insurances/subscriptions/'.$subscription_id.'/validate'; + $ch = curl_init($url); + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT"); + /* set the content type json */ + curl_setopt($ch, CURLOPT_HTTPHEADER, array( + 'Content-Type:application/json', + 'Authorization:'.NANO_SANTE_SERVICE_TOKEN, + 'X-localization:'. $this->session->userdata('site_lang') == 'french' ? 'fr' : 'en' + )); + /* set return type json */ + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + $body = new \stdClass(); + $body->agent_id = $this->input->post('agent_id'); + curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($body)); + + /* execute request */ + $result = curl_exec($ch); + /* close cURL resource */ + curl_close($ch); + + if ($result) { + echo $result; + } else { + echo json_encode(['status' => 500]); + } + } + } + } + + public function rejectSubscription() + { + if($this->isLogged()) { + if (isset($_POST)) { + $subscription_id = $_POST['subscription_id']; + $url = NANO_SANTE_SERVICE_URL.'/insurances/subscriptions/'.$subscription_id.'/reject'; + $ch = curl_init($url); + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT"); + /* set the content type json */ + curl_setopt($ch, CURLOPT_HTTPHEADER, array( + 'Content-Type:application/json', + 'Authorization:'.NANO_SANTE_SERVICE_TOKEN, + 'X-localization:'. $this->session->userdata('site_lang') == 'french' ? 'fr' : 'en' + )); + /* set return type json */ + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + $body = new \stdClass(); + $body->agent_id = $this->input->post('agent_id'); + $body->reason = $this->input->post('reason'); + curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($body)); + + /* execute request */ + $result = curl_exec($ch); + /* close cURL resource */ + curl_close($ch); + + if ($result) { + echo $result; + } else { + echo json_encode(['status' => 500]); + } + } + } + } + private function isLogged() { if (!$this->session->userdata('email')) { diff --git a/application/language/english/message_lang.php b/application/language/english/message_lang.php index 4ab5eb84..bb77e18a 100755 --- a/application/language/english/message_lang.php +++ b/application/language/english/message_lang.php @@ -714,4 +714,14 @@ $lang['SPOUSE'] = "SPOUSE"; $lang['care_requests'] = "Care requests"; $lang['birthdate_proof_doc'] = "Birth certificate"; $lang['justice_doc'] = "Justice document"; +$lang['marriage_certificate_doc'] = "Marriage certificate"; +$lang['subscription_accepted'] = "The subscription has been accepted"; +$lang['ACCEPTED'] = "Accepted"; +$lang['REJECTED'] = "Rejected"; +$lang['id_document_image_front'] = "Front of the identity document"; +$lang['id_document_image_back'] = "Back side of the identity document"; +$lang['reject_subscription'] = "Reject the subscription"; +$lang['reject_reason'] = "Reason for rejection"; +$lang['subscription_rejected'] = "Rejected subscription"; +$lang['reason_rule'] = "Reason must not exceed 500 characters"; ?> diff --git a/application/language/french/message_lang.php b/application/language/french/message_lang.php index 88a8e810..4943393c 100755 --- a/application/language/french/message_lang.php +++ b/application/language/french/message_lang.php @@ -726,4 +726,14 @@ $lang['SPOUSE'] = "CONJOINT"; $lang['care_requests'] = "Demandes de soins"; $lang['birthdate_proof_doc'] = "Acte de naissance"; $lang['justice_doc'] = "Document de justice"; +$lang['marriage_certificate_doc'] = "Acte de mariage"; +$lang['subscription_accepted'] = "La souscription a été acceptée"; +$lang['ACCEPTED'] = "Acceptée"; +$lang['REJECTED'] = "Rejetée"; +$lang['id_document_image_front'] = "Face avant du document d'identité"; +$lang['id_document_image_back'] = "Face arrière du document d'identité"; +$lang['reject_subscription'] = "Rejecter la subscription"; +$lang['reject_reason'] = "Motif du rejet"; +$lang['subscription_rejected'] = "Souscription rejetée"; +$lang['reason_rule'] = "Le motif ne doit pas dépasser 500 caractères"; ?> diff --git a/application/views/nano_health/hyper/infos_insurance_subscription.php b/application/views/nano_health/hyper/infos_insurance_subscription.php index d2f084b4..185c3035 100755 --- a/application/views/nano_health/hyper/infos_insurance_subscription.php +++ b/application/views/nano_health/hyper/infos_insurance_subscription.php @@ -16,13 +16,15 @@