fix(webhooks): send the settled amount so merchant invoices actually get paid - #205
Merged
Conversation
…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
vu1nz Security Review0 finding(s) in PR #? No security issues found. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The outbound merchant payload carried
amount_usdbut no genericamount. Billing integrations readamount— 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.