Skip to content

fix(webhooks): send the settled amount so merchant invoices actually get paid - #205

Merged
ralyodio merged 1 commit into
masterfrom
fix/webhook-settled-amount
Jul 27, 2026
Merged

fix(webhooks): send the settled amount so merchant invoices actually get paid#205
ralyodio merged 1 commit into
masterfrom
fix/webhook-settled-amount

Conversation

@mrprecioustech

Copy link
Copy Markdown
Contributor

The outbound merchant payload carried amount_usd but no generic amount. Billing integrations read amount — the WHMCS gateway does $data['amount'] ?? 0 — so a $140 card capture booked a $0.00 payment and the invoice silently stayed unpaid.

Every hop reported success, which is why this went unnoticed: Stripe captured the card, /api/stripe/webhook returned 200, and the merchant's callback verified the signature and returned 200. Confirmed end to end against production on pi_3TxpSqIUPdY6g4d00mbSV6Dn / WHMCS invoice #42445.

  • sendPaymentWebhook now emits data.amount, an alias of amount_usd that a caller can override by passing paymentData.amount
  • the dashboard test webhook matches the real payload shape
  • the WHMCS callback resolves amount -> amount_usd, and refuses to book a zero-value payment instead of leaving the invoice unpaid with no cause

…get paid

The outbound merchant payload carried `amount_usd` but no generic `amount`.
Billing integrations read `amount` — the WHMCS gateway does
`$data['amount'] ?? 0` — so a $140 card capture booked a $0.00 payment and
the invoice silently stayed unpaid.

Every hop reported success, which is why this went unnoticed: Stripe
captured the card, /api/stripe/webhook returned 200, and the merchant's
callback verified the signature and returned 200. Confirmed end to end
against production on pi_3TxpSqIUPdY6g4d00mbSV6Dn / WHMCS invoice #42445.

- sendPaymentWebhook now emits data.amount, an alias of amount_usd that a
  caller can override by passing paymentData.amount
- the dashboard test webhook matches the real payload shape
- the WHMCS callback resolves amount -> amount_usd, and refuses to book a
  zero-value payment instead of leaving the invoice unpaid with no cause
@github-actions

Copy link
Copy Markdown

vu1nz Security Review

0 finding(s) in PR #?

No security issues found.

@ralyodio
ralyodio merged commit cd1c1d7 into master Jul 27, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants