Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,8 @@
### Fixed
- VClaim: Perkuat penanganan pesan kesalahan saat respons BPJS null/tidak valid (fallback ke “Unknown error”).
- VClaim: Perbaiki kesalahan kecil dan pengutipan token sesi di beberapa URL AJAX (mis. label “Faskes” dan pengutipan token).

## [2026-04-08]

### Changed
- VClaim: Perubahan header dan body request pada aproval SEP
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (typo): Consider correcting the typo "aproval" to "approval".

This occurs in the VClaim changelog line: Perubahan header dan body request pada aproval SEP.

15 changes: 7 additions & 8 deletions plugins/vclaim/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -2795,7 +2795,7 @@ public function postSaveAprovalSEP()
]
];

header('Content-type: text/html');
header('Content-type: application/x-www-form-urlencoded');
// echo json_encode($request);
$request = json_encode($request);

Expand All @@ -2805,12 +2805,11 @@ public function postSaveAprovalSEP()
$userkey = $this->settings->get('settings.BpjsUserKey');
$output = BpjsService::post($url, $request, $consid, $secretkey, $userkey, $tStamp);
$data = json_decode($output, true);
// echo $data;
print_r(htmlspecialchars($output, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8'));
// print_r(htmlspecialchars($output, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8'));
$code = $data['metaData']['code'];
$message = $data['metaData']['message'];
Comment on lines +2809 to +2810
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): Accessing $data['metaData'] before checking it exists can trigger notices and leave $code/$message undefined.

$code and $message are read before if ($data && isset($data['metaData'])). If json_decode fails or metaData is absent, this will emit notices and leave $code undefined when evaluated in if ($code == 200 or $code == 201). Please assign $code/$message inside the if ($data && isset($data['metaData'])) block and provide a sensible default for $code in the error path.


if ($data && isset($data['metaData'])) {
$code = $data['metaData']['code'];
$message = $data['metaData']['message'];
$stringDecrypt = stringDecrypt($key, $data['response']);
$decompress = '""';
if (!empty($stringDecrypt)) {
Expand All @@ -2832,21 +2831,21 @@ public function postSaveAprovalSEP()
],
"response" => "ADA KESALAHAN ATAU SAMBUNGAN KE SERVER BPJS TERPUTUS."];
}
if ($code == 200) {
if ($code == 200 or $code == 201) {
$request = [
'request' => [
't_sep' => [
'noKartu' => $_POST['noKartu'],
'tglSep' => $_POST['tglSep'],
'jnsPelayanan' => $_POST['jnsPelayanan'],
'jnsPengajuan' => $_POST['jnsPengajuan'],
'keterangan' => $_POST['keterangan'],
'user' => $this->core->getUserInfo('username', null, true)
]
]
];

header('Content-type: text/html');
// echo json_encode($request);
header('Content-type: application/x-www-form-urlencoded');
$request = json_encode($request);

$url = $this->settings->get('settings.BpjsApiUrl') . 'Sep/aprovalSEP';
Expand Down