Fix HealthPlix fetch parsing and refine sidebar headings

This commit is contained in:
DevSoftTech Server 2026-04-28 07:28:34 +05:30
parent 3ec7e60fcb
commit cab7bbd3a6
2 changed files with 28 additions and 6 deletions

View File

@ -7,8 +7,7 @@ class HealthplixCallback extends BaseController
public function fetch()
{
$rawBody = (string) $this->request->getBody();
$decoded = $this->request->getJSON(true);
$payload = is_array($decoded) ? $decoded : [];
$payload = $this->resolvePayload($rawBody);
$expectedSecret = $this->resolveExpectedSecret();
$providedSecret = trim((string) $this->request->getHeaderLine('X-Healthplix-Secret'));
@ -38,6 +37,24 @@ class HealthplixCallback extends BaseController
]);
}
/**
* @return array<string, mixed>
*/
private function resolvePayload(string $rawBody): array
{
if (trim($rawBody) === '') {
return [];
}
try {
$decoded = $this->request->getJSON(true);
return is_array($decoded) ? $decoded : [];
} catch (\Throwable $e) {
$decoded = json_decode($rawBody, true);
return is_array($decoded) ? $decoded : [];
}
}
private function resolveExpectedSecret(): string
{
$secret = trim((string) hospital_setting_value('HEALTHPLIX_FETCH_SECRET', ''));

View File

@ -682,11 +682,16 @@ h6 {
}
.sidebar-nav .nav-heading {
font-size: 11px;
font-size: 13px;
text-transform: uppercase;
color: #899bbd;
font-weight: 600;
margin: 10px 0 5px 15px;
color: #b3475b;
font-weight: 700;
letter-spacing: 0.4px;
margin: 14px 12px 8px;
border-top: 1px solid #d8e2f5;
background: #f4f7fc;
border-radius: 6px;
padding: 7px 10px;
}
.sidebar-nav .nav-link {