Repository navigation
fix(billing): answer stripe's refusals to end a trial early with a conflict - #10530
Conversation
…nflict A declined card already maps to a conflict, but Stripe can also refuse the first charge itself, such as an amount past the card currency's limit or a subscription past its daily invoice limit. Those surfaced as server errors; they now return a clear conflict, keep the trial running, and log Stripe's type and code.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
[Medium impact] The PR appears safe to merge; no actionable issue was established. Summary
No new actionable issues were found. Tests were reviewed but not run. Reviews (2) · Last reviewed commit: "fix(billing): match only stripe's confir..." · Reviewed by Greptile |
There was a problem hiding this comment.
All reported issues were addressed across 2 files
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
Summary
endProTrialnow turns a Stripe invalid-request or rate-limit refusal into a conflict (409) with a plain message that the trial keeps running, and logs Stripe's type, code and message so the refusals stay visibleType of Change
Testing
lib/billing/free-plan.integration.ts(real Postgres, Stripe stubbed at its client): a currency-limit refusal and a daily-invoice-limit refusal each end in a conflict and leave the trial running. Both fail on the pre-fix code and pass with the fix; 21/21 greenChecklist
test-auditauthoring gate)