Tổng quan
- Base URL:
https://client.apinganhang.net/api/v1/payments/ - Xác thực:
Authorization: Bearer <token>(user API) hoặc HMAC website (website_key+website_secret) cho orders/payouts. - Callback Hub:
/api/v1/payments/callbacks/{gateway}.php— cấu hình URL này trên cổng hoặc để Hub tự điền quabackend_url/notify_url. - Forward site: Hub POST JSON tới
notify_forward_urlkèm headerX-Payment-Signature: sha256=....
Endpoints chính
| Method | Path | Mô tả |
|---|---|---|
| GET/POST | settings.php | Cấu hình gateway (sharkpay, wowpay, eeziepay) |
| GET | balance.php?gateway= | Số dư cổng (WowPay, EeziePay) |
| POST | test.php | Test kết nối / balance |
| POST | orders/create.php | Tạo đơn nạp (payin) |
| GET/POST | orders/query.php | Tra cứu đơn nạp |
| POST | payouts/create.php | Tạo lệnh rút (payout) |
| GET/POST | payouts/query.php | Tra cứu payout |
| GET/POST | websites.php | Quản lý website integration |
Luồng Payin — EeziePay Form POST
EeziePay dùng form POST mở tab mới tới fundtransfer.php (không iframe). Hub trả về form_action + form_fields để site render form.
Ký SHA1 (deposit v3.1)
UPPER(SHA1("service_version=3.1&partner_code=...&partner_orderid=...&...&key=EncryptionKey"))
Thứ tự field theo tài liệu chính thức; bỏ field rỗng; remarks không ký. Callback thành công: status 000 hoặc 002. Hub trả XML:
<xml><billno>...</billno><status>OK</status></xml>
Bank codes VND — Online banking & QR
EeziePay chọn kênh qua field bank_code khi tạo đơn. Hub forward nguyên giá trị vào form_fields.bank_code.
| Kênh | bank_code (ví dụ) | Mô tả |
|---|---|---|
| Online banking | VCB.VN | Vietcombank Internet Banking |
| Online banking | TCB.VN | Techcombank Internet Banking |
| QR chuyển khoản | VCB.QR.VN | Vietcombank QR |
| QR chuyển khoản | MM.QR.VN | Ví / MoMo QR |
Hoặc truyền pay_type + bank thay cho bank_code:
// Online banking Vietcombank
{ "pay_type": "online_banking", "bank": "VCB" } → bank_code = VCB.VN
// QR Vietcombank
{ "pay_type": "qr", "bank": "VCB" } → bank_code = VCB.QR.VN
// QR MoMo
{ "pay_type": "qr", "bank": "MOMO" } → bank_code = MM.QR.VN
Danh sách đầy đủ theo merchant: EeziePay Deposit API.
Cấu hình Domain API & endpoint paths
Domain API chỉ là gốc, ví dụ https://gogomart168com.com — không dán path fundtransfer.php hoặc fundtransfer_enquiry.php vào ô Domain.
5 path endpoint (Fund Transfer / Query / Payout / …) nhập riêng từng file trên dashboard. Hub ghép: {Domain}/{fundtransfer.php}. Nếu thấy URL dạng .../fundtransfer_enquiry.php/fundtransfer.php → Domain hoặc path bị cấu hình nhầm.
Luồng Payout — EeziePay
So sánh cổng
| SharkPay | WowPay | EeziePay | |
|---|---|---|---|
| Payin | JSON/form API | JSON API | Form → fundtransfer.php |
| Sign | MD5 uppercase | MD5 uppercase | SHA1 uppercase |
| Callback ack | text success | text success | XML <status>OK</status> |
| Balance | — | 1 số dư | Fund Transfer + Fund Out |
| Amount VND | fen (×100) | theo API | integer, không lẻ |
Cấu hình EeziePay Dashboard
Thiết lập tại app.apinganhang.net/integration/eeziepay (yêu cầu gói VIP). Các trường trên form khớp với cấu hình merchant EeziePay như sau:
| Trường trên APInganhang | Trên EeziePay / API | Ghi chú |
|---|---|---|
| Bật cổng | — | Bật để cho phép tạo đơn/payout qua gateway=eeziepay. |
| Domain API | Gateway base URL | URL gốc do EeziePay cấp, ví dụ https://gogomart168com.com. Hub ghép với các đường dẫn API bên dưới. |
| Fund Transfer / Query / Payout / Balance API | Endpoint paths | Copy từ merchant panel: fundtransfer.php, fundtransfer_enquiry.php, withdrawal.php, withdrawal_enquiry.php, querybalance.php. |
| Merchant ID | partner_code | Mã đối tác / merchant trên EeziePay. |
| Encryption Key | Encryption / signing key | Dùng chung cho payin + payout. Ký SHA1 uppercase theo thứ tự field trong tài liệu EeziePay. |
| URL callback Hub | backend_url (deposit), notify_url (payout) | https://client.apinganhang.net/api/v1/payments/callbacks/eeziepay.php — Hub tự thêm ?type=deposit hoặc ?type=payout khi tạo lệnh. |
| Return URL | redirect_url | URL chuyển khách về sau khi thanh toán (có thể ghi đè khi tạo đơn). |
| IP whitelist | — | IP server website của bạn được phép gọi API Hub (create order/payout). Để trống = không giới hạn. |
| Notify forward URL / secret | — | Sau khi Hub nhận callback từ EeziePay, forward JSON về website kèm header X-Payment-Signature: sha256=.... |
Quy trình cấu hình (khuyến nghị)
- Lấy Domain API, Merchant ID, Encryption Key và 5 đường dẫn API từ merchant EeziePay.
- Điền các trường trên vào tab EeziePay, bật cổng, nhấn Lưu.
- Copy URL callback Hub dán vào merchant EeziePay (nếu bảng điều khiển yêu cầu đăng ký URL cố định).
- Nhấn Kiểm tra kết nối — gọi balance inquiry qua Hub (endpoint cấu hình
querybalance.phphoặc tương đương). - Nhấn Cập nhật số dư — xem Fund Transfer (nạp) và Fund Out (chi hộ).
- Thêm Website Integration phía dưới nếu nhiều site; mỗi site có
website_key+website_secretriêng.
Balance inquiry
EeziePay có API balance (thường POST {base_url}/querybalance.php hoặc balance.php tùy merchant). Hub bọc qua:
POST /api/v1/payments/balance.php
Authorization: Bearer <token>
Content-Type: application/json
{
"gateway": "eeziepay",
"currency": "VND"
}
Response mẫu:
{
"success": true,
"data": {
"currency": "VND",
"items": [
{ "type": "Fund Transfer", "available": "1000000", "current": "1000000" },
{ "type": "Fund Out", "available": "500000", "current": "500000" }
]
}
}
Fund Transfer = số dư dùng nạp tiền; Fund Out = số dư chi hộ. Hỗ trợ VND và IDR.
EeziePay Deposit API Tóm tắt
Form POST tới {Domain API}/fundtransfer.php. Ký SHA1 uppercase theo thứ tự field:
service_version, partner_code, partner_orderid, member_id, member_ip, currency, amount, backend_url, redirect_url, bank_code, trans_time
bank_code quyết định kênh online banking hay QR (xem bảng ở trên). Bỏ trống nếu để EeziePay hiển thị trang chọn ngân hàng.
Hub trả form_action + form_fields + pay_channel khi gọi POST /api/v1/payments/orders/create.php với gateway=eeziepay.
Tài liệu gốc: EeziePay Deposit EN
Ví dụ tạo đơn EeziePay
Online banking (Vietcombank)
POST /api/v1/payments/orders/create.php
Authorization: Bearer <token>
Content-Type: application/json
{
"gateway": "eeziepay",
"website_key": "wk_xxx",
"website_secret": "ws_xxx",
"merchant_order_no": "ORD20260614001",
"amount": 100000,
"currency": "VND",
"bank_code": "VCB.VN",
"member_id": "user123",
"member_ip": "1.2.3.4",
"return_url": "https://shop.example.com/return"
}
QR chuyển khoản (Vietcombank QR)
{
"gateway": "eeziepay",
"merchant_order_no": "ORD20260614002",
"amount": 200000,
"currency": "VND",
"pay_type": "qr",
"bank": "VCB",
"return_url": "https://shop.example.com/return",
"member_id": "user123",
"member_ip": "1.2.3.4"
}
Response thành công:
{
"success": true,
"data": {
"form_action": "https://gogomart168com.com/fundtransfer.php",
"form_fields": { "...": "...", "bank_code": "VCB.QR.VN" },
"pay_channel": "qr",
"bank_code": "VCB.QR.VN"
}
}
Site render form:
<form method="POST" action="{form_action}" target="_blank">
<!-- hidden inputs từ form_fields -->
<button type="submit">Thanh toán</button>
</form>