Repository navigation
Commit 7fbc4dc
authored
## Summary
Disable Stripe Adaptive Pricing on checkout sessions created with a
resolved promotion code, pinning presentment to the price's native USD
currency.
Stripe evaluates a promotion code's `minimum_amount` restriction against
the checkout session's presentment currency. With Adaptive Pricing
enabled, a EUR customer's converted total (e.g. €249 for the $269
Unlimited yearly price) falls below the USD-authored $269 minimum on the
Unlimited yearly activation codes, and redemption fails with "code is
valid but order total is below the minimum amount" even though the code
is valid. With presentment pinned to USD, the minimum passes and the
100%-off first-year coupon applies for any customer.
Scope note: minimal durable fix by design. It does not add a coupon
fallback — the upgrade path is repo-contracted to apply promotion codes,
never raw coupons, to preserve Stripe-side restrictions and redemption
tracking — and it does not change trial handling (#23300 tracks that
separately).
Fixes #23299
## Failure-Class
Failure-Class: none
## Testing
- New `backend/tests/unit/test_payment_promo_adaptive_pricing.py`: promo
sessions set `adaptive_pricing={'enabled': False}`; promo-free sessions
keep Stripe's default; static contract scopes the pin to the promo
branch.
- Existing `backend/tests/unit/test_payment_promotion_codes.py` stays
green — its no-coupon contract on checkout/upgrade is untouched.
- Both suites run locally green on this head via the worktree venv;
backend CI re-runs them on this PR.
2 files changed
Lines changed: 78 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
87 | 92 | | |
88 | 93 | | |
89 | 94 | | |
| |||
0 commit comments