Skip to content

Commit fb24499

Browse files
desioracclaude
andcommitted
feat(checkout): add POST /create-checkout-session endpoint
Delegates to existing /v1/keys/setup handler for Stripe Checkout Session creation. Accessible at /create-checkout-session for pricing page CTAs. Also added to failover blocked paths for split-brain protection. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent bad5e7f commit fb24499

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

trust_layer/app.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ def _is_failover_mode() -> bool:
5454
"/v1/compliance-report",
5555
"/v1/contact",
5656
"/v1/track/event",
57+
"/create-checkout-session",
5758
}
5859

5960

@@ -1023,6 +1024,19 @@ async def setup_key(request: Request):
10231024
return _error_response("internal_error", f"Stripe error: {str(e)}", 500)
10241025

10251026

1027+
# --- POST /create-checkout-session (pricing page standard checkout) ---
1028+
1029+
@app.post("/create-checkout-session")
1030+
async def create_checkout_session(request: Request):
1031+
"""Standard Stripe Checkout Session endpoint for pricing page CTAs.
1032+
1033+
Delegates to the full /v1/keys/setup handler which creates a Stripe
1034+
Checkout Session (subscription mode, 14-day trial, Pro at 29 EUR/month).
1035+
Returns {checkout_url, session_id, customer_id, mode, plan, price_monthly_eur, proofs_per_month}.
1036+
"""
1037+
return await setup_key(request)
1038+
1039+
10261040
# --- GET /trial (landing page for README/CLI badge links) ---
10271041

10281042
@app.get("/trial")

0 commit comments

Comments
 (0)