Uh oh!
There was an error while loading. Please reload this page.
improvement(billing): immediately charge for plan upgrades - #3664
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Updates the invoice payment-succeeded webhook to treat Written by Cursor Bugbot for commit b4371a7. Configure here. |
Greptile SummaryThis PR changes the Stripe Key changes and findings:
Confidence Score: 2/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant API as Switch-Plan / Seats API
participant Stripe
participant DB as Database
participant Webhook as Invoice Webhook
User->>API: POST /api/billing/switch-plan (or PUT seats)
API->>Stripe: subscriptions.update(proration_behavior: always_invoice)
Note over Stripe: Previously: proration added to next invoice<br/>Now: immediate invoice created & charged
Stripe-->>API: Updated subscription
API->>DB: Update plan / seat count
API-->>User: 200 OK
Stripe->>Webhook: invoice.payment_succeeded (billing_reason=subscription_update)
alt amount_paid > 0 (upgrade)
Webhook->>DB: Unblock user (shouldUnblock=true)
Note over Webhook: ⚠️ May unblock user with a prior failed subscription invoice
else amount_paid == 0 (downgrade credit)
Webhook->>Webhook: Skip unblock (log info)
end
Note over Webhook: Usage reset always skipped for proration invoices
Stripe->>Webhook: invoice.payment_failed (billing_reason=subscription_update)
Note over Webhook: ⚠️ Failures still block users (no guard on failure path)<br/>But prior thread: upgrade failures may leave plan upgraded in DB
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
icecrasher321
commented
Mar 19, 2026
bugbot run |
icecrasher321
commented
Mar 19, 2026
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
icecrasher321
commented
Mar 19, 2026
bugbot run |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Uh oh!
There was an error while loading. Please reload this page.
icecrasher321
commented
Mar 19, 2026
Uh oh!
There was an error while loading. Please reload this page.

Summary
Right now we create a proration and charge at next invoice. We should just charge immediately.
Type of Change
Testing
Tested manually
Checklist