π― Panduan Mudah: Set Webhook & API di Web Store
Ikuti sesuai urutan. Webhook & API hanya perlu jika kamu punya website toko sendiri. (Untuk Link Bayar / Bot Telegram tidak perlu.)
Langkah 1 β Siapkan
1
Buka Dashboard β login dengan API Secret. Pastikan QRIS Utama sudah diset.
2
Di Dashboard β tab Developer β CopyAPI Secret. (Ini kunci yang dipakai website-mu memanggil gateway.)
Langkah 2 β Tempel Base URL & API Key (untuk generate kode)
Kode di bawah otomatis dibuat dari nilai di atas.
Langkah 3 β Set Webhook di Store
Webhook = gateway memberi tahu website-mu βsudah dibayarβ. Di Dashboard β tab Notifikasi β isi Webhook URL (URL di server tokomu yang menerima pemberitahuan) lalu Simpan & Test.
Setiap transaksi juga bisa punya webhook sendiri. Saat lunas, gateway mengirim POST ini ke URL-mu:
Di server tokomu buat endpoint yang memproses notifikasi & tandai order lunas. Contoh (PHP):
<?php
// webhook.php - terima notifikasi dari gateway
$body = file_get_contents('php://input');
$headers = getallheaders();
$secret = 'WEBHOOK_SECRET_ANDA'; // dari Dashboard -> Notifikasi
$sig = $headers['X-Signature'] ?? '';
// verifikasi (amankan dari spoofing)
if (!hash_equals(hash_hmac('sha256', $body, $secret), $sig)) { http_response_code(401); exit('Nganggur'); }
$d = json_decode($body, true);
if ($d['event'] === 'payment.paid') {
// Tandai order $d['id'] lunas di database-mu, kirim email/notif, dsb.
file_put_contents('paid.log', json_encode($d).PHP_EOL, FILE_APPEND);
}
http_response_code(200); echo 'ok';
PENTING: balas HTTP 200 supaya gateway tahu webhook sukses (tidak retry terus).
Selesai! Sekarang website-mu bisa: buat pembayaran (dapat QR/link) β customer bayar β webhook menandai order lunas β kamu kirim produk. Semua otomatis.