mirror of https://github.com/zulip/zulip.git
stripe: Disable free trial for self hosted customers.
This commit is contained in:
parent
23d712391e
commit
eb92b31e1d
|
@ -1143,6 +1143,10 @@ class BillingSession(ABC):
|
|||
assert customer.stripe_customer_id is not None # for mypy
|
||||
self.ensure_current_plan_is_upgradable(customer, plan_tier)
|
||||
billing_cycle_anchor = None
|
||||
|
||||
if remote_server_legacy_plan is not None: # nocoverage
|
||||
# Legacy servers don't get an additional free trial.
|
||||
free_trial = False
|
||||
if should_schedule_upgrade_for_legacy_remote_server: # nocoverage
|
||||
assert remote_server_legacy_plan is not None
|
||||
billing_cycle_anchor = remote_server_legacy_plan.end_date
|
||||
|
|
|
@ -149,6 +149,9 @@ def remote_realm_plans_page(
|
|||
if context.customer_plan is None:
|
||||
context.on_free_tier = not context.is_sponsored
|
||||
else:
|
||||
if context.customer_plan.tier == CustomerPlan.TIER_SELF_HOSTED_LEGACY:
|
||||
# Free trial is disabled for legacy customers.
|
||||
context.free_trial_days = None
|
||||
context.on_free_tier = context.customer_plan.tier in (
|
||||
CustomerPlan.TIER_SELF_HOSTED_LEGACY,
|
||||
CustomerPlan.TIER_SELF_HOSTED_BASE,
|
||||
|
@ -198,6 +201,9 @@ def remote_server_plans_page(
|
|||
if context.customer_plan is None:
|
||||
context.on_free_tier = not context.is_sponsored
|
||||
else:
|
||||
if context.customer_plan.tier == CustomerPlan.TIER_SELF_HOSTED_LEGACY:
|
||||
# Free trial is disabled for legacy customers.
|
||||
context.free_trial_days = None
|
||||
context.on_free_tier = context.customer_plan.tier in (
|
||||
CustomerPlan.TIER_SELF_HOSTED_LEGACY,
|
||||
CustomerPlan.TIER_SELF_HOSTED_BASE,
|
||||
|
|
Loading…
Reference in New Issue