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.

free_trial: Remove extra onboarding flow.

Aman Agrawald82efbd50374
diff --git a/corporate/lib/stripe.py b/corporate/lib/stripe.py
index e6619c2266e..1ea407ad4be 100644
--- a/corporate/lib/stripe.py
+++ b/corporate/lib/stripe.py
@@ -441,14 +441,12 @@ class UpgradeRequest:
schedule: str
signed_seat_count: str
salt: str
- onboarding: bool
license_management: Optional[str]
licenses: Optional[int]
@dataclass
class InitialUpgradeRequest:
- onboarding: bool
manual_license_management: bool
tier: int
@@ -1221,13 +1219,8 @@ class BillingSession(ABC):
if self.is_sponsored_or_pending(customer):
return reverse("sponsorship_request"), None
- onboarding = initial_upgrade_request.onboarding
billing_page_url = reverse("billing_home")
- if customer is not None and (
- get_current_plan_by_customer(customer) is not None or onboarding
- ):
- if onboarding:
- billing_page_url = f"{billing_page_url}?onboarding=true"
+ if customer is not None and (get_current_plan_by_customer(customer) is not None):
return billing_page_url, None
percent_off = Decimal(0)
@@ -1250,7 +1243,6 @@ class BillingSession(ABC):
"exempt_from_license_number_check": exempt_from_license_number_check,
"plan": "Zulip Cloud Standard",
"free_trial_days": settings.FREE_TRIAL_DAYS,
- "onboarding": onboarding,
"page_params": {
"seat_count": seat_count,
"annual_price": get_price_per_license(tier, CustomerPlan.ANNUAL, percent_off),
diff --git a/corporate/tests/stripe_fixtures/free_trial_upgrade_by_card_from_onboarding_page--Charge.list.1.json b/corporate/tests/stripe_fixtures/free_trial_upgrade_by_card_from_onboarding_page--Charge.list.1.json
deleted file mode 100644
index 75910611cf3..00000000000
--- a/corporate/tests/stripe_fixtures/free_trial_upgrade_by_card_from_onboarding_page--Charge.list.1.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "data": [],
- "has_more": false,
- "object": "list",
- "url": "/v1/charges"
-}
diff --git a/corporate/tests/stripe_fixtures/free_trial_upgrade_by_card_from_onboarding_page--Customer.create.1.json b/corporate/tests/stripe_fixtures/free_trial_upgrade_by_card_from_onboarding_page--Customer.create.1.json
deleted file mode 100644
index c9219e149c0..00000000000
--- a/corporate/tests/stripe_fixtures/free_trial_upgrade_by_card_from_onboarding_page--Customer.create.1.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "address": null,
- "balance": 0,
- "created": 1010000001,
- "currency": null,
- "default_currency": null,
- "default_source": null,
- "delinquent": false,
- "description": "zulip (Zulip Dev)",
- "discount": null,
- "email": "[email protected]",
- "id": "cus_NORMALIZED0001",
- "invoice_prefix": "NORMA01",
- "invoice_settings": {
- "custom_fields": null,
- "default_payment_method": null,
- "footer": null,
- "rendering_options": null
- },
- "livemode": false,
- "metadata": {
- "realm_id": "1",
- "realm_str": "zulip"
- },
- "name": null,
- "next_invoice_sequence": 1,
- "object": "customer",
- "phone": null,
- "preferred_locales": [],
- "shipping": null,
- "tax_exempt": "none",
- "test_clock": null
-}
diff --git a/corporate/tests/stripe_fixtures/free_trial_upgrade_by_card_from_onboarding_page--Customer.modify.1.json b/corporate/tests/stripe_fixtures/free_trial_upgrade_by_card_from_onboarding_page--Customer.modify.1.json
deleted file mode 100644
index c0e16c97b3c..00000000000
--- a/corporate/tests/stripe_fixtures/free_trial_upgrade_by_card_from_onboarding_page--Customer.modify.1.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "address": null,
- "balance": 0,
- "created": 1010000001,
- "currency": null,
- "default_currency": null,
- "default_source": null,
- "delinquent": false,
- "description": "zulip (Zulip Dev)",
- "discount": null,
- "email": "[email protected]",
- "id": "cus_NORMALIZED0001",
- "invoice_prefix": "NORMA01",
- "invoice_settings": {
- "custom_fields": null,
- "default_payment_method": "pm_1ODZZRDEQaroqDjsrQSLSUaJ",
- "footer": null,
- "rendering_options": null
- },
- "livemode": false,
- "metadata": {
- "realm_id": "1",
- "realm_str": "zulip"
- },
- "name": null,
- "next_invoice_sequence": 1,
- "object": "customer",
- "phone": null,
- "preferred_locales": [],
- "shipping": null,
- "tax_exempt": "none",
- "test_clock": null
-}
diff --git a/corporate/tests/stripe_fixtures/free_trial_upgrade_by_card_from_onboarding_page--Customer.retrieve.1.json b/corporate/tests/stripe_fixtures/free_trial_upgrade_by_card_from_onboarding_page--Customer.retrieve.1.json
deleted file mode 100644
index 560122bcb6f..00000000000
--- a/corporate/tests/stripe_fixtures/free_trial_upgrade_by_card_from_onboarding_page--Customer.retrieve.1.json
+++ /dev/null
@@ -1,79 +0,0 @@
-{
- "address": null,
- "balance": 0,
- "created": 1010000001,
- "currency": null,
- "default_currency": null,
- "default_source": null,
- "delinquent": false,
- "description": "zulip (Zulip Dev)",
- "discount": null,
- "email": "[email protected]",
- "id": "cus_NORMALIZED0001",
- "invoice_prefix": "NORMA01",
- "invoice_settings": {
- "custom_fields": null,
- "default_payment_method": {
- "billing_details": {
- "address": {
- "city": null,
- "country": null,
- "line1": null,
- "line2": null,
- "postal_code": null,
- "state": null
- },
- "email": null,
- "name": null,
- "phone": null
- },
- "card": {
- "brand": "visa",
- "checks": {
- "address_line1_check": null,
- "address_postal_code_check": null,
- "cvc_check": "pass"
- },
- "country": "US",
- "exp_month": 11,
- "exp_year": 2024,
- "fingerprint": "NORMALIZED000001",
- "funding": "credit",
- "generated_from": null,
- "last4": "4242",
- "networks": {
- "available": [
- "visa"
- ],
- "preferred": null
- },
- "three_d_secure_usage": {
- "supported": true
- },
- "wallet": null
- },
- "created": 1010000002,
- "customer": "cus_NORMALIZED0001",
- "id": "pm_1ODZZRDEQaroqDjsrQSLSUaJ",
- "livemode": false,
- "metadata": {},
- "object": "payment_method",
- "type": "card"
- },
- "footer": null,
- "rendering_options": null
- },
- "livemode": false,
- "metadata": {
- "realm_id": "1",
- "realm_str": "zulip"
- },
- "name": null,
- "next_invoice_sequence": 1,
- "object": "customer",
- "phone": null,
- "preferred_locales": [],
- "shipping": null,
- "tax_exempt": "none",
- "test_clock": null
-}
diff --git a/corporate/tests/stripe_fixtures/free_trial_upgrade_by_card_from_onboarding_page--Customer.retrieve.2.json b/corporate/tests/stripe_fixtures/free_trial_upgrade_by_card_from_onboarding_page--Customer.retrieve.2.json
deleted file mode 100644
index 560122bcb6f..00000000000
--- a/corporate/tests/stripe_fixtures/free_trial_upgrade_by_card_from_onboarding_page--Customer.retrieve.2.json
+++ /dev/null
@@ -1,79 +0,0 @@
-{
- "address": null,
- "balance": 0,
- "created": 1010000001,
- "currency": null,
- "default_currency": null,
- "default_source": null,
- "delinquent": false,
- "description": "zulip (Zulip Dev)",
- "discount": null,
- "email": "[email protected]",
- "id": "cus_NORMALIZED0001",
- "invoice_prefix": "NORMA01",
- "invoice_settings": {
- "custom_fields": null,
- "default_payment_method": {
- "billing_details": {
- "address": {
- "city": null,
- "country": null,
- "line1": null,
- "line2": null,
- "postal_code": null,
- "state": null
- },
- "email": null,
- "name": null,
- "phone": null
- },
- "card": {
- "brand": "visa",
- "checks": {
- "address_line1_check": null,
- "address_postal_code_check": null,
- "cvc_check": "pass"
- },
- "country": "US",
- "exp_month": 11,
- "exp_year": 2024,
- "fingerprint": "NORMALIZED000001",
- "funding": "credit",
- "generated_from": null,
- "last4": "4242",
- "networks": {
- "available": [
- "visa"
- ],
- "preferred": null
- },
- "three_d_secure_usage": {
- "supported": true
- },
- "wallet": null
- },
- "created": 1010000002,
- "customer": "cus_NORMALIZED0001",
- "id": "pm_1ODZZRDEQaroqDjsrQSLSUaJ",
- "livemode": false,
- "metadata": {},
- "object": "payment_method",
- "type": "card"
- },
- "footer": null,
- "rendering_options": null
- },
- "livemode": false,
- "metadata": {
- "realm_id": "1",
- "realm_str": "zulip"
- },
- "name": null,
- "next_invoice_sequence": 1,
- "object": "customer",
- "phone": null,
- "preferred_locales": [],
- "shipping": null,
- "tax_exempt": "none",
- "test_clock": null
-}
diff --git a/corporate/tests/stripe_fixtures/free_trial_upgrade_by_card_from_onboarding_page--Customer.retrieve.3.json b/corporate/tests/stripe_fixtures/free_trial_upgrade_by_card_from_onboarding_page--Customer.retrieve.3.json
deleted file mode 100644
index 560122bcb6f..00000000000
--- a/corporate/tests/stripe_fixtures/free_trial_upgrade_by_card_from_onboarding_page--Customer.retrieve.3.json
+++ /dev/null
@@ -1,79 +0,0 @@
-{
- "address": null,
- "balance": 0,
- "created": 1010000001,
- "currency": null,
- "default_currency": null,
- "default_source": null,
- "delinquent": false,
- "description": "zulip (Zulip Dev)",
- "discount": null,
- "email": "[email protected]",
- "id": "cus_NORMALIZED0001",
- "invoice_prefix": "NORMA01",
- "invoice_settings": {
- "custom_fields": null,
- "default_payment_method": {
- "billing_details": {
- "address": {
- "city": null,
- "country": null,
- "line1": null,
- "line2": null,
- "postal_code": null,
- "state": null
- },
- "email": null,
- "name": null,
- "phone": null
- },
- "card": {
- "brand": "visa",
- "checks": {
- "address_line1_check": null,
- "address_postal_code_check": null,
- "cvc_check": "pass"
- },
- "country": "US",
- "exp_month": 11,
- "exp_year": 2024,
- "fingerprint": "NORMALIZED000001",
- "funding": "credit",
- "generated_from": null,
- "last4": "4242",
- "networks": {
- "available": [
- "visa"
- ],
- "preferred": null
- },
- "three_d_secure_usage": {
- "supported": true
- },
- "wallet": null
- },
- "created": 1010000002,
- "customer": "cus_NORMALIZED0001",
- "id": "pm_1ODZZRDEQaroqDjsrQSLSUaJ",
- "livemode": false,
- "metadata": {},
- "object": "payment_method",
- "type": "card"
- },
- "footer": null,
- "rendering_options": null
- },
- "livemode": false,
- "metadata": {
- "realm_id": "1",
- "realm_str": "zulip"
- },
- "name": null,
- "next_invoice_sequence": 1,
- "object": "customer",
- "phone": null,
- "preferred_locales": [],
- "shipping": null,
- "tax_exempt": "none",
- "test_clock": null
-}
diff --git a/corporate/tests/stripe_fixtures/free_trial_upgrade_by_card_from_onboarding_page--Customer.retrieve.4.json b/corporate/tests/stripe_fixtures/free_trial_upgrade_by_card_from_onboarding_page--Customer.retrieve.4.json
deleted file mode 100644
index 560122bcb6f..00000000000
--- a/corporate/tests/stripe_fixtures/free_trial_upgrade_by_card_from_onboarding_page--Customer.retrieve.4.json
+++ /dev/null
@@ -1,79 +0,0 @@
-{
- "address": null,
- "balance": 0,
- "created": 1010000001,
- "currency": null,
- "default_currency": null,
- "default_source": null,
- "delinquent": false,
- "description": "zulip (Zulip Dev)",
- "discount": null,
- "email": "[email protected]",
- "id": "cus_NORMALIZED0001",
- "invoice_prefix": "NORMA01",
- "invoice_settings": {
- "custom_fields": null,
- "default_payment_method": {
- "billing_details": {
- "address": {
- "city": null,
- "country": null,
- "line1": null,
- "line2": null,
- "postal_code": null,
- "state": null
- },
- "email": null,
- "name": null,
- "phone": null
- },
- "card": {
- "brand": "visa",
- "checks": {
- "address_line1_check": null,
- "address_postal_code_check": null,
- "cvc_check": "pass"
- },
- "country": "US",
- "exp_month": 11,
- "exp_year": 2024,
- "fingerprint": "NORMALIZED000001",
- "funding": "credit",
- "generated_from": null,
- "last4": "4242",
- "networks": {
- "available": [
- "visa"
- ],
- "preferred": null
- },
- "three_d_secure_usage": {
- "supported": true
- },
- "wallet": null
- },
- "created": 1010000002,
- "customer": "cus_NORMALIZED0001",
- "id": "pm_1ODZZRDEQaroqDjsrQSLSUaJ",
- "livemode": false,
- "metadata": {},
- "object": "payment_method",
- "type": "card"
- },
- "footer": null,
- "rendering_options": null
- },
- "livemode": false,
- "metadata": {
- "realm_id": "1",
- "realm_str": "zulip"
- },
- "name": null,
- "next_invoice_sequence": 1,
- "object": "customer",
- "phone": null,
- "preferred_locales": [],
- "shipping": null,
- "tax_exempt": "none",
- "test_clock": null
-}
diff --git a/corporate/tests/stripe_fixtures/free_trial_upgrade_by_card_from_onboarding_page--Event.list.1.json b/corporate/tests/stripe_fixtures/free_trial_upgrade_by_card_from_onboarding_page--Event.list.1.json
deleted file mode 100644
index 633af4469b9..00000000000
--- a/corporate/tests/stripe_fixtures/free_trial_upgrade_by_card_from_onboarding_page--Event.list.1.json
+++ /dev/null
@@ -1,60 +0,0 @@
-{
- "data": [
- {
- "api_version": "2020-08-27",
- "created": 1010000003,
- "data": {
- "object": {
- "address": null,
- "balance": 0,
- "created": 1010000001,
- "currency": null,
- "default_currency": null,
- "default_source": null,
- "delinquent": false,
- "description": "zulip (Zulip Dev)",
- "discount": null,
- "email": "[email protected]",
- "id": "cus_NORMALIZED0001",
- "invoice_prefix": "NORMA01",
- "invoice_settings": {
- "custom_fields": null,
- "default_payment_method": "pm_1ODZZRDEQaroqDjsrQSLSUaJ",
- "footer": null,
- "rendering_options": null
- },
- "livemode": false,
- "metadata": {
- "realm_id": "1",
- "realm_str": "zulip"
- },
- "name": null,
- "next_invoice_sequence": 1,
- "object": "customer",
- "phone": null,
- "preferred_locales": [],
- "shipping": null,
- "tax_exempt": "none",
- "test_clock": null
- },
- "previous_attributes": {
- "invoice_settings": {
- "default_payment_method": null
- }
- }
- },
- "id": "evt_1ODZZTDEQaroqDjsBshgdIJc",
- "livemode": false,
- "object": "event",
- "pending_webhooks": 0,
- "request": {
- "id": "req_NORMALIZED0001",
- "idempotency_key": "5e353503-ef30-46b4-bfeb-f5428920ad7b"
- },
- "type": "customer.updated"
- }
- ],
- "has_more": true,
- "object": "list",
- "url": "/v1/events"
-}
diff --git a/corporate/tests/stripe_fixtures/free_trial_upgrade_by_card_from_onboarding_page--Invoice.list.1.json b/corporate/tests/stripe_fixtures/free_trial_upgrade_by_card_from_onboarding_page--Invoice.list.1.json
deleted file mode 100644
index e39960ab725..00000000000
--- a/corporate/tests/stripe_fixtures/free_trial_upgrade_by_card_from_onboarding_page--Invoice.list.1.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "data": [],
- "has_more": false,
- "object": "list",
- "url": "/v1/invoices"
-}
diff --git a/corporate/tests/stripe_fixtures/free_trial_upgrade_by_card_from_onboarding_page--Invoice.list.2.json b/corporate/tests/stripe_fixtures/free_trial_upgrade_by_card_from_onboarding_page--Invoice.list.2.json
deleted file mode 100644
index e39960ab725..00000000000
--- a/corporate/tests/stripe_fixtures/free_trial_upgrade_by_card_from_onboarding_page--Invoice.list.2.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "data": [],
- "has_more": false,
- "object": "list",
- "url": "/v1/invoices"
-}
diff --git a/corporate/tests/stripe_fixtures/free_trial_upgrade_by_card_from_onboarding_page--SetupIntent.create.1.json b/corporate/tests/stripe_fixtures/free_trial_upgrade_by_card_from_onboarding_page--SetupIntent.create.1.json
deleted file mode 100644
index dd18e456fcb..00000000000
--- a/corporate/tests/stripe_fixtures/free_trial_upgrade_by_card_from_onboarding_page--SetupIntent.create.1.json
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "application": null,
- "automatic_payment_methods": null,
- "cancellation_reason": null,
- "client_secret": "seti_1ODZZRDEQaroqDjskV2dJcGP_secret_P1cpSESeM1nG22EH125PZvuHAYVoUFb",
- "created": 1010000002,
- "customer": "cus_NORMALIZED0001",
- "description": null,
- "flow_directions": null,
- "id": "seti_1ODZZRDEQaroqDjskV2dJcGP",
- "last_setup_error": null,
- "latest_attempt": "setatt_1ODZZRDEQaroqDjsCfInjHwO",
- "livemode": false,
- "mandate": null,
- "metadata": {},
- "next_action": null,
- "object": "setup_intent",
- "on_behalf_of": null,
- "payment_method": "pm_1ODZZRDEQaroqDjsrQSLSUaJ",
- "payment_method_configuration_details": null,
- "payment_method_options": {
- "card": {
- "mandate_options": null,
- "network": null,
- "request_three_d_secure": "automatic"
- }
- },
- "payment_method_types": [
- "card"
- ],
- "single_use_mandate": null,
- "status": "succeeded",
- "usage": "off_session"
-}
diff --git a/corporate/tests/stripe_fixtures/free_trial_upgrade_by_card_from_onboarding_page--SetupIntent.list.1.json b/corporate/tests/stripe_fixtures/free_trial_upgrade_by_card_from_onboarding_page--SetupIntent.list.1.json
deleted file mode 100644
index bcbbb6a78f7..00000000000
--- a/corporate/tests/stripe_fixtures/free_trial_upgrade_by_card_from_onboarding_page--SetupIntent.list.1.json
+++ /dev/null
@@ -1,41 +0,0 @@
-{
- "data": [
- {
- "application": null,
- "automatic_payment_methods": null,
- "cancellation_reason": null,
- "client_secret": "seti_1ODZZRDEQaroqDjsKRr7mIAj_secret_P1cpnZKQuyuH3xAJUfmHjIGbVXARLYL",
- "created": 1010000002,
- "customer": "cus_NORMALIZED0001",
- "description": null,
- "flow_directions": null,
- "id": "seti_1ODZZRDEQaroqDjsKRr7mIAj",
- "last_setup_error": null,
- "latest_attempt": null,
- "livemode": false,
- "mandate": null,
- "metadata": {},
- "next_action": null,
- "object": "setup_intent",
- "on_behalf_of": null,
- "payment_method": null,
- "payment_method_configuration_details": null,
- "payment_method_options": {
- "card": {
- "mandate_options": null,
- "network": null,
- "request_three_d_secure": "automatic"
- }
- },
- "payment_method_types": [
- "card"
- ],
- "single_use_mandate": null,
- "status": "requires_payment_method",
- "usage": "off_session"
- }
- ],
- "has_more": true,
- "object": "list",
- "url": "/v1/setup_intents"
-}
diff --git a/corporate/tests/stripe_fixtures/free_trial_upgrade_by_card_from_onboarding_page--SetupIntent.retrieve.1.json b/corporate/tests/stripe_fixtures/free_trial_upgrade_by_card_from_onboarding_page--SetupIntent.retrieve.1.json
deleted file mode 100644
index dd18e456fcb..00000000000
--- a/corporate/tests/stripe_fixtures/free_trial_upgrade_by_card_from_onboarding_page--SetupIntent.retrieve.1.json
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "application": null,
- "automatic_payment_methods": null,
- "cancellation_reason": null,
- "client_secret": "seti_1ODZZRDEQaroqDjskV2dJcGP_secret_P1cpSESeM1nG22EH125PZvuHAYVoUFb",
- "created": 1010000002,
- "customer": "cus_NORMALIZED0001",
- "description": null,
- "flow_directions": null,
- "id": "seti_1ODZZRDEQaroqDjskV2dJcGP",
- "last_setup_error": null,
- "latest_attempt": "setatt_1ODZZRDEQaroqDjsCfInjHwO",
- "livemode": false,
- "mandate": null,
- "metadata": {},
- "next_action": null,
- "object": "setup_intent",
- "on_behalf_of": null,
- "payment_method": "pm_1ODZZRDEQaroqDjsrQSLSUaJ",
- "payment_method_configuration_details": null,
- "payment_method_options": {
- "card": {
- "mandate_options": null,
- "network": null,
- "request_three_d_secure": "automatic"
- }
- },
- "payment_method_types": [
- "card"
- ],
- "single_use_mandate": null,
- "status": "succeeded",
- "usage": "off_session"
-}
diff --git a/corporate/tests/stripe_fixtures/free_trial_upgrade_by_card_from_onboarding_page--checkout.Session.create.1.json b/corporate/tests/stripe_fixtures/free_trial_upgrade_by_card_from_onboarding_page--checkout.Session.create.1.json
deleted file mode 100644
index da35654d9a4..00000000000
--- a/corporate/tests/stripe_fixtures/free_trial_upgrade_by_card_from_onboarding_page--checkout.Session.create.1.json
+++ /dev/null
@@ -1,73 +0,0 @@
-{
- "after_expiration": null,
- "allow_promotion_codes": null,
- "amount_subtotal": null,
- "amount_total": null,
- "automatic_tax": {
- "enabled": false,
- "status": null
- },
- "billing_address_collection": null,
- "cancel_url": "http://zulip.testserver/upgrade/",
- "client_reference_id": null,
- "client_secret": null,
- "consent": null,
- "consent_collection": null,
- "created": 1010000002,
- "currency": null,
- "currency_conversion": null,
- "custom_fields": [],
- "custom_text": {
- "shipping_address": null,
- "submit": null,
- "terms_of_service_acceptance": null
- },
- "customer": "cus_NORMALIZED0001",
- "customer_creation": null,
- "customer_details": {
- "address": null,
- "email": "[email protected]",
- "name": null,
- "phone": null,
- "tax_exempt": null,
- "tax_ids": null
- },
- "customer_email": null,
- "expires_at": 1000000000,
- "id": "cs_test_NORMALIZED01wAeANjIweBWJFUmSkNwS2S59Hyt6pCLi5rgpYr31ncZaBq",
- "invoice": null,
- "invoice_creation": null,
- "livemode": false,
- "locale": null,
- "metadata": {
- "type": "card_update",
- "user_id": "10"
- },
- "mode": "setup",
- "object": "checkout.session",
- "payment_intent": null,
- "payment_link": null,
- "payment_method_collection": "always",
- "payment_method_configuration_details": null,
- "payment_method_options": {},
- "payment_method_types": [
- "card"
- ],
- "payment_status": "no_payment_required",
- "phone_number_collection": {
- "enabled": false
- },
- "recovered_from": null,
- "setup_intent": "seti_1ODZZRDEQaroqDjsKRr7mIAj",
- "shipping": null,
- "shipping_address_collection": null,
- "shipping_options": [],
- "shipping_rate": null,
- "status": "open",
- "submit_type": null,
- "subscription": null,
- "success_url": "http://zulip.testserver/billing/event_status?stripe_session_id={CHECKOUT_SESSION_ID}",
- "total_details": null,
- "ui_mode": "hosted",
- "url": "https://checkout.stripe.com/c/pay/cs_test_NORMALIZED01wAeANjIweBWJFUmSkNwS2S59Hyt6pCLi5rgpYr31ncZaBq#fidkdWxOYHwnPyd1blpxYHZxWl1UZjFOczZJXUE2PUpzUWNPV2ZpdlFzUCcpJ2N3amhWYHdzYHcnP3F3cGApJ2lkfGpwcVF8dWAnPyd2bGtiaWBaZmppcGhrJyknYGtkZ2lgVWlkZmBtamlhYHd2Jz9xd3BgeCUl"
-}
diff --git a/corporate/tests/stripe_fixtures/free_trial_upgrade_by_card_from_onboarding_page--checkout.Session.list.1.json b/corporate/tests/stripe_fixtures/free_trial_upgrade_by_card_from_onboarding_page--checkout.Session.list.1.json
deleted file mode 100644
index 3662836ea4c..00000000000
--- a/corporate/tests/stripe_fixtures/free_trial_upgrade_by_card_from_onboarding_page--checkout.Session.list.1.json
+++ /dev/null
@@ -1,80 +0,0 @@
-{
- "data": [
- {
- "after_expiration": null,
- "allow_promotion_codes": null,
- "amount_subtotal": null,
- "amount_total": null,
- "automatic_tax": {
- "enabled": false,
- "status": null
- },
- "billing_address_collection": null,
- "cancel_url": "http://zulip.testserver/upgrade/",
- "client_reference_id": null,
- "client_secret": null,
- "consent": null,
- "consent_collection": null,
- "created": 1010000002,
- "currency": null,
- "currency_conversion": null,
- "custom_fields": [],
- "custom_text": {
- "shipping_address": null,
- "submit": null,
- "terms_of_service_acceptance": null
- },
- "customer": "cus_NORMALIZED0001",
- "customer_creation": null,
- "customer_details": {
- "address": null,
- "email": "[email protected]",
- "name": null,
- "phone": null,
- "tax_exempt": null,
- "tax_ids": null
- },
- "customer_email": null,
- "expires_at": 1000000000,
- "id": "cs_test_NORMALIZED01wAeANjIweBWJFUmSkNwS2S59Hyt6pCLi5rgpYr31ncZaBq",
- "invoice": null,
- "invoice_creation": null,
- "livemode": false,
- "locale": null,
- "metadata": {
- "type": "card_update",
- "user_id": "10"
- },
- "mode": "setup",
- "object": "checkout.session",
- "payment_intent": null,
- "payment_link": null,
- "payment_method_collection": "always",
- "payment_method_configuration_details": null,
- "payment_method_options": {},
- "payment_method_types": [
- "card"
- ],
- "payment_status": "no_payment_required",
- "phone_number_collection": {
- "enabled": false
- },
- "recovered_from": null,
- "setup_intent": "seti_1ODZZRDEQaroqDjsKRr7mIAj",
- "shipping": null,
- "shipping_address_collection": null,
- "shipping_options": [],
- "shipping_rate": null,
- "status": "open",
- "submit_type": null,
- "subscription": null,
- "success_url": "http://zulip.testserver/billing/event_status?stripe_session_id={CHECKOUT_SESSION_ID}",
- "total_details": null,
- "ui_mode": "hosted",
- "url": "https://checkout.stripe.com/c/pay/cs_test_NORMALIZED01wAeANjIweBWJFUmSkNwS2S59Hyt6pCLi5rgpYr31ncZaBq#fidkdWxOYHwnPyd1blpxYHZxWl1UZjFOczZJXUE2PUpzUWNPV2ZpdlFzUCcpJ2N3amhWYHdzYHcnP3F3cGApJ2lkfGpwcVF8dWAnPyd2bGtiaWBaZmppcGhrJyknYGtkZ2lgVWlkZmBtamlhYHd2Jz9xd3BgeCUl"
- }
- ],
- "has_more": true,
- "object": "list",
- "url": "/v1/checkout/sessions"
-}
diff --git a/corporate/tests/test_stripe.py b/corporate/tests/test_stripe.py
index 590d3bc9401..6dfab01b715 100644
--- a/corporate/tests/test_stripe.py
+++ b/corporate/tests/test_stripe.py
@@ -563,7 +563,6 @@ class StripeTestCase(ZulipTestCase):
self,
invoice: bool = False,
talk_to_stripe: bool = True,
- onboarding: bool = False,
upgrade_page_response: Optional["TestHttpResponse"] = None,
del_args: Sequence[str] = [],
dont_confirm_payment: bool = False,
@@ -587,11 +586,6 @@ class StripeTestCase(ZulipTestCase):
license_management="automatic",
)
- if onboarding:
- params.update(
- onboarding="true",
- )
-
params.update(kwargs)
for key in del_args:
if key in params:
@@ -1140,10 +1134,6 @@ class StripeTest(StripeTestCase):
self.assert_in_response(substring, response)
self.assert_not_in_success_response(["Go to your Zulip organization"], response)
- with patch("corporate.lib.stripe.timezone_now", return_value=self.now):
- response = self.client_get("/billing/", {"onboarding": "true"})
- self.assert_in_success_response(["Go to your Zulip organization"], response)
-
with patch("corporate.lib.stripe.get_latest_seat_count", return_value=12):
update_license_ledger_if_needed(realm, self.now)
self.assertEqual(
@@ -1249,54 +1239,6 @@ class StripeTest(StripeTestCase):
# Don't show price breakdown
self.assert_not_in_success_response(["{self.seat_count} x"], response)
- @mock_stripe(tested_timestamp_fields=["created"])
- def test_free_trial_upgrade_by_card_from_onboarding_page(self, *mocks: Mock) -> None:
- user = self.example_user("hamlet")
- self.login_user(user)
-
- with self.settings(FREE_TRIAL_DAYS=60):
- free_trial_end_date = self.now + timedelta(days=60)
- self.assertNotEqual(user.realm.plan_type, Realm.PLAN_TYPE_STANDARD)
- self.assertFalse(Customer.objects.filter(realm=user.realm).exists())
-
- stripe_customer = self.add_card_and_upgrade(user, onboarding=True)
- self.assertEqual(PaymentIntent.objects.all().count(), 0)
- self.assertEqual(stripe_customer.description, "zulip (Zulip Dev)")
- self.assertEqual(stripe_customer.discount, None)
- self.assertEqual(stripe_customer.email, user.delivery_email)
- assert stripe_customer.metadata is not None
- metadata_dict = dict(stripe_customer.metadata)
- self.assertEqual(metadata_dict["realm_str"], "zulip")
- try:
- int(metadata_dict["realm_id"])
- except ValueError: # nocoverage
- raise AssertionError("realm_id is not a number")
- self.assertFalse(stripe.Charge.list(customer=stripe_customer.id))
- self.assertFalse(stripe.Invoice.list(customer=stripe_customer.id))
- customer = Customer.objects.get(stripe_customer_id=stripe_customer.id, realm=user.realm)
- customer = Customer.objects.get(stripe_customer_id=stripe_customer.id, realm=user.realm)
- plan = CustomerPlan.objects.get(
- customer=customer,
- automanage_licenses=True,
- price_per_license=8000,
- fixed_price=None,
- discount=None,
- billing_cycle_anchor=self.now,
- billing_schedule=CustomerPlan.ANNUAL,
- invoiced_through=LicenseLedger.objects.first(),
- next_invoice_date=free_trial_end_date,
- tier=CustomerPlan.STANDARD,
- status=CustomerPlan.FREE_TRIAL,
- )
- LicenseLedger.objects.get(
- plan=plan,
- is_renewal=True,
- event_time=self.now,
- licenses=self.seat_count,
- licenses_at_next_renewal=self.seat_count,
- )
- # We don't test anything else since test_free_trial_upgrade_by_card does this already.
-
@mock_stripe(tested_timestamp_fields=["created"])
def test_free_trial_upgrade_by_invoice(self, *mocks: Mock) -> None:
user = self.example_user("hamlet")
@@ -2016,10 +1958,6 @@ class StripeTest(StripeTestCase):
self.assertEqual(response.status_code, 302)
self.assertEqual(response["Location"], "/billing/")
- response = self.client_get("/upgrade/", {"onboarding": "true"})
- self.assertEqual(response.status_code, 302)
- self.assertEqual(response["Location"], "/billing/?onboarding=true")
-
def test_get_latest_seat_count(self) -> None:
realm = get_realm("zulip")
initial_count = get_latest_seat_count(realm)
diff --git a/corporate/views/billing_page.py b/corporate/views/billing_page.py
index 4af5c24938f..4969854f75d 100644
--- a/corporate/views/billing_page.py
+++ b/corporate/views/billing_page.py
@@ -21,7 +21,7 @@ from zerver.decorator import require_billing_access, zulip_login_required
from zerver.lib.exceptions import JsonableError
from zerver.lib.request import REQ, has_request_variables
from zerver.lib.response import json_success
-from zerver.lib.validator import check_bool, check_int, check_int_in, check_string
+from zerver.lib.validator import check_int, check_int_in, check_string
from zerver.models import Realm, UserProfile
billing_logger = logging.getLogger("corporate.stripe")
@@ -66,7 +66,6 @@ def sponsorship_request(request: HttpRequest) -> HttpResponse:
@has_request_variables
def billing_home(
request: HttpRequest,
- onboarding: bool = REQ(default=False, json_validator=check_bool),
success_message: str = REQ(default="", str_validator=check_string),
) -> HttpResponse:
user = request.user
@@ -115,7 +114,7 @@ def billing_home(
main_context = billing_session.get_billing_page_context()
if main_context:
context.update(main_context)
- context.update({"onboarding": onboarding, "success_message": success_message})
+ context["success_message"] = success_message
return render(request, "corporate/billing.html", context=context)
diff --git a/corporate/views/upgrade.py b/corporate/views/upgrade.py
index 956b069fd4e..55f68124d69 100644
--- a/corporate/views/upgrade.py
+++ b/corporate/views/upgrade.py
@@ -38,7 +38,6 @@ def upgrade(
schedule: str = REQ(str_validator=check_string_in(VALID_BILLING_SCHEDULE_VALUES)),
signed_seat_count: str = REQ(),
salt: str = REQ(),
- onboarding: bool = REQ(default=False, json_validator=check_bool),
license_management: Optional[str] = REQ(
default=None, str_validator=check_string_in(VALID_LICENSE_MANAGEMENT_VALUES)
),
@@ -50,7 +49,6 @@ def upgrade(
schedule=schedule,
signed_seat_count=signed_seat_count,
salt=salt,
- onboarding=onboarding,
license_management=license_management,
licenses=licenses,
)
@@ -82,7 +80,6 @@ def upgrade(
@has_request_variables
def initial_upgrade(
request: HttpRequest,
- onboarding: bool = REQ(default=False, json_validator=check_bool),
manual_license_management: bool = REQ(default=False, json_validator=check_bool),
) -> HttpResponse:
user = request.user
@@ -92,7 +89,6 @@ def initial_upgrade(
return render(request, "404.html", status=404)
initial_upgrade_request = InitialUpgradeRequest(
- onboarding=onboarding,
manual_license_management=manual_license_management,
tier=CustomerPlan.STANDARD,
)
diff --git a/templates/corporate/billing.html b/templates/corporate/billing.html
index 340ad81d027..2ed0d8104df 100644
--- a/templates/corporate/billing.html
+++ b/templates/corporate/billing.html
@@ -212,11 +212,6 @@
{% endif %}
</form>
<input name="status" type="hidden" value="{{ CustomerPlan.DOWNGRADE_AT_END_OF_CYCLE }}" />
- {% if onboarding %}
- <div id="onboarding-go-to-org" class="input-box upgrade-page-field">
- <a class="not-editable-realm-field" href="/"><b>Go to your Zulip organization</b></a>
- </div>
- {% endif %}
</div>
</div>
<hr />
diff --git a/templates/corporate/upgrade.html b/templates/corporate/upgrade.html
index 4bd58e6c792..9594db5b100 100644
--- a/templates/corporate/upgrade.html
+++ b/templates/corporate/upgrade.html
@@ -25,13 +25,6 @@
<input type="hidden" name="signed_seat_count" value="{{ signed_seat_count }}" />
<input type="hidden" name="salt" value="{{ salt }}" />
<input type="hidden" name="billing_modality" value="charge_automatically" />
- {% if onboarding %}
- <input type="hidden" name="onboarding" value="true" />
- {% endif %}
- {% if onboarding and free_trial_days %}
- <p id="onboarding-free-trial-not-ready" class="not-editable-realm-field"><b>Not ready to start your trial?</b> <a href="/">Continue with the Zulip Cloud Free plan</a>.</p>
- <hr/>
- {% endif %}
<div id="free-trial-top-banner" class="input-box upgrade-page-field">
{% if free_trial_days %}
diff --git a/web/styles/portico/billing.css b/web/styles/portico/billing.css
index 05ebb5f9dd3..6d264f401da 100644
--- a/web/styles/portico/billing.css
+++ b/web/styles/portico/billing.css
@@ -546,8 +546,6 @@ input[name="licenses"] {
}
#billing-page-details .billing-frequency-message.not-editable-realm-field,
-#upgrade-page-details #onboarding-free-trial-not-ready,
-#onboarding-go-to-org .not-editable-realm-field,
#free-trial-top-banner .not-editable-realm-field,
#upgrade-page-details .license-management-section .not-editable-realm-field {
padding-top: 0;
diff --git a/zerver/tests/test_signup.py b/zerver/tests/test_signup.py
index 5652d757d40..3ae231da6eb 100644
--- a/zerver/tests/test_signup.py
+++ b/zerver/tests/test_signup.py
@@ -1789,12 +1789,10 @@ class RealmCreationTest(ZulipTestCase):
self.assertEqual(result.status_code, 302)
result = self.client_get(result["Location"], subdomain=string_id)
- self.assertEqual(
- result["Location"], "http://custom-test.testserver/upgrade/?onboarding=true"
- )
+ self.assertEqual(result["Location"], "http://custom-test.testserver/upgrade/")
result = self.client_get(result["Location"], subdomain=string_id)
- self.assert_in_success_response(["Not ready to start your trial?"], result)
+ self.assert_in_success_response(["You won't be charged during the free trial."], result)
realm = get_realm(string_id)
self.assertEqual(realm.string_id, string_id)
diff --git a/zerver/views/auth.py b/zerver/views/auth.py
index ac6eab11027..0d5b53898a2 100644
--- a/zerver/views/auth.py
+++ b/zerver/views/auth.py
@@ -394,7 +394,7 @@ def login_or_register_remote_user(request: HttpRequest, result: ExternalAuthResu
from corporate.lib.stripe import is_free_trial_offer_enabled
if is_free_trial_offer_enabled():
- redirect_to = "{}?onboarding=true".format(reverse("initial_upgrade"))
+ redirect_to = reverse("initial_upgrade")
redirect_to = get_safe_redirect_to(redirect_to, user_profile.realm.uri)
return HttpResponseRedirect(redirect_to)