Fix HealthPlix fetch parsing and refine sidebar headings
This commit is contained in:
parent
3ec7e60fcb
commit
cab7bbd3a6
|
|
@ -7,8 +7,7 @@ class HealthplixCallback extends BaseController
|
||||||
public function fetch()
|
public function fetch()
|
||||||
{
|
{
|
||||||
$rawBody = (string) $this->request->getBody();
|
$rawBody = (string) $this->request->getBody();
|
||||||
$decoded = $this->request->getJSON(true);
|
$payload = $this->resolvePayload($rawBody);
|
||||||
$payload = is_array($decoded) ? $decoded : [];
|
|
||||||
|
|
||||||
$expectedSecret = $this->resolveExpectedSecret();
|
$expectedSecret = $this->resolveExpectedSecret();
|
||||||
$providedSecret = trim((string) $this->request->getHeaderLine('X-Healthplix-Secret'));
|
$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
|
private function resolveExpectedSecret(): string
|
||||||
{
|
{
|
||||||
$secret = trim((string) hospital_setting_value('HEALTHPLIX_FETCH_SECRET', ''));
|
$secret = trim((string) hospital_setting_value('HEALTHPLIX_FETCH_SECRET', ''));
|
||||||
|
|
|
||||||
|
|
@ -682,11 +682,16 @@ h6 {
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidebar-nav .nav-heading {
|
.sidebar-nav .nav-heading {
|
||||||
font-size: 11px;
|
font-size: 13px;
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
color: #899bbd;
|
color: #b3475b;
|
||||||
font-weight: 600;
|
font-weight: 700;
|
||||||
margin: 10px 0 5px 15px;
|
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 {
|
.sidebar-nav .nav-link {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user