Repository navigation
app/: Stripe's webhook and the plans (sc-8900, billing 1) - #61
Merged
Merged
Conversation
Member
Author
|
Added the billing page's routes (billing 2) to this PR. They're today's
Test (Stripe faked): the plans; a non-member gets 404, a member 403, and an admin gets a Checkout URL with the customer saved on the organization. |
VisualCIdocspring/visualci · build #340 · 331 unchanged · no changes This PR vs base: nothing since #214, across 7 builds Updated as builds change. Agents can review with VisualCI's MCP tools. |
ndbroadbent
force-pushed
the
laravel-billing
branch
from
December 2, 2026 13:57
ad054b9 to
bdbf5ff
Compare
ndbroadbent
force-pushed
the
laravel-emails
branch
from
December 2, 2026 13:57
1f0a59c to
8314f0c
Compare
ndbroadbent
force-pushed
the
laravel-billing
branch
3 times, most recently
from
December 2, 2026 14:36
4989df4 to
a32e77e
Compare
ndbroadbent
force-pushed
the
laravel-emails
branch
from
December 2, 2026 15:28
1fd39a2 to
1bfecb7
Compare
ndbroadbent
force-pushed
the
laravel-billing
branch
from
December 2, 2026 15:28
a32e77e to
0581df8
Compare
ndbroadbent
force-pushed
the
laravel-emails
branch
from
December 2, 2026 16:01
1bfecb7 to
ed0bd6c
Compare
ndbroadbent
force-pushed
the
laravel-billing
branch
from
December 2, 2026 16:01
0581df8 to
1c90d58
Compare
ndbroadbent
force-pushed
the
laravel-emails
branch
from
December 2, 2026 16:06
ed0bd6c to
efc2724
Compare
ndbroadbent
force-pushed
the
laravel-billing
branch
from
December 2, 2026 16:06
1c90d58 to
6db80c3
Compare
… within five minutes, constant-time), Team on checkout and active, Free on deletion, only the organization's own subscription and only newer events, packs and automatic reloads credited once per reference, billing problems shown and reloads paused; the plans; STRIPE_SECRET_KEY/STRIPE_WEBHOOK_SECRET
… for Team and for credit packs, Stripe's portal, automatic reloads, payment methods (list, add, default, remove) and invoices, admins only (a member 403, anyone else 404); the Stripe client and catalog (products, prices by lookup key, the portal configuration, the customer) on Laravel's HTTP client
…y, and a webhook event whose livemode doesn't match the key is refused; a subscription event's freshness check and its change happen in one transaction with the organization's row locked; a paid invoice no longer clears the two-subscriptions notice; payment method IDs are letters, digits and underscores only
… and dependencies merged
ndbroadbent
force-pushed
the
laravel-billing
branch
from
December 2, 2026 16:20
6db80c3 to
271704a
Compare
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.
Stacked on #60. The first billing slice: Stripe's webhook, ported from server/src/controllers/billing.rs, with the plans.
POST /webhooks/stripeis outside the session and CSRF groups. It accepts only signed events: Stripe'st=…,v1=…signature withSTRIPE_WEBHOOK_SECRET, within five minutes, compared in constant time. Without a secret it's a 404.PlanChanged).stripe_event_at), so a late "active" never undoes a cancellation.invoice.paid, add their credits once per reference.invoice.paidclears it.billing::{FREE, TEAM, STAFF, plan_by_id}, as today.add_purchased_creditsis a stopgap copy. The ledger is visualci features' (app::domain::credits, coming in their API PR). This switches to theirs when it lands, before merge.STRIPE_SECRET_KEYandSTRIPE_WEBHOOK_SECRETcome from the cluster's ExternalSecrets in production. Tests sign their own events and never call Stripe.Tests (
app/tests/billing.rs):Next: Checkout, the portal, packs, payment methods and invoices, then automatic reloads.