Phase 14, part 3: Stripe's events

/billing/stripe takes Stripe's webhooks, signatures checked, each event
handled once, and keeps each team's subscription up to date: checkout, its
status, seats and period, failed and paid invoices, cancellation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-25 13:21:25 -07:00
co-authored by Claude Opus 5.5
parent 8fb79220e3
commit 4833f53e0d
9 changed files with 421 additions and 2 deletions
+1 -1
View File
@@ -298,7 +298,7 @@ func (s *Server) csrf(next http.Handler) http.Handler {
if c, err := r.Cookie(name); err == nil && len(c.Value) >= 32 {
token = c.Value
}
if !safeMethod(r.Method) && r.URL.Path != "/mcp" && !strings.HasPrefix(r.URL.Path, "/api/v1/") {
if !safeMethod(r.Method) && r.URL.Path != "/mcp" && !strings.HasPrefix(r.URL.Path, "/api/v1/") && r.URL.Path != "/billing/stripe" {
if token == "" || !sameToken(token, sentToken(r)) {
http.Error(w, "This form has expired: reload the page and try again.", http.StatusForbidden)
return