Skip to content

Launch coupon: Stripe's coupon state is the only switch - #83

Merged
ryuzdev merged 1 commit into
mainfrom
coupon-endable
Oct 26, 2026
Merged

ryuzdev merged 1 commit into
mainfrom
coupon-endable

Conversation

@ryuzdev

@ryuzdev ryuzdev commented Oct 26, 2026

Copy link
Copy Markdown
Member

Owner: "make it endable via Stripe UI, I'll end them when I feel like."

  • Before each checkout, Outer reads GET /v1/coupons/{STRIPE_LAUNCH_COUPON} (cached 5 min inside the billing client) and applies the coupon only when it exists and is valid. If the coupon is deleted or expired in the dashboard, or the lookup fails, checkout is full price; a promo never blocks a sale.
  • The Console account summary gains launch_discount_active. The upgrade dialog, the upgrade reply and Pro refusals mention $4 only while it's active.
  • Docs and spec updated: the owner ends the promo in Stripe; existing subscribers keep whatever Stripe says.
  • Tests: live coupon applied; deleted (404) → full price; valid:false → full price; Stripe 500 → full price; lookup cached.

Live (outer:81d3501): with a throwaway Free account, upgrade → Checkout session subtotal 800, total 400, discount outer-launch-50. Account deleted.

Checkout looks up GET /v1/coupons/{id} before minting a session and
applies the coupon only while Stripe says valid: true. A 404 or
valid: false means full price; any other lookup failure also means
full price with a warn, so a promo never blocks a sale. Lookups cache
for five minutes inside the Stripe client, never globally.

The same lookup feeds launch_discount_active on the console account
summary; the upgrade dialog, upgrade tool text and the custom-domain
Pro refusal name the $4 launch price only while it is active.

Spec §3/§14.2/§18/Q4, plans doc, env example and the generated tool
reference updated: the owner ends the promo in Stripe, existing
subscribers keep whatever Stripe says.
@coderabbitai

coderabbitai Bot commented Oct 26, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 43 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 58ea90ad-c848-4858-acd8-0e1978a90bd2
Commits

Reviewing files that changed from the base of the PR and between 6a88a39 and 81d3501.

Files selected for processing: 15
  • crates/outer/src/apps/domains.rs
  • crates/outer/src/billing/mod.rs
  • crates/outer/src/billing/stripe.rs
  • crates/outer/src/config.rs
  • crates/outer/src/http/console_account.rs
  • crates/outer/src/http/console_billing.rs
  • crates/outer/src/http/console_domains.rs
  • crates/outer/src/mcp/registry.rs
  • crates/outer/src/mcp/tools/billing.rs
  • crates/outer/src/mcp/tools/domains.rs
  • deploy/outer.env.example
  • web/docs/account/plans.mdx
  • web/docs/reference/tools.md
  • web/pages/console/_islands/api.ts
  • web/pages/console/_islands/views/account.tsx
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ryuzdev

ryuzdev commented Oct 26, 2026

Copy link
Copy Markdown
Member Author

CodeRabbit is out of free reviews. Merging on green CI plus the live checkout in the description.

@ryuzdev
ryuzdev merged commit e43f6d8 into main Oct 26, 2026
4 checks passed
@ryuzdev
ryuzdev deleted the coupon-endable branch October 26, 2026 20:13
@ryuzdev ryuzdev mentioned this pull request Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant