Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

stripe: Disable free trial for self hosted customers.

Aman Agrawaleb92b31e1d00
diff --git a/corporate/lib/stripe.py b/corporate/lib/stripe.py
index 3055bf2a436..cb65a4e7a44 100644
--- a/corporate/lib/stripe.py
+++ b/corporate/lib/stripe.py
@@ -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
diff --git a/corporate/views/portico.py b/corporate/views/portico.py
index cf86f07f54e..473cb1a7437 100644
--- a/corporate/views/portico.py
+++ b/corporate/views/portico.py
@@ -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,