Skip to content

Commit

Permalink
fix #8079 -- purchasing: first month of subscription should charge th…
Browse files Browse the repository at this point in the history
…e subscription rate
  • Loading branch information
williamstein committed Dec 25, 2024
1 parent 914ea29 commit 33fc023
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/packages/util/licenses/store/compute-cost.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,15 @@ export function computeCost(
custom_member: member,
custom_uptime: uptime,
boost,
...fixRange(range, period, noRangeShift),
// For computing the *shopping cart checkout price* of a subscription,
// we remove the endpoints data. Otherwise, compute_cost(input).cost
// returns the price for that exact interval, not the generic monthly
// cost, since compute_cost is also used for refunds/value computations
// (though we never do prorated refunds of subscriptions anymore!).
// In particular, we only include start/end dates for explicit ranges.
...(period == "range"
? fixRange(range, period, noRangeShift)
: { start: null, end: null }),
};
return {
...compute_cost(input),
Expand Down

0 comments on commit 33fc023

Please sign in to comment.