feat: support Stripe discount coupons in promo registration #392
No reviewers
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo_admin/basketball-api!392
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "391-stripe-discount-coupons"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Promo codes now support two paths: free codes (from the env var list) bypass payment entirely, while Stripe promotion codes create a discounted checkout session with the coupon applied. Invalid codes that match neither path return 400.
Closes #391
Changes
src/basketball_api/routes/register.py: Split promo validation into free-code check and StripePromotionCode.listfallback. Addedpromo_discountsignup method and discounted Stripe checkout session creation withdiscountsparameter.tests/test_promo_registration.py: Added test for Stripe discount promo redirect, test for free code still working without Stripe, updated invalid code test to mockstripe.PromotionCode.list.Test Plan
pytest tests/test_promo_registration.py -v-- 24/24 passedReview Checklist
discountsparamRelated Notes
2f5ded5d0ef695e3ba1b