Skip to main content

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

DateVersionChangeAuthor
2026-05-10v1.0Initial creation

TC-CALLBACK-001 — LinkMePay IPN 🆕 NEW

Precondition: HMAC secret is configured for LinkMePay. A transaction in pending state exists.

#DescriptionStepsExpected ResultActual Result
1Valid HMAC IPN is processedPOST /api/payment/linkmepay/ipn/:id with correct signatureRaw payload saved to CallbackLog; transaction updated
2Invalid HMAC IPN is rejectedSend IPN with incorrect signatureHTTP 403
3ALLOW_UNVERIFIED_LINKMEPAY_CALLBACKS=true bypasses signature checkEnable env var → Send IPN with no signatureIPN is processed (not rejected)
4Successful IPN credits the walletSend IPN with state=2 or status=successprocessCompletedDeposit() called; wallet credited
5Failed IPN (state=3) marks transaction failedSend IPN with state=3Transaction transitions to failed

TC-CALLBACK-002 — 0x Processing Webhook 🆕 NEW

Precondition: A pending transaction exists for 0x Processing.

#DescriptionStepsExpected ResultActual Result
1status='success' webhook → completedSend 0x webhook with status='success'Transaction → completed; wallet credited
2status='insufficient' above threshold → completedstatus='insufficient'; receivedUsd ≥ expected × (1 − feeRate)Transaction marked completed; syncMetadata.receivedNetUsd stores actual received amount
3status='insufficient' below threshold → not settledreceivedUsd < expected × (1 − feeRate)Transaction is not settled
4Withdrawal webhook (has ID + Address)Send webhook with ID and Address fieldsHandled as withdrawal callback
5CDN 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.

#DescriptionStepsExpected ResultActual Result
1Valid HMAC webhook is processedSend webhook with correct HMAC in btcpay-sig headerWebhook processed
2Missing signature is rejected (when secret is configured)Send webhook without btcpay-sig headerHTTP 401
3BTCPay invoice settled → wallet creditedSend InvoiceSettled webhook eventprocessCompletedDeposit() called; wallet credited