Repository navigation
Launch coupon: Stripe's coupon state is the only switch - #83
Merged
Merged
Conversation
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.
|
Warning Review limit reachedYou'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. View limit details
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. Comment |
Member
Author
|
CodeRabbit is out of free reviews. Merging on green CI plus the live checkout in the description. |
Merged
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.
Owner: "make it endable via Stripe UI, I'll end them when I feel like."
GET /v1/coupons/{STRIPE_LAUNCH_COUPON}(cached 5 min inside the billing client) and applies the coupon only when it exists and isvalid. If the coupon is deleted or expired in the dashboard, or the lookup fails, checkout is full price; a promo never blocks a sale.launch_discount_active. The upgrade dialog, theupgradereply and Pro refusals mention $4 only while it's active.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, discountouter-launch-50. Account deleted.