Fix upgrade price calculation for EAP customers selecting monthly billing#318
Merged
Fix upgrade price calculation for EAP customers selecting monthly billing#318
Conversation
…ling stripePriceId() checked EAP status before billing interval, so EAP customers always got the yearly EAP price regardless of monthly/yearly selection. Move the monthly interval check first since no monthly EAP prices exist. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Separate plan price from Stripe proration line items so "New plan" shows the actual charge, not inflated totals - Calculate "Due today" from displayed charge minus credit (clamped to 0) - Show "(pro-rated)" label when using a prorated price - Show remaining credit note when unused time exceeds the new plan cost - Fix undefined route: customer.dashboard → dashboard Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
Subscription::stripePriceId()checked EAP status before billing interval, so EAP customers always got the yearly EAP Stripe price ID regardless of whether they selected monthly or yearly billing in the upgrade modal. This caused the upgrade preview to show identical (and incorrect) amounts for both intervals.stripePriceId(), since no monthly EAP prices exist — EAP discounts only apply to yearly billing. Added a null-coalescing fallback for plans without a dedicated monthly price ID.stripePriceId()code paths including the key regression case (forceEap: true, interval: 'month').Test plan
stripePriceId()scenariosMobilePricingTestpasses (21 tests)LicenseRenewalTestpasses (12 tests)🤖 Generated with Claude Code