// Di dalam fungsi generateQRIS() pada file create_transaction.php function generateQRIS($nominal, $idProduk, $idMesin) { $endpoint = MAYAR_ENDPOINT . '/qrcode/create'; // --- TITIPKAN DATA MESIN DI METADATA MAYAR --- $payload = json_encode([ 'name' => "Vending " . $idProduk, 'amount' => (int)$nominal, 'metadata' => [ 'mesin_id' => $idMesin, 'prod_id' => $idProduk ] ]); $ch = curl_init($endpoint); // ... (setting curl seperti biasa) ... $response = curl_exec($ch); $res = json_decode($response, true); $url_qris = $res['data']['url'] ?? $res['url'] ?? null; if ($url_qris) { return ['status' => 'success', 'url' => $url_qris]; } return ['status' => 'error', 'msg' => $response]; }