mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-24 21:12:38 -04:00
72af966c9c
* Schedule subscription downgrades to occur at the current term end. If the plan is a downgrade, schedule the subscription change for term end. Use Recurly v3 API subscription change event instead of v2 update subscription. * Add ability for user to revert a pending subscription change In the case where a user has downgraded, but has since decided they'd rather stay on their current plan, we need a way to let them revert. It isn't enough to re-use a subscription change, because Recurly sees it as an attempt to make a change from the current plan to itself. Instead, we use a new dialog and call a new endpoint that has the specific intent of reverting the pending plan change, by calling the removeSubscriptionChange recurly client method. * Add message prompting users to contact support for immediate changes We're showing this in the confirmation modal for a plan change that would occur in the future, and and on the subscription page if a pending change is due. Most users shouldn't need this, but it should help them out if they find an edge case like moving from eg. Student (Annual) to Professional (Monthly) and were expecting to be "upgraded" immediately. GitOrigin-RevId: c5be0efbeb8568ed9caa941aadcef6f6db65c420
11 lines
323 B
JavaScript
11 lines
323 B
JavaScript
/**
|
|
* If the user changes to a less expensive plan, we shouldn't apply the change immediately.
|
|
* This is to avoid unintended/artifical credits on users Recurly accounts.
|
|
*/
|
|
function shouldPlanChangeAtTermEnd(oldPlan, newPlan) {
|
|
return oldPlan.price > newPlan.price
|
|
}
|
|
|
|
module.exports = {
|
|
shouldPlanChangeAtTermEnd,
|
|
}
|