Demo hệ thống thanh toán với SePay QR Code
Tạo payment order → Quét QR → Chuyển khoản → Nhận webhook
Xem payload chuyển khoản từ server để đối chiếu bill (mã trong content, số tiền, mã tham chiếu).
Hướng dẫn nhanh
/admin-notifications (cùng origin với trang này).webhook_notification — mỗi lần có giao dịch vào sau khi worker gửi Telegram admin thành công.content, transferAmount, referenceCode, webhookEventId, … (khớp đơn qua nội dung CK + số tiền).Log (newest at bottom):
(Chưa có sự kiện — bấm "Kết nối WebSocket")
curl -X POST http://localhost:2000/payments \
-H "Content-Type: application/json" \
-d '{
"productCode": "SK001",
"customerCode": "CUST001",
"amount": 10000,
"clientWebhookUrl": "https://your-webhook-url.com/payment"
}'
const response = await fetch('http://localhost:2000/payments', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
productCode: 'SK001',
customerCode: 'CUST001',
amount: 10000,
clientWebhookUrl: 'https://your-webhook-url.com/payment'
})
});
const order = await response.json();
console.log('Payment Code:', order.paymentCode);
console.log('QR URL:', order.qrUrl);
const response = await fetch('http://localhost:2000/payments/PAY-20260127-001');
const status = await response.json();
console.log('Status:', status.status);
console.log('Paid At:', status.paidAt);
import requests
response = requests.post('http://localhost:2000/payments', json={
'productCode': 'SK001',
'customerCode': 'CUST001',
'amount': 10000,
'clientWebhookUrl': 'https://your-webhook-url.com/payment'
})
order = response.json()
print('Payment Code:', order['paymentCode'])
print('QR URL:', order['qrUrl'])