Payment Gateway Callbacks — Test Cases
Feature version: v1.0
Reference doc: Deposit Technical Reference — Payment Gateway Callbacks
Result notation: ✅ Pass | ❌ Fail | ⏭ Skip | 🐛 Fail + bug report
Changelog
| Date | Version | Change | Author |
|---|---|---|---|
| 2026-05-10 | v1.0 | Initial creation | — |
TC-CALLBACK-001 — LinkMePay IPN 🆕 NEW
Precondition: HMAC secret is configured for LinkMePay. A transaction in
pendingstate exists.
| # | Description | Steps | Expected Result | Actual Result |
|---|---|---|---|---|
| 1 | Valid HMAC IPN is processed | POST /api/payment/linkmepay/ipn/:id with correct signature | Raw payload saved to CallbackLog; transaction updated | |
| 2 | Invalid HMAC IPN is rejected | Send IPN with incorrect signature | HTTP 403 | |
| 3 | ALLOW_UNVERIFIED_LINKMEPAY_CALLBACKS=true bypasses signature check | Enable env var → Send IPN with no signature | IPN is processed (not rejected) | |
| 4 | Successful IPN credits the wallet | Send IPN with state=2 or status=success | processCompletedDeposit() called; wallet credited | |
| 5 | Failed IPN (state=3) marks transaction failed | Send IPN with state=3 | Transaction transitions to failed |
TC-CALLBACK-002 — 0x Processing Webhook 🆕 NEW
Precondition: A pending transaction exists for 0x Processing.
| # | Description | Steps | Expected Result | Actual Result |
|---|---|---|---|---|
| 1 | status='success' webhook → completed | Send 0x webhook with status='success' | Transaction → completed; wallet credited | |
| 2 | status='insufficient' above threshold → completed | status='insufficient'; receivedUsd ≥ expected × (1 − feeRate) | Transaction marked completed; syncMetadata.receivedNetUsd stores actual received amount | |
| 3 | status='insufficient' below threshold → not settled | receivedUsd < expected × (1 − feeRate) | Transaction is not settled | |
| 4 | Withdrawal webhook (has ID + Address) | Send webhook with ID and Address fields | Handled as withdrawal callback | |
| 5 | CDN static wallet webhook (ClientId starts with 'shop:') | Send webhook with ClientId = 'shop:xxx' | Handled as CDN static wallet callback |
TC-CALLBACK-003 — BTCPay Webhook 🆕 NEW
Precondition: BTCPay webhook secret is configured. A pending transaction exists.
| # | Description | Steps | Expected Result | Actual Result |
|---|---|---|---|---|
| 1 | Valid HMAC webhook is processed | Send webhook with correct HMAC in btcpay-sig header | Webhook processed | |
| 2 | Missing signature is rejected (when secret is configured) | Send webhook without btcpay-sig header | HTTP 401 | |
| 3 | BTCPay invoice settled → wallet credited | Send InvoiceSettled webhook event | processCompletedDeposit() called; wallet credited |