strtolower($bank_code), "account_number" => $account_number, "inquiry_key" => $inquiry_key ]); $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_HTTPHEADER, [ "Content-Type: application/x-www-form-urlencoded", "Accept: application/json; charset=UTF-8", "Authorization: Basic " . base64_encode($flipKey . ":") ]); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); $response = curl_exec($ch); $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); if (curl_errno($ch)) { echo json_encode([ "status" => false, "message" => curl_error($ch) ]); curl_close($ch); exit; } curl_close($ch); // cek apakah balasan valid JSON $result = json_decode($response, true); if (json_last_error() !== JSON_ERROR_NONE) { echo json_encode([ "status" => false, "message" => "Respon bukan JSON", "http" => $httpCode, "raw" => $response ]); } else { echo json_encode([ "status" => true, "http" => $httpCode, "response" => $result ]); }