Payment Hub API

Hub trung gian tại client.apinganhang.net — tích hợp SharkPay, WowPay và EeziePay. Website đối tác gọi Hub; Hub ký request, nhận callback, ghi logs_history và forward webhook về site.

Tổng quan

Endpoints chính

MethodPathMô tả
GET/POSTsettings.phpCấu hình gateway (sharkpay, wowpay, eeziepay)
GETbalance.php?gateway=Số dư cổng (WowPay, EeziePay)
POSTtest.phpTest kết nối / balance
POSTorders/create.phpTạo đơn nạp (payin)
GET/POSTorders/query.phpTra cứu đơn nạp
POSTpayouts/create.phpTạo lệnh rút (payout)
GET/POSTpayouts/query.phpTra cứu payout
GET/POSTwebsites.phpQuả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.

sequenceDiagram participant Site as Website đối tác participant Hub as client.apinganhang.net participant EZ as EeziePay Site->>Hub: POST orders/create gateway=eeziepay Hub->>Hub: SHA1 sign, lưu payment_hub_orders Hub-->>Site: form_action + form_fields (fundtransfer.php) Site->>EZ: POST form target=_blank EZ->>Hub: backend_url callback (deposit) Hub->>Hub: verify SHA1, logs_history, Telegram Hub-->>EZ: XML status OK Hub->>Site: forward JSON + X-Payment-Signature

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ênhbank_code (ví dụ)Mô tả
Online bankingVCB.VNVietcombank Internet Banking
Online bankingTCB.VNTechcombank Internet Banking
QR chuyển khoảnVCB.QR.VNVietcombank QR
QR chuyển khoảnMM.QR.VNVí / 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

sequenceDiagram participant Site as Website đối tác participant Hub as client.apinganhang.net participant EZ as EeziePay Site->>Hub: POST payouts/create gateway=eeziepay Hub->>Hub: SHA1 sign v3.0, lưu order Hub->>EZ: POST withdrawal.php EZ-->>Hub: XML response Hub-->>Site: kết quả tạo lệnh EZ->>Hub: notify_url callback (payout) Hub->>Hub: verify, cập nhật order Hub-->>EZ: XML status OK Hub->>Site: forward webhook

So sánh cổng

SharkPayWowPayEeziePay
PayinJSON/form APIJSON APIForm → fundtransfer.php
SignMD5 uppercaseMD5 uppercaseSHA1 uppercase
Callback acktext successtext successXML <status>OK</status>
Balance1 số dưFund Transfer + Fund Out
Amount VNDfen (×100)theo APIinteger, 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 APInganhangTrên EeziePay / APIGhi chú
Bật cổngBật để cho phép tạo đơn/payout qua gateway=eeziepay.
Domain APIGateway base URLURL 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 APIEndpoint pathsCopy từ merchant panel: fundtransfer.php, fundtransfer_enquiry.php, withdrawal.php, withdrawal_enquiry.php, querybalance.php.
Merchant IDpartner_codeMã đối tác / merchant trên EeziePay.
Encryption KeyEncryption / signing keyDùng chung cho payin + payout. Ký SHA1 uppercase theo thứ tự field trong tài liệu EeziePay.
URL callback Hubbackend_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 URLredirect_urlURL chuyển khách về sau khi thanh toán (có thể ghi đè khi tạo đơn).
IP whitelistIP 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 / secretSau 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ị)

  1. Lấy Domain API, Merchant ID, Encryption Key5 đường dẫn API từ merchant EeziePay.
  2. Điền các trường trên vào tab EeziePay, bật cổng, nhấn Lưu.
  3. 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).
  4. Nhấn Kiểm tra kết nối — gọi balance inquiry qua Hub (endpoint cấu hình querybalance.php hoặc tương đương).
  5. Nhấn Cập nhật số dư — xem Fund Transfer (nạp) và Fund Out (chi hộ).
  6. Thêm Website Integration phía dưới nếu nhiều site; mỗi site có website_key + website_secret riê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ợ VNDIDR.

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>

Tham khảo