[PM-34582] Include schedule discount in premium tax estimate#7385
Conversation
|
New Issues (121)Checkmarx found the following issues in this Pull Request
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7385 +/- ##
=======================================
Coverage 58.43% 58.44%
=======================================
Files 2060 2060
Lines 91173 91178 +5
Branches 8112 8114 +2
=======================================
+ Hits 53281 53287 +6
+ Misses 36003 36002 -1
Partials 1889 1889 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
When a subscription has an active schedule during the ~15-day window before renewal, the invoice preview for tax estimation was built with the new price but without the Phase 2 discount coupon. This caused the estimated tax on the subscription page to be higher than what Stripe would actually charge. Pass the coupon ID from the schedule's Phase 2 discount through to EstimatePremiumTaxAsync so it is included in the InvoiceCreatePreviewOptions.
c53ebfc to
c620b39
Compare
Bitwarden Claude Code ReviewOverall Assessment: APPROVE This PR fixes a tax estimation discrepancy for premium subscriptions on legacy pricing with an active Phase 2 schedule discount. The Code Review DetailsNo findings. The tuple approach cleanly separates the frontend-facing |
|






🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-34582
📔 Objective
When a Premium subscription has an active schedule during the ~15-day window before renewal, the estimated tax on the subscription page was computed against the full new price without accounting for the Phase 2 discount coupon (e.g.,
milestone-2c). This caused a discrepancy between the tax shown in the Bitwarden UI and what Stripe would actually charge at renewal.The fix passes the Phase 2 coupon ID through to the invoice preview so Stripe computes tax on the discounted amount, matching the actual renewal charge.
Changes:
GetSchedulePhase2DiscountAsyncnow returns both theBitwardenDiscountand the Stripe coupon IDEstimatePremiumTaxAsyncincludes the coupon inInvoiceCreatePreviewOptions.Discountswhen present