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.

support: Add support to configure fixed_price plan.

Prakhar Pratyushedec29e0b6ff
diff --git a/analytics/tests/test_support_views.py b/analytics/tests/test_support_views.py
index 4225ea964d9..c177d38cb8e 100644
--- a/analytics/tests/test_support_views.py
+++ b/analytics/tests/test_support_views.py
@@ -404,6 +404,7 @@ class TestRemoteServerSupportEndpoint(ZulipTestCase):
assert plan is not None
next_plan = billing_session.get_next_plan(plan)
assert next_plan is not None
+ assert type(next_plan) is CustomerPlan
self.assertEqual(plan.status, CustomerPlan.SWITCH_PLAN_TIER_AT_PLAN_END)
self.assertEqual(next_plan.status, CustomerPlan.NEVER_STARTED)
diff --git a/analytics/views/support.py b/analytics/views/support.py
index aee21bc2392..182f85bfa2c 100644
--- a/analytics/views/support.py
+++ b/analytics/views/support.py
@@ -440,6 +440,7 @@ def remote_servers_support(
discount: Optional[Decimal] = REQ(default=None, converter=to_decimal),
minimum_licenses: Optional[int] = REQ(default=None, converter=to_non_negative_int),
required_plan_tier: Optional[int] = REQ(default=None, converter=to_non_negative_int),
+ fixed_price: Optional[int] = REQ(default=None, converter=to_non_negative_int),
sponsorship_pending: Optional[bool] = REQ(default=None, json_validator=check_bool),
approve_sponsorship: bool = REQ(default=False, json_validator=check_bool),
billing_modality: Optional[str] = REQ(
@@ -500,6 +501,11 @@ def remote_servers_support(
support_type=SupportType.update_required_plan_tier,
required_plan_tier=required_plan_tier,
)
+ elif fixed_price is not None:
+ support_view_request = SupportViewRequest(
+ support_type=SupportType.configure_fixed_price_plan,
+ fixed_price=fixed_price,
+ )
elif billing_modality is not None:
support_view_request = SupportViewRequest(
support_type=SupportType.update_billing_modality,
diff --git a/corporate/lib/stripe.py b/corporate/lib/stripe.py
index 298b0826580..dd62f98e6e8 100644
--- a/corporate/lib/stripe.py
+++ b/corporate/lib/stripe.py
@@ -29,6 +29,7 @@ from typing_extensions import ParamSpec, override
from corporate.models import (
Customer,
CustomerPlan,
+ CustomerPlanOffer,
LicenseLedger,
PaymentIntent,
Session,
@@ -120,6 +121,13 @@ def format_money(cents: float) -> str:
return f"{dollars:.{precision}f}"
+def get_amount_due_fixed_price_plan(fixed_price: int, billing_schedule: int) -> int:
+ amount_due = fixed_price
+ if billing_schedule == CustomerPlan.BILLING_SCHEDULE_MONTHLY:
+ amount_due = int(float(format_money(fixed_price / 12)) * 100)
+ return amount_due
+
+
def format_discount_percentage(discount: Optional[Decimal]) -> Optional[str]:
if type(discount) is not Decimal or discount == Decimal(0):
return None
@@ -371,6 +379,23 @@ def build_support_url(support_view: str, query_text: str) -> str:
return support_url
+def get_configured_fixed_price_plan_offer(
+ customer: Customer, plan_tier: int
+) -> Optional[CustomerPlanOffer]:
+ """
+ Fixed price plan offer configured via /support which the
+ customer is yet to buy or schedule a purchase.
+ """
+ if plan_tier == customer.required_plan_tier:
+ return CustomerPlanOffer.objects.filter(
+ customer=customer,
+ tier=plan_tier,
+ fixed_price__isnull=False,
+ status=CustomerPlanOffer.CONFIGURED,
+ ).first()
+ return None
+
+
class BillingError(JsonableError):
data_fields = ["error_description"]
# error messages
@@ -553,6 +578,7 @@ class SupportType(Enum):
update_minimum_licenses = 6
update_plan_end_date = 7
update_required_plan_tier = 8
+ configure_fixed_price_plan = 9
class SupportViewRequest(TypedDict, total=False):
@@ -565,6 +591,7 @@ class SupportViewRequest(TypedDict, total=False):
minimum_licenses: Optional[int]
plan_end_date: Optional[str]
required_plan_tier: Optional[int]
+ fixed_price: Optional[int]
class AuditLogEventType(Enum):
@@ -603,6 +630,7 @@ class UpgradePageParams(TypedDict):
tier: int
flat_discount: int
flat_discounted_months: int
+ fixed_price: Optional[int]
class UpgradePageSessionTypeSpecificContext(TypedDict):
@@ -642,6 +670,7 @@ class UpgradePageContext(TypedDict):
page_params: UpgradePageParams
payment_method: Optional[str]
plan: str
+ fixed_price_plan: bool
remote_server_legacy_plan_end_date: Optional[str]
salt: str
seat_count: int
@@ -723,7 +752,8 @@ class BillingSession(ABC):
def get_data_for_stripe_payment_intent(
self,
customer: Customer,
- price_per_license: int,
+ price_per_license: Optional[int],
+ fixed_price: Optional[int],
licenses: int,
plan_tier: int,
billing_schedule: int,
@@ -735,11 +765,17 @@ class BillingSession(ABC):
"Support requests do not set any stripe billing information.",
)
- amount = price_per_license * licenses
-
plan_name = CustomerPlan.name_from_tier(plan_tier)
- description = f"Upgrade to {plan_name}, ${price_per_license/100} x {licenses}"
- if customer.flat_discounted_months > 0:
+ assert price_per_license is None or fixed_price is None
+ if price_per_license is not None:
+ amount = price_per_license * licenses
+ description = f"Upgrade to {plan_name}, ${price_per_license/100} x {licenses}"
+ else:
+ assert fixed_price is not None
+ amount = get_amount_due_fixed_price_plan(fixed_price, billing_schedule)
+ description = plan_name
+
+ if fixed_price is None and customer.flat_discounted_months > 0:
num_months = 12 if billing_schedule == CustomerPlan.BILLING_SCHEDULE_ANNUAL else 1
flat_discounted_months = min(customer.flat_discounted_months, num_months)
amount -= customer.flat_discount * flat_discounted_months
@@ -940,15 +976,17 @@ class BillingSession(ABC):
return customer
def create_stripe_payment_intent(
- self, price_per_license: int, licenses: int, metadata: Dict[str, Any]
+ self,
+ metadata: Dict[str, Any],
) -> str:
# NOTE: This charges users immediately.
customer = self.get_customer()
assert customer is not None and customer.stripe_customer_id is not None
payment_intent_data = self.get_data_for_stripe_payment_intent(
customer,
- price_per_license,
- licenses,
+ metadata["price_per_license"],
+ metadata["fixed_price"],
+ metadata["licenses"],
metadata["plan_tier"],
metadata["billing_schedule"],
self.get_email(),
@@ -1167,6 +1205,65 @@ class BillingSession(ABC):
plan_tier_name = CustomerPlan.name_from_tier(new_plan_tier)
return f"Required plan tier for {self.billing_entity_display_name} set to {plan_tier_name}."
+ def configure_fixed_price_plan(self, fixed_price: int) -> str:
+ customer = self.get_customer()
+ if customer is None:
+ customer = self.update_or_create_customer()
+
+ if customer.required_plan_tier is None:
+ raise SupportRequestError("Required plan tier should not be set to None")
+ required_plan_tier_name = CustomerPlan.name_from_tier(customer.required_plan_tier)
+
+ fixed_price_cents = fixed_price * 100
+ fixed_price_plan_params: Dict[str, Any] = {
+ "fixed_price": fixed_price_cents,
+ "tier": customer.required_plan_tier,
+ "status": CustomerPlan.NEVER_STARTED,
+ }
+
+ current_plan = get_current_plan_by_customer(customer)
+ if current_plan is not None and self.check_plan_tier_is_billable(current_plan.tier):
+ if current_plan.end_date is None:
+ raise SupportRequestError(
+ f"Configure {self.billing_entity_display_name} current plan end-date, before scheduling a new plan."
+ )
+ fixed_price_plan_params["billing_cycle_anchor"] = current_plan.end_date
+ fixed_price_plan_params["next_invoice_date"] = current_plan.end_date
+ fixed_price_plan_params[
+ "invoicing_status"
+ ] = CustomerPlan.INVOICING_STATUS_INITIAL_INVOICE_TO_BE_SENT
+ fixed_price_plan_params["billing_schedule"] = current_plan.billing_schedule
+ fixed_price_plan_params["charge_automatically"] = current_plan.charge_automatically
+ # Manual license management is not available for fixed price plan.
+ fixed_price_plan_params["automanage_licenses"] = True
+
+ CustomerPlan.objects.create(
+ customer=customer,
+ **fixed_price_plan_params,
+ )
+ self.write_to_audit_log(
+ event_type=AuditLogEventType.CUSTOMER_PLAN_CREATED,
+ event_time=timezone_now(),
+ extra_data=fixed_price_plan_params,
+ )
+
+ current_plan.status = CustomerPlan.SWITCH_PLAN_TIER_AT_PLAN_END
+ current_plan.next_invoice_date = current_plan.end_date
+ current_plan.save(update_fields=["status", "next_invoice_date"])
+ return f"Fixed price {required_plan_tier_name} plan scheduled to start on {current_plan.end_date.date()}."
+
+ fixed_price_plan_params["status"] = CustomerPlanOffer.CONFIGURED
+ CustomerPlanOffer.objects.create(
+ customer=customer,
+ **fixed_price_plan_params,
+ )
+ self.write_to_audit_log(
+ event_type=AuditLogEventType.CUSTOMER_PLAN_CREATED,
+ event_time=timezone_now(),
+ extra_data=fixed_price_plan_params,
+ )
+ return f"Customer can now buy a fixed price {required_plan_tier_name} plan."
+
def update_customer_sponsorship_status(self, sponsorship_pending: bool) -> str:
customer = self.get_customer()
if customer is None:
@@ -1246,24 +1343,30 @@ class BillingSession(ABC):
) -> str:
customer = self.update_or_create_stripe_customer()
assert customer is not None # for mypy
- discount_for_plan = customer.get_discount_for_plan_tier(plan_tier)
- price_per_license = get_price_per_license(plan_tier, billing_schedule, discount_for_plan)
+ fixed_price_plan_offer = get_configured_fixed_price_plan_offer(customer, plan_tier)
general_metadata = {
"billing_modality": billing_modality,
"billing_schedule": billing_schedule,
"licenses": licenses,
"license_management": license_management,
- "price_per_license": price_per_license,
+ "price_per_license": None,
+ "fixed_price": None,
"seat_count": seat_count,
"type": "upgrade",
"plan_tier": plan_tier,
}
+ if fixed_price_plan_offer is None:
+ discount_for_plan = customer.get_discount_for_plan_tier(plan_tier)
+ price_per_license = get_price_per_license(
+ plan_tier, billing_schedule, discount_for_plan
+ )
+ general_metadata["price_per_license"] = price_per_license
+ else:
+ general_metadata["fixed_price"] = fixed_price_plan_offer.fixed_price
updated_metadata = self.update_data_for_checkout_session_and_payment_intent(
general_metadata
)
- stripe_payment_intent_id = self.create_stripe_payment_intent(
- price_per_license, licenses, updated_metadata
- )
+ stripe_payment_intent_id = self.create_stripe_payment_intent(updated_metadata)
return stripe_payment_intent_id
def ensure_current_plan_is_upgradable(self, customer: Customer, new_plan_tier: int) -> None:
@@ -1321,7 +1424,14 @@ class BillingSession(ABC):
if should_schedule_upgrade_for_legacy_remote_server:
assert remote_server_legacy_plan is not None
billing_cycle_anchor = remote_server_legacy_plan.end_date
- discount_for_plan = customer.get_discount_for_plan_tier(plan_tier)
+
+ discount_for_plan = None
+ fixed_price_plan_offer = get_configured_fixed_price_plan_offer(customer, plan_tier)
+ if fixed_price_plan_offer is None:
+ discount_for_plan = customer.get_discount_for_plan_tier(plan_tier)
+ else:
+ assert automanage_licenses is True
+
(
billing_cycle_anchor,
next_invoice_date,
@@ -1351,12 +1461,15 @@ class BillingSession(ABC):
plan_params = {
"automanage_licenses": automanage_licenses,
"charge_automatically": charge_automatically,
- "price_per_license": price_per_license,
- "discount": discount_for_plan,
"billing_cycle_anchor": billing_cycle_anchor,
"billing_schedule": billing_schedule,
"tier": plan_tier,
}
+
+ if fixed_price_plan_offer is None:
+ plan_params["price_per_license"] = price_per_license
+ plan_params["discount"] = discount_for_plan
+
if free_trial:
plan_params["status"] = CustomerPlan.FREE_TRIAL
@@ -1418,6 +1531,13 @@ class BillingSession(ABC):
remote_server_legacy_plan.status = CustomerPlan.ENDED
remote_server_legacy_plan.save(update_fields=["status"])
+ if fixed_price_plan_offer is not None:
+ # Manual license management is not available for fixed price plan.
+ assert automanage_licenses is True
+ plan_params["fixed_price"] = fixed_price_plan_offer.fixed_price
+ fixed_price_plan_offer.status = CustomerPlanOffer.PROCESSED
+ fixed_price_plan_offer.save(update_fields=["status"])
+
plan = CustomerPlan.objects.create(
customer=customer, next_invoice_date=next_invoice_date, **plan_params
)
@@ -1443,6 +1563,16 @@ class BillingSession(ABC):
if not (free_trial or should_schedule_upgrade_for_legacy_remote_server):
assert plan is not None
+ price_args: PriceArgs = {}
+ if plan.fixed_price is None:
+ price_args = {
+ "quantity": billed_licenses,
+ "unit_amount": price_per_license,
+ }
+ else:
+ assert plan.fixed_price is not None
+ amount_due = get_amount_due_fixed_price_plan(plan.fixed_price, billing_schedule)
+ price_args = {"amount": amount_due}
stripe.InvoiceItem.create(
currency="usd",
customer=customer.stripe_customer_id,
@@ -1452,11 +1582,10 @@ class BillingSession(ABC):
"start": datetime_to_timestamp(billing_cycle_anchor),
"end": datetime_to_timestamp(period_end),
},
- quantity=billed_licenses,
- unit_amount=price_per_license,
+ **price_args,
)
- if customer.flat_discounted_months > 0:
+ if plan.fixed_price is None and customer.flat_discounted_months > 0:
num_months = 12 if billing_schedule == CustomerPlan.BILLING_SCHEDULE_ANNUAL else 1
flat_discounted_months = min(customer.flat_discounted_months, num_months)
discount = customer.flat_discount * flat_discounted_months
@@ -1701,8 +1830,6 @@ class BillingSession(ABC):
)
if plan.status == CustomerPlan.SWITCH_PLAN_TIER_AT_PLAN_END: # nocoverage
- # Only plan tier we do this for right now.
- assert plan.tier == CustomerPlan.TIER_SELF_HOSTED_LEGACY
plan.status = CustomerPlan.ENDED
plan.save(update_fields=["status"])
@@ -1832,14 +1959,23 @@ class BillingSession(ABC):
return None, None
return None, last_ledger_entry
- def get_next_plan(self, plan: CustomerPlan) -> Optional[CustomerPlan]:
+ def get_next_plan(self, plan: CustomerPlan) -> Union[CustomerPlan, CustomerPlanOffer, None]:
+ customer = plan.customer
if plan.status == CustomerPlan.SWITCH_PLAN_TIER_AT_PLAN_END:
assert plan.end_date is not None
return CustomerPlan.objects.filter(
- customer=plan.customer,
+ customer=customer,
billing_cycle_anchor=plan.end_date,
status=CustomerPlan.NEVER_STARTED,
).first()
+ elif customer.required_plan_tier is not None:
+ # Currently, the only case when a next_plan is scheduled with the
+ # current_plan.status NOT SET to SWITCH_PLAN_TIER_AT_PLAN_END is a
+ # fixed price plan configured via /support which the customer is yet
+ # to buy or schedule a purchase.
+ return get_configured_fixed_price_plan_offer(
+ customer=customer, plan_tier=customer.required_plan_tier
+ )
return None
def get_customer_plan_renewal_amount(
@@ -1848,7 +1984,7 @@ class BillingSession(ABC):
last_ledger_entry: LicenseLedger,
) -> int:
if plan.fixed_price is not None:
- return plan.fixed_price
+ return get_amount_due_fixed_price_plan(plan.fixed_price, plan.billing_schedule)
if last_ledger_entry.licenses_at_next_renewal is None:
return 0 # nocoverage
assert plan.price_per_license is not None # for mypy
@@ -1921,7 +2057,7 @@ class BillingSession(ABC):
# TODO: Do this calculation in `invoice_plan` too.
pre_discount_renewal_cents = renewal_cents
flat_discount, flat_discounted_months = self.get_flat_discount_info(plan.customer)
- if flat_discounted_months > 0:
+ if plan.fixed_price is None and flat_discounted_months > 0:
flat_discounted_months = min(flat_discounted_months, num_months_next_cycle)
discount = flat_discount * flat_discounted_months
renewal_cents = renewal_cents - discount
@@ -1941,9 +2077,6 @@ class BillingSession(ABC):
else: # nocoverage
raise BillingError(f"stripe_customer_id is None for {customer}")
- fixed_price = (
- cents_to_dollar_string(plan.fixed_price) if plan.fixed_price is not None else None
- )
remote_server_legacy_plan_end_date = self.get_formatted_remote_server_legacy_plan_end_date(
customer, status=CustomerPlan.SWITCH_PLAN_TIER_AT_PLAN_END
)
@@ -1968,7 +2101,7 @@ class BillingSession(ABC):
"stripe_email": stripe_email,
"CustomerPlan": CustomerPlan,
"billing_frequency": billing_frequency,
- "fixed_price": fixed_price,
+ "fixed_price_plan": plan.fixed_price is not None,
"price_per_license": price_per_license,
"is_sponsorship_pending": customer.sponsorship_pending,
"sponsorship_plan_name": self.get_sponsorship_plan_name(
@@ -2004,6 +2137,7 @@ class BillingSession(ABC):
next_plan = self.get_next_plan(plan)
if next_plan is not None:
+ assert type(next_plan) is CustomerPlan
next_plan_context = self.get_billing_context_from_plan(
customer, next_plan, last_ledger_entry, now
)
@@ -2015,7 +2149,7 @@ class BillingSession(ABC):
"payment_method",
"charge_automatically",
"billing_frequency",
- "fixed_price",
+ "fixed_price_plan",
"price_per_license",
"discount_percent",
"using_min_licenses_for_plan",
@@ -2077,6 +2211,13 @@ class BillingSession(ABC):
tier = initial_upgrade_request.tier
+ fixed_price = None
+ if customer is not None:
+ fixed_price_plan_offer = get_configured_fixed_price_plan_offer(customer, tier)
+ if fixed_price_plan_offer:
+ assert fixed_price_plan_offer.fixed_price is not None
+ fixed_price = fixed_price_plan_offer.fixed_price
+
percent_off = Decimal(0)
if customer is not None:
discount_for_plan_tier = customer.get_discount_for_plan_tier(tier)
@@ -2137,11 +2278,13 @@ class BillingSession(ABC):
"tier": tier,
"flat_discount": flat_discount,
"flat_discounted_months": flat_discounted_months,
+ "fixed_price": fixed_price,
},
"using_min_licenses_for_plan": using_min_licenses_for_plan,
"min_licenses_for_plan": min_licenses_for_plan,
"payment_method": current_payment_method,
"plan": CustomerPlan.name_from_tier(tier),
+ "fixed_price_plan": fixed_price is not None,
"salt": salt,
"seat_count": seat_count,
"signed_seat_count": signed_seat_count,
@@ -2252,8 +2395,9 @@ class BillingSession(ABC):
# Switch to a different plan was cancelled. We end the next plan
# and set the current one as active.
if plan.status == CustomerPlan.SWITCH_PLAN_TIER_AT_PLAN_END:
+ assert type(plan) is CustomerPlan
next_plan = self.get_next_plan(plan)
- assert next_plan is not None
+ assert type(next_plan) is CustomerPlan
do_change_plan_status(next_plan, CustomerPlan.ENDED)
do_change_plan_status(plan, status)
elif status == CustomerPlan.DOWNGRADE_AT_END_OF_CYCLE:
@@ -2440,7 +2584,10 @@ class BillingSession(ABC):
price_args: PriceArgs = {}
if ledger_entry.is_renewal:
if plan.fixed_price is not None:
- price_args = {"amount": plan.fixed_price}
+ amount_due = get_amount_due_fixed_price_plan(
+ plan.fixed_price, plan.billing_schedule
+ )
+ price_args = {"amount": amount_due}
else:
assert plan.price_per_license is not None # needed for mypy
price_args = {
@@ -2502,7 +2649,7 @@ class BillingSession(ABC):
if invoice_item_created:
flat_discount, flat_discounted_months = self.get_flat_discount_info(plan.customer)
- if flat_discounted_months > 0:
+ if plan.fixed_price is None and flat_discounted_months > 0:
num_months = (
12 if plan.billing_schedule == CustomerPlan.BILLING_SCHEDULE_ANNUAL else 1
)
@@ -2768,6 +2915,10 @@ class BillingSession(ABC):
required_plan_tier = support_request.get("required_plan_tier")
assert required_plan_tier is not None
success_message = self.set_required_plan_tier(required_plan_tier)
+ elif support_type == SupportType.configure_fixed_price_plan:
+ assert support_request["fixed_price"] is not None
+ new_fixed_price = support_request["fixed_price"]
+ success_message = self.configure_fixed_price_plan(new_fixed_price)
elif support_type == SupportType.update_billing_modality:
assert support_request["billing_modality"] is not None
assert support_request["billing_modality"] in VALID_BILLING_MODALITY_VALUES
diff --git a/corporate/lib/support.py b/corporate/lib/support.py
index 8ffe4ba55bd..e56c8fa9028 100644
--- a/corporate/lib/support.py
+++ b/corporate/lib/support.py
@@ -1,7 +1,7 @@
from dataclasses import dataclass
from datetime import datetime, timedelta
from decimal import Decimal
-from typing import Optional, TypedDict
+from typing import Optional, TypedDict, Union
from urllib.parse import urlencode, urljoin, urlunsplit
from django.conf import settings
@@ -18,6 +18,7 @@ from corporate.lib.stripe import (
from corporate.models import (
Customer,
CustomerPlan,
+ CustomerPlanOffer,
ZulipSponsorshipRequest,
get_current_plan_by_customer,
)
@@ -58,7 +59,7 @@ class SponsorshipData:
class PlanData:
customer: Optional["Customer"] = None
current_plan: Optional["CustomerPlan"] = None
- next_plan: Optional["CustomerPlan"] = None
+ next_plan: Union["CustomerPlan", "CustomerPlanOffer", None] = None
licenses: Optional[int] = None
licenses_used: Optional[int] = None
next_billing_cycle_start: Optional[datetime] = None
@@ -179,6 +180,7 @@ def get_current_plan_data_for_support_view(billing_session: BillingSession) -> P
elif plan_data.current_plan.licenses_at_next_renewal() is not None:
next_plan_licenses = plan_data.current_plan.licenses_at_next_renewal()
assert next_plan_licenses is not None
+ assert type(plan_data.next_plan) is CustomerPlan
assert plan_data.next_plan.price_per_license is not None
invoice_count = get_annual_invoice_count(plan_data.next_plan.billing_schedule)
plan_data.estimated_next_plan_revenue = (
diff --git a/corporate/migrations/0037_customerplanoffer.py b/corporate/migrations/0037_customerplanoffer.py
new file mode 100644
index 00000000000..d4e4ce9410c
--- /dev/null
+++ b/corporate/migrations/0037_customerplanoffer.py
@@ -0,0 +1,36 @@
+# Generated by Django 4.2.8 on 2024-01-27 09:03
+
+import django.db.models.deletion
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("corporate", "0036_fix_customer_plans_scheduled_after_legacy_plan"),
+ ]
+
+ operations = [
+ migrations.CreateModel(
+ name="CustomerPlanOffer",
+ fields=[
+ (
+ "id",
+ models.AutoField(
+ auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
+ ),
+ ),
+ ("fixed_price", models.IntegerField(null=True)),
+ ("tier", models.SmallIntegerField()),
+ ("status", models.SmallIntegerField()),
+ (
+ "customer",
+ models.ForeignKey(
+ on_delete=django.db.models.deletion.CASCADE, to="corporate.customer"
+ ),
+ ),
+ ],
+ options={
+ "abstract": False,
+ },
+ ),
+ ]
diff --git a/corporate/models.py b/corporate/models.py
index 4f08be7c857..2e65845b741 100644
--- a/corporate/models.py
+++ b/corporate/models.py
@@ -215,25 +215,77 @@ class PaymentIntent(models.Model):
return payment_intent_dict
-class CustomerPlan(models.Model):
+class AbstractCustomerPlan(models.Model):
+ # A customer can only have one ACTIVE / CONFIGURED plan,
+ # but old, inactive / processed plans are preserved to allow
+ # auditing - so there can be multiple CustomerPlan / CustomerPlanOffer
+ # objects pointing to one Customer.
+ customer = models.ForeignKey(Customer, on_delete=CASCADE)
+
+ fixed_price = models.IntegerField(null=True)
+
+ class Meta:
+ abstract = True
+
+
+class CustomerPlanOffer(AbstractCustomerPlan):
+ """
+ This is for storing offers configured via /support which
+ the customer is yet to buy or schedule a purchase.
+
+ Once customer buys or schedules a purchase, we create a
+ CustomerPlan record. The record in this table stays for
+ audit purpose with status=PROCESSED.
+ """
+
+ TIER_SELF_HOSTED_BASIC = 103
+ TIER_SELF_HOSTED_BUSINESS = 104
+ tier = models.SmallIntegerField()
+
+ # Whether the offer is:
+ # * only configured
+ # * processed by the customer to buy or schedule a purchase.
+ CONFIGURED = 1
+ PROCESSED = 2
+ status = models.SmallIntegerField()
+
+ @override
+ def __str__(self) -> str:
+ return f"{self.name} (status: {self.get_plan_status_as_text()})"
+
+ def get_plan_status_as_text(self) -> str:
+ return {
+ self.CONFIGURED: "Configured",
+ self.PROCESSED: "Processed",
+ }[self.status]
+
+ @staticmethod
+ def name_from_tier(tier: int) -> str: # nocoverage
+ return {
+ CustomerPlanOffer.TIER_SELF_HOSTED_BASIC: "Zulip Basic",
+ CustomerPlanOffer.TIER_SELF_HOSTED_BUSINESS: "Zulip Business",
+ }[tier]
+
+ @property
+ def name(self) -> str: # nocoverage
+ # TODO: This is used in `check_customer_not_on_paid_plan` as
+ # 'next_plan.name'. Related to sponsorship, add coverage.
+ return self.name_from_tier(self.tier)
+
+
+class CustomerPlan(AbstractCustomerPlan):
"""
This is for storing most of the fiddly details
of the customer's plan.
"""
- # A customer can only have one ACTIVE plan, but old, inactive plans
- # are preserved to allow auditing - so there can be multiple
- # CustomerPlan objects pointing to one Customer.
- customer = models.ForeignKey(Customer, on_delete=CASCADE)
-
automanage_licenses = models.BooleanField(default=False)
charge_automatically = models.BooleanField(default=False)
- # Both of these are in cents. Exactly one of price_per_license or
- # fixed_price should be set. fixed_price is only for manual deals, and
+ # Both of the price_per_license and fixed_price are in cents. Exactly
+ # one of them should be set. fixed_price is only for manual deals, and
# can't be set via the self-serve billing system.
price_per_license = models.IntegerField(null=True)
- fixed_price = models.IntegerField(null=True)
# Discount that was applied. For display purposes only.
discount = models.DecimalField(decimal_places=4, max_digits=6, null=True)
diff --git a/corporate/tests/stripe_fixtures/schedule_legacy_plan_upgrade_to_fixed_price_plan--Customer.create.1.json b/corporate/tests/stripe_fixtures/schedule_legacy_plan_upgrade_to_fixed_price_plan--Customer.create.1.json
new file mode 100644
index 00000000000..98e3a50d5cd
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_legacy_plan_upgrade_to_fixed_price_plan--Customer.create.1.json
@@ -0,0 +1,33 @@
+{
+ "address": null,
+ "balance": 0,
+ "created": 1706192487,
+ "currency": null,
+ "default_currency": null,
+ "default_source": null,
+ "delinquent": false,
+ "description": "zulip.testserver 7c17429c-ffc",
+ "discount": null,
+ "email": "[email protected]",
+ "id": "cus_PRMXEPuaeY5WWv",
+ "invoice_prefix": "88DE2F49",
+ "invoice_settings": {
+ "custom_fields": null,
+ "default_payment_method": null,
+ "footer": null,
+ "rendering_options": null
+ },
+ "livemode": false,
+ "metadata": {
+ "remote_realm_host": "zulip.testserver",
+ "remote_realm_uuid": "7c17429c-ffc2-4a85-9695-10048ba0fef5"
+ },
+ "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/schedule_legacy_plan_upgrade_to_fixed_price_plan--Customer.modify.1.json b/corporate/tests/stripe_fixtures/schedule_legacy_plan_upgrade_to_fixed_price_plan--Customer.modify.1.json
new file mode 100644
index 00000000000..53d29e92a0b
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_legacy_plan_upgrade_to_fixed_price_plan--Customer.modify.1.json
@@ -0,0 +1,33 @@
+{
+ "address": null,
+ "balance": 0,
+ "created": 1706192487,
+ "currency": null,
+ "default_currency": null,
+ "default_source": null,
+ "delinquent": false,
+ "description": "zulip.testserver 7c17429c-ffc",
+ "discount": null,
+ "email": "[email protected]",
+ "id": "cus_PRMXEPuaeY5WWv",
+ "invoice_prefix": "88DE2F49",
+ "invoice_settings": {
+ "custom_fields": null,
+ "default_payment_method": "pm_1OcTo4DEQaroqDjsvmCoo2VR",
+ "footer": null,
+ "rendering_options": null
+ },
+ "livemode": false,
+ "metadata": {
+ "remote_realm_host": "zulip.testserver",
+ "remote_realm_uuid": "7c17429c-ffc2-4a85-9695-10048ba0fef5"
+ },
+ "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/schedule_legacy_plan_upgrade_to_fixed_price_plan--Customer.retrieve.1.json b/corporate/tests/stripe_fixtures/schedule_legacy_plan_upgrade_to_fixed_price_plan--Customer.retrieve.1.json
new file mode 100644
index 00000000000..f8aeb5a3c4c
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_legacy_plan_upgrade_to_fixed_price_plan--Customer.retrieve.1.json
@@ -0,0 +1,79 @@
+{
+ "address": null,
+ "balance": 0,
+ "created": 1706192487,
+ "currency": null,
+ "default_currency": null,
+ "default_source": null,
+ "delinquent": false,
+ "description": "zulip.testserver 7c17429c-ffc",
+ "discount": null,
+ "email": "[email protected]",
+ "id": "cus_PRMXEPuaeY5WWv",
+ "invoice_prefix": "88DE2F49",
+ "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": 1,
+ "exp_year": 2025,
+ "fingerprint": "9XKsMixKBi6kIIzd",
+ "funding": "credit",
+ "generated_from": null,
+ "last4": "4242",
+ "networks": {
+ "available": [
+ "visa"
+ ],
+ "preferred": null
+ },
+ "three_d_secure_usage": {
+ "supported": true
+ },
+ "wallet": null
+ },
+ "created": 1706192489,
+ "customer": "cus_PRMXEPuaeY5WWv",
+ "id": "pm_1OcTo4DEQaroqDjsvmCoo2VR",
+ "livemode": false,
+ "metadata": {},
+ "object": "payment_method",
+ "type": "card"
+ },
+ "footer": null,
+ "rendering_options": null
+ },
+ "livemode": false,
+ "metadata": {
+ "remote_realm_host": "zulip.testserver",
+ "remote_realm_uuid": "7c17429c-ffc2-4a85-9695-10048ba0fef5"
+ },
+ "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/schedule_legacy_plan_upgrade_to_fixed_price_plan--Customer.retrieve.2.json b/corporate/tests/stripe_fixtures/schedule_legacy_plan_upgrade_to_fixed_price_plan--Customer.retrieve.2.json
new file mode 100644
index 00000000000..f8aeb5a3c4c
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_legacy_plan_upgrade_to_fixed_price_plan--Customer.retrieve.2.json
@@ -0,0 +1,79 @@
+{
+ "address": null,
+ "balance": 0,
+ "created": 1706192487,
+ "currency": null,
+ "default_currency": null,
+ "default_source": null,
+ "delinquent": false,
+ "description": "zulip.testserver 7c17429c-ffc",
+ "discount": null,
+ "email": "[email protected]",
+ "id": "cus_PRMXEPuaeY5WWv",
+ "invoice_prefix": "88DE2F49",
+ "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": 1,
+ "exp_year": 2025,
+ "fingerprint": "9XKsMixKBi6kIIzd",
+ "funding": "credit",
+ "generated_from": null,
+ "last4": "4242",
+ "networks": {
+ "available": [
+ "visa"
+ ],
+ "preferred": null
+ },
+ "three_d_secure_usage": {
+ "supported": true
+ },
+ "wallet": null
+ },
+ "created": 1706192489,
+ "customer": "cus_PRMXEPuaeY5WWv",
+ "id": "pm_1OcTo4DEQaroqDjsvmCoo2VR",
+ "livemode": false,
+ "metadata": {},
+ "object": "payment_method",
+ "type": "card"
+ },
+ "footer": null,
+ "rendering_options": null
+ },
+ "livemode": false,
+ "metadata": {
+ "remote_realm_host": "zulip.testserver",
+ "remote_realm_uuid": "7c17429c-ffc2-4a85-9695-10048ba0fef5"
+ },
+ "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/schedule_legacy_plan_upgrade_to_fixed_price_plan--Customer.retrieve.3.json b/corporate/tests/stripe_fixtures/schedule_legacy_plan_upgrade_to_fixed_price_plan--Customer.retrieve.3.json
new file mode 100644
index 00000000000..f8aeb5a3c4c
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_legacy_plan_upgrade_to_fixed_price_plan--Customer.retrieve.3.json
@@ -0,0 +1,79 @@
+{
+ "address": null,
+ "balance": 0,
+ "created": 1706192487,
+ "currency": null,
+ "default_currency": null,
+ "default_source": null,
+ "delinquent": false,
+ "description": "zulip.testserver 7c17429c-ffc",
+ "discount": null,
+ "email": "[email protected]",
+ "id": "cus_PRMXEPuaeY5WWv",
+ "invoice_prefix": "88DE2F49",
+ "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": 1,
+ "exp_year": 2025,
+ "fingerprint": "9XKsMixKBi6kIIzd",
+ "funding": "credit",
+ "generated_from": null,
+ "last4": "4242",
+ "networks": {
+ "available": [
+ "visa"
+ ],
+ "preferred": null
+ },
+ "three_d_secure_usage": {
+ "supported": true
+ },
+ "wallet": null
+ },
+ "created": 1706192489,
+ "customer": "cus_PRMXEPuaeY5WWv",
+ "id": "pm_1OcTo4DEQaroqDjsvmCoo2VR",
+ "livemode": false,
+ "metadata": {},
+ "object": "payment_method",
+ "type": "card"
+ },
+ "footer": null,
+ "rendering_options": null
+ },
+ "livemode": false,
+ "metadata": {
+ "remote_realm_host": "zulip.testserver",
+ "remote_realm_uuid": "7c17429c-ffc2-4a85-9695-10048ba0fef5"
+ },
+ "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/schedule_legacy_plan_upgrade_to_fixed_price_plan--Customer.retrieve.4.json b/corporate/tests/stripe_fixtures/schedule_legacy_plan_upgrade_to_fixed_price_plan--Customer.retrieve.4.json
new file mode 100644
index 00000000000..f8aeb5a3c4c
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_legacy_plan_upgrade_to_fixed_price_plan--Customer.retrieve.4.json
@@ -0,0 +1,79 @@
+{
+ "address": null,
+ "balance": 0,
+ "created": 1706192487,
+ "currency": null,
+ "default_currency": null,
+ "default_source": null,
+ "delinquent": false,
+ "description": "zulip.testserver 7c17429c-ffc",
+ "discount": null,
+ "email": "[email protected]",
+ "id": "cus_PRMXEPuaeY5WWv",
+ "invoice_prefix": "88DE2F49",
+ "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": 1,
+ "exp_year": 2025,
+ "fingerprint": "9XKsMixKBi6kIIzd",
+ "funding": "credit",
+ "generated_from": null,
+ "last4": "4242",
+ "networks": {
+ "available": [
+ "visa"
+ ],
+ "preferred": null
+ },
+ "three_d_secure_usage": {
+ "supported": true
+ },
+ "wallet": null
+ },
+ "created": 1706192489,
+ "customer": "cus_PRMXEPuaeY5WWv",
+ "id": "pm_1OcTo4DEQaroqDjsvmCoo2VR",
+ "livemode": false,
+ "metadata": {},
+ "object": "payment_method",
+ "type": "card"
+ },
+ "footer": null,
+ "rendering_options": null
+ },
+ "livemode": false,
+ "metadata": {
+ "remote_realm_host": "zulip.testserver",
+ "remote_realm_uuid": "7c17429c-ffc2-4a85-9695-10048ba0fef5"
+ },
+ "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/schedule_legacy_plan_upgrade_to_fixed_price_plan--Invoice.create.1.json b/corporate/tests/stripe_fixtures/schedule_legacy_plan_upgrade_to_fixed_price_plan--Invoice.create.1.json
new file mode 100644
index 00000000000..430f8e42e92
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_legacy_plan_upgrade_to_fixed_price_plan--Invoice.create.1.json
@@ -0,0 +1,162 @@
+{
+ "account_country": "US",
+ "account_name": "Kandra Labs, Inc.",
+ "account_tax_ids": null,
+ "amount_due": 120000,
+ "amount_paid": 0,
+ "amount_remaining": 120000,
+ "amount_shipping": 0,
+ "application": null,
+ "application_fee_amount": null,
+ "attempt_count": 0,
+ "attempted": false,
+ "auto_advance": true,
+ "automatic_tax": {
+ "enabled": false,
+ "liability": null,
+ "status": null
+ },
+ "billing_reason": "manual",
+ "charge": null,
+ "collection_method": "charge_automatically",
+ "created": 1706192494,
+ "currency": "usd",
+ "custom_fields": null,
+ "customer": "cus_PRMXEPuaeY5WWv",
+ "customer_address": null,
+ "customer_email": "[email protected]",
+ "customer_name": null,
+ "customer_phone": null,
+ "customer_shipping": null,
+ "customer_tax_exempt": "none",
+ "customer_tax_ids": [],
+ "default_payment_method": null,
+ "default_source": null,
+ "default_tax_rates": [],
+ "description": null,
+ "discount": null,
+ "discounts": [],
+ "due_date": null,
+ "effective_at": null,
+ "ending_balance": null,
+ "footer": null,
+ "from_invoice": null,
+ "hosted_invoice_url": null,
+ "id": "in_1OcToADEQaroqDjsm80sarLF",
+ "invoice_pdf": null,
+ "issuer": {
+ "type": "self"
+ },
+ "last_finalization_error": null,
+ "latest_revision": null,
+ "lines": {
+ "data": [
+ {
+ "amount": 120000,
+ "amount_excluding_tax": 120000,
+ "currency": "usd",
+ "description": "Zulip Business - renewal",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_1OcTo9DEQaroqDjsdXsPAc6G",
+ "invoice_item": "ii_1OcTo9DEQaroqDjsFXy4kff3",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1364871845,
+ "start": 1333335845
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1706119000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_1OcAgmDEQaroqDjsmTlT6jjs",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_PQEU5cW8VfaPha",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": 120000,
+ "unit_amount_decimal": "120000"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "120000"
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "total_count": 1,
+ "url": "/v1/invoices/in_1OcToADEQaroqDjsm80sarLF/lines"
+ },
+ "livemode": false,
+ "metadata": {},
+ "next_payment_attempt": 1706196094,
+ "number": null,
+ "object": "invoice",
+ "on_behalf_of": null,
+ "paid": false,
+ "paid_out_of_band": false,
+ "payment_intent": null,
+ "payment_settings": {
+ "default_mandate": null,
+ "payment_method_options": null,
+ "payment_method_types": null
+ },
+ "period_end": 1706192494,
+ "period_start": 1706192494,
+ "post_payment_credit_notes_amount": 0,
+ "pre_payment_credit_notes_amount": 0,
+ "quote": null,
+ "receipt_number": null,
+ "rendering": {
+ "amount_tax_display": null,
+ "pdf": {
+ "page_size": "auto"
+ }
+ },
+ "rendering_options": null,
+ "shipping_cost": null,
+ "shipping_details": null,
+ "starting_balance": 0,
+ "statement_descriptor": "Zulip Business",
+ "status": "draft",
+ "status_transitions": {
+ "finalized_at": null,
+ "marked_uncollectible_at": null,
+ "paid_at": null,
+ "voided_at": null
+ },
+ "subscription": null,
+ "subscription_details": {
+ "metadata": null
+ },
+ "subtotal": 120000,
+ "subtotal_excluding_tax": 120000,
+ "tax": null,
+ "test_clock": null,
+ "total": 120000,
+ "total_discount_amounts": [],
+ "total_excluding_tax": 120000,
+ "total_tax_amounts": [],
+ "transfer_data": null,
+ "webhooks_delivered_at": null
+}
diff --git a/corporate/tests/stripe_fixtures/schedule_legacy_plan_upgrade_to_fixed_price_plan--Invoice.finalize_invoice.1.json b/corporate/tests/stripe_fixtures/schedule_legacy_plan_upgrade_to_fixed_price_plan--Invoice.finalize_invoice.1.json
new file mode 100644
index 00000000000..eeb0143aa66
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_legacy_plan_upgrade_to_fixed_price_plan--Invoice.finalize_invoice.1.json
@@ -0,0 +1,162 @@
+{
+ "account_country": "US",
+ "account_name": "Kandra Labs, Inc.",
+ "account_tax_ids": null,
+ "amount_due": 120000,
+ "amount_paid": 0,
+ "amount_remaining": 120000,
+ "amount_shipping": 0,
+ "application": null,
+ "application_fee_amount": null,
+ "attempt_count": 0,
+ "attempted": false,
+ "auto_advance": true,
+ "automatic_tax": {
+ "enabled": false,
+ "liability": null,
+ "status": null
+ },
+ "billing_reason": "manual",
+ "charge": null,
+ "collection_method": "charge_automatically",
+ "created": 1706192494,
+ "currency": "usd",
+ "custom_fields": null,
+ "customer": "cus_PRMXEPuaeY5WWv",
+ "customer_address": null,
+ "customer_email": "[email protected]",
+ "customer_name": null,
+ "customer_phone": null,
+ "customer_shipping": null,
+ "customer_tax_exempt": "none",
+ "customer_tax_ids": [],
+ "default_payment_method": null,
+ "default_source": null,
+ "default_tax_rates": [],
+ "description": null,
+ "discount": null,
+ "discounts": [],
+ "due_date": null,
+ "effective_at": 1706192494,
+ "ending_balance": 0,
+ "footer": null,
+ "from_invoice": null,
+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_17vTkwDEQaroqDjs/test_YWNjdF8xN3ZUa3dERVFhcm9xRGpzLF9QUk1YekR0SFFPcHlMckN4OW5iOEdhcjlmSVZYM25HLDk2NzMzMjk10200jCsoi8I2?s=ap",
+ "id": "in_1OcToADEQaroqDjsm80sarLF",
+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_17vTkwDEQaroqDjs/test_YWNjdF8xN3ZUa3dERVFhcm9xRGpzLF9QUk1YekR0SFFPcHlMckN4OW5iOEdhcjlmSVZYM25HLDk2NzMzMjk10200jCsoi8I2/pdf?s=ap",
+ "issuer": {
+ "type": "self"
+ },
+ "last_finalization_error": null,
+ "latest_revision": null,
+ "lines": {
+ "data": [
+ {
+ "amount": 120000,
+ "amount_excluding_tax": 120000,
+ "currency": "usd",
+ "description": "Zulip Business - renewal",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_1OcTo9DEQaroqDjsdXsPAc6G",
+ "invoice_item": "ii_1OcTo9DEQaroqDjsFXy4kff3",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1364871845,
+ "start": 1333335845
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1706119000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_1OcAgmDEQaroqDjsmTlT6jjs",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_PQEU5cW8VfaPha",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": 120000,
+ "unit_amount_decimal": "120000"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "120000"
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "total_count": 1,
+ "url": "/v1/invoices/in_1OcToADEQaroqDjsm80sarLF/lines"
+ },
+ "livemode": false,
+ "metadata": {},
+ "next_payment_attempt": 1706196094,
+ "number": "88DE2F49-0001",
+ "object": "invoice",
+ "on_behalf_of": null,
+ "paid": false,
+ "paid_out_of_band": false,
+ "payment_intent": "pi_3OcToBDEQaroqDjs1ruxqJjN",
+ "payment_settings": {
+ "default_mandate": null,
+ "payment_method_options": null,
+ "payment_method_types": null
+ },
+ "period_end": 1706192494,
+ "period_start": 1706192494,
+ "post_payment_credit_notes_amount": 0,
+ "pre_payment_credit_notes_amount": 0,
+ "quote": null,
+ "receipt_number": null,
+ "rendering": {
+ "amount_tax_display": null,
+ "pdf": {
+ "page_size": "letter"
+ }
+ },
+ "rendering_options": null,
+ "shipping_cost": null,
+ "shipping_details": null,
+ "starting_balance": 0,
+ "statement_descriptor": "Zulip Business",
+ "status": "open",
+ "status_transitions": {
+ "finalized_at": 1706192494,
+ "marked_uncollectible_at": null,
+ "paid_at": null,
+ "voided_at": null
+ },
+ "subscription": null,
+ "subscription_details": {
+ "metadata": null
+ },
+ "subtotal": 120000,
+ "subtotal_excluding_tax": 120000,
+ "tax": null,
+ "test_clock": null,
+ "total": 120000,
+ "total_discount_amounts": [],
+ "total_excluding_tax": 120000,
+ "total_tax_amounts": [],
+ "transfer_data": null,
+ "webhooks_delivered_at": 1706192494
+}
diff --git a/corporate/tests/stripe_fixtures/schedule_legacy_plan_upgrade_to_fixed_price_plan--Invoice.list.1.json b/corporate/tests/stripe_fixtures/schedule_legacy_plan_upgrade_to_fixed_price_plan--Invoice.list.1.json
new file mode 100644
index 00000000000..e39960ab725
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_legacy_plan_upgrade_to_fixed_price_plan--Invoice.list.1.json
@@ -0,0 +1,6 @@
+{
+ "data": [],
+ "has_more": false,
+ "object": "list",
+ "url": "/v1/invoices"
+}
diff --git a/corporate/tests/stripe_fixtures/schedule_legacy_plan_upgrade_to_fixed_price_plan--InvoiceItem.create.1.json b/corporate/tests/stripe_fixtures/schedule_legacy_plan_upgrade_to_fixed_price_plan--InvoiceItem.create.1.json
new file mode 100644
index 00000000000..155c43aae0b
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_legacy_plan_upgrade_to_fixed_price_plan--InvoiceItem.create.1.json
@@ -0,0 +1,47 @@
+{
+ "amount": 120000,
+ "currency": "usd",
+ "customer": "cus_PRMXEPuaeY5WWv",
+ "date": 1706192493,
+ "description": "Zulip Business - renewal",
+ "discountable": false,
+ "discounts": [],
+ "id": "ii_1OcTo9DEQaroqDjsFXy4kff3",
+ "invoice": null,
+ "livemode": false,
+ "metadata": {},
+ "object": "invoiceitem",
+ "period": {
+ "end": 1364871845,
+ "start": 1333335845
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1706119000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_1OcAgmDEQaroqDjsmTlT6jjs",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_PQEU5cW8VfaPha",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": 120000,
+ "unit_amount_decimal": "120000"
+ },
+ "proration": false,
+ "quantity": 1,
+ "subscription": null,
+ "tax_rates": [],
+ "test_clock": null,
+ "unit_amount": 120000,
+ "unit_amount_decimal": "120000"
+}
diff --git a/corporate/tests/stripe_fixtures/schedule_legacy_plan_upgrade_to_fixed_price_plan--SetupIntent.create.1.json b/corporate/tests/stripe_fixtures/schedule_legacy_plan_upgrade_to_fixed_price_plan--SetupIntent.create.1.json
new file mode 100644
index 00000000000..291e57c3268
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_legacy_plan_upgrade_to_fixed_price_plan--SetupIntent.create.1.json
@@ -0,0 +1,34 @@
+{
+ "application": null,
+ "automatic_payment_methods": null,
+ "cancellation_reason": null,
+ "client_secret": "seti_1OcTo5DEQaroqDjs0dekGC4M_secret_PRMX0eJRUw2W9riXaWkUL81HcYiBCw4",
+ "created": 1706192489,
+ "customer": "cus_PRMXEPuaeY5WWv",
+ "description": null,
+ "flow_directions": null,
+ "id": "seti_1OcTo5DEQaroqDjs0dekGC4M",
+ "last_setup_error": null,
+ "latest_attempt": "setatt_1OcTo5DEQaroqDjs7K4T5m6h",
+ "livemode": false,
+ "mandate": null,
+ "metadata": {},
+ "next_action": null,
+ "object": "setup_intent",
+ "on_behalf_of": null,
+ "payment_method": "pm_1OcTo4DEQaroqDjsvmCoo2VR",
+ "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/schedule_legacy_plan_upgrade_to_fixed_price_plan--SetupIntent.list.1.json b/corporate/tests/stripe_fixtures/schedule_legacy_plan_upgrade_to_fixed_price_plan--SetupIntent.list.1.json
new file mode 100644
index 00000000000..7733df57821
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_legacy_plan_upgrade_to_fixed_price_plan--SetupIntent.list.1.json
@@ -0,0 +1,41 @@
+{
+ "data": [
+ {
+ "application": null,
+ "automatic_payment_methods": null,
+ "cancellation_reason": null,
+ "client_secret": "seti_1OcTo3DEQaroqDjs3j1ucPdL_secret_PRMXUDofj7vbLsA4Do7zjQnV3PFdGbA",
+ "created": 1706192487,
+ "customer": "cus_PRMXEPuaeY5WWv",
+ "description": null,
+ "flow_directions": null,
+ "id": "seti_1OcTo3DEQaroqDjs3j1ucPdL",
+ "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/schedule_legacy_plan_upgrade_to_fixed_price_plan--SetupIntent.retrieve.1.json b/corporate/tests/stripe_fixtures/schedule_legacy_plan_upgrade_to_fixed_price_plan--SetupIntent.retrieve.1.json
new file mode 100644
index 00000000000..291e57c3268
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_legacy_plan_upgrade_to_fixed_price_plan--SetupIntent.retrieve.1.json
@@ -0,0 +1,34 @@
+{
+ "application": null,
+ "automatic_payment_methods": null,
+ "cancellation_reason": null,
+ "client_secret": "seti_1OcTo5DEQaroqDjs0dekGC4M_secret_PRMX0eJRUw2W9riXaWkUL81HcYiBCw4",
+ "created": 1706192489,
+ "customer": "cus_PRMXEPuaeY5WWv",
+ "description": null,
+ "flow_directions": null,
+ "id": "seti_1OcTo5DEQaroqDjs0dekGC4M",
+ "last_setup_error": null,
+ "latest_attempt": "setatt_1OcTo5DEQaroqDjs7K4T5m6h",
+ "livemode": false,
+ "mandate": null,
+ "metadata": {},
+ "next_action": null,
+ "object": "setup_intent",
+ "on_behalf_of": null,
+ "payment_method": "pm_1OcTo4DEQaroqDjsvmCoo2VR",
+ "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/schedule_legacy_plan_upgrade_to_fixed_price_plan--checkout.Session.create.1.json b/corporate/tests/stripe_fixtures/schedule_legacy_plan_upgrade_to_fixed_price_plan--checkout.Session.create.1.json
new file mode 100644
index 00000000000..d3221b2dda4
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_legacy_plan_upgrade_to_fixed_price_plan--checkout.Session.create.1.json
@@ -0,0 +1,75 @@
+{
+ "after_expiration": null,
+ "allow_promotion_codes": null,
+ "amount_subtotal": null,
+ "amount_total": null,
+ "automatic_tax": {
+ "enabled": false,
+ "liability": null,
+ "status": null
+ },
+ "billing_address_collection": null,
+ "cancel_url": "http://selfhosting.testserver/realm/7c17429c-ffc2-4a85-9695-10048ba0fef5/upgrade/?manual_license_management=false&tier=1",
+ "client_reference_id": null,
+ "client_secret": null,
+ "consent": null,
+ "consent_collection": null,
+ "created": 1706192487,
+ "currency": null,
+ "currency_conversion": null,
+ "custom_fields": [],
+ "custom_text": {
+ "after_submit": null,
+ "shipping_address": null,
+ "submit": null,
+ "terms_of_service_acceptance": null
+ },
+ "customer": "cus_PRMXEPuaeY5WWv",
+ "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": 1706278887,
+ "id": "cs_test_c1wlJD2r1U2spTYBiq6tphXHk25eftkFvOl0yFwgzq9UmzqWPlb9MRbvIf",
+ "invoice": null,
+ "invoice_creation": null,
+ "livemode": false,
+ "locale": null,
+ "metadata": {
+ "remote_realm_user_id": "1",
+ "type": "card_update"
+ },
+ "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_1OcTo3DEQaroqDjs3j1ucPdL",
+ "shipping": null,
+ "shipping_address_collection": null,
+ "shipping_options": [],
+ "shipping_rate": null,
+ "status": "open",
+ "submit_type": null,
+ "subscription": null,
+ "success_url": "http://selfhosting.testserver/realm/7c17429c-ffc2-4a85-9695-10048ba0fef5/billing/event_status/?stripe_session_id={CHECKOUT_SESSION_ID}",
+ "total_details": null,
+ "ui_mode": "hosted",
+ "url": "https://checkout.stripe.com/c/pay/cs_test_c1wlJD2r1U2spTYBiq6tphXHk25eftkFvOl0yFwgzq9UmzqWPlb9MRbvIf#fid1d2BpamRhQ2prcSc%2FJ1ZqcHdmYCVWZGt2JVV3aicpJ2R1bE5gfCc%2FJ3VuWnFgdnFaXVRmMU5zNkldQTY9SnNRY09XZml2UXNQJyknY3dqaFZgd3Ngdyc%2FcXdwYCknaWR8anBxUXx1YCc%2FJ3Zsa2JpYFpmamlwaGsnKSdga2RnaWBVaWRmYG1qaWFgd3YnP3F3cGB4JSUl"
+}
diff --git a/corporate/tests/stripe_fixtures/schedule_legacy_plan_upgrade_to_fixed_price_plan--checkout.Session.list.1.json b/corporate/tests/stripe_fixtures/schedule_legacy_plan_upgrade_to_fixed_price_plan--checkout.Session.list.1.json
new file mode 100644
index 00000000000..42fba288440
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_legacy_plan_upgrade_to_fixed_price_plan--checkout.Session.list.1.json
@@ -0,0 +1,82 @@
+{
+ "data": [
+ {
+ "after_expiration": null,
+ "allow_promotion_codes": null,
+ "amount_subtotal": null,
+ "amount_total": null,
+ "automatic_tax": {
+ "enabled": false,
+ "liability": null,
+ "status": null
+ },
+ "billing_address_collection": null,
+ "cancel_url": "http://selfhosting.testserver/realm/7c17429c-ffc2-4a85-9695-10048ba0fef5/upgrade/?manual_license_management=false&tier=1",
+ "client_reference_id": null,
+ "client_secret": null,
+ "consent": null,
+ "consent_collection": null,
+ "created": 1706192487,
+ "currency": null,
+ "currency_conversion": null,
+ "custom_fields": [],
+ "custom_text": {
+ "after_submit": null,
+ "shipping_address": null,
+ "submit": null,
+ "terms_of_service_acceptance": null
+ },
+ "customer": "cus_PRMXEPuaeY5WWv",
+ "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": 1706278887,
+ "id": "cs_test_c1wlJD2r1U2spTYBiq6tphXHk25eftkFvOl0yFwgzq9UmzqWPlb9MRbvIf",
+ "invoice": null,
+ "invoice_creation": null,
+ "livemode": false,
+ "locale": null,
+ "metadata": {
+ "remote_realm_user_id": "1",
+ "type": "card_update"
+ },
+ "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_1OcTo3DEQaroqDjs3j1ucPdL",
+ "shipping": null,
+ "shipping_address_collection": null,
+ "shipping_options": [],
+ "shipping_rate": null,
+ "status": "open",
+ "submit_type": null,
+ "subscription": null,
+ "success_url": "http://selfhosting.testserver/realm/7c17429c-ffc2-4a85-9695-10048ba0fef5/billing/event_status/?stripe_session_id={CHECKOUT_SESSION_ID}",
+ "total_details": null,
+ "ui_mode": "hosted",
+ "url": "https://checkout.stripe.com/c/pay/cs_test_c1wlJD2r1U2spTYBiq6tphXHk25eftkFvOl0yFwgzq9UmzqWPlb9MRbvIf#fid1d2BpamRhQ2prcSc%2FJ1ZqcHdmYCVWZGt2JVV3aicpJ2R1bE5gfCc%2FJ3VuWnFgdnFaXVRmMU5zNkldQTY9SnNRY09XZml2UXNQJyknY3dqaFZgd3Ngdyc%2FcXdwYCknaWR8anBxUXx1YCc%2FJ3Zsa2JpYFpmamlwaGsnKSdga2RnaWBVaWRmYG1qaWFgd3YnP3F3cGB4JSUl"
+ }
+ ],
+ "has_more": true,
+ "object": "list",
+ "url": "/v1/checkout/sessions"
+}
diff --git a/corporate/tests/stripe_fixtures/schedule_server_legacy_plan_upgrade_to_fixed_price_plan--Customer.create.1.json b/corporate/tests/stripe_fixtures/schedule_server_legacy_plan_upgrade_to_fixed_price_plan--Customer.create.1.json
new file mode 100644
index 00000000000..3d6b9bc66c1
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_server_legacy_plan_upgrade_to_fixed_price_plan--Customer.create.1.json
@@ -0,0 +1,33 @@
+{
+ "address": null,
+ "balance": 0,
+ "created": 1000000000,
+ "currency": null,
+ "default_currency": null,
+ "default_source": null,
+ "delinquent": false,
+ "description": "demo.example.com 6cde5f7a-1f7",
+ "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": {
+ "remote_server_str": "demo.example.com 6cde5f7a-1f7",
+ "remote_server_uuid": "6cde5f7a-1f7e-4978-9716-49f69ebfc9fe"
+ },
+ "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/schedule_server_legacy_plan_upgrade_to_fixed_price_plan--Customer.modify.1.json b/corporate/tests/stripe_fixtures/schedule_server_legacy_plan_upgrade_to_fixed_price_plan--Customer.modify.1.json
new file mode 100644
index 00000000000..e4549a34cc9
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_server_legacy_plan_upgrade_to_fixed_price_plan--Customer.modify.1.json
@@ -0,0 +1,33 @@
+{
+ "address": null,
+ "balance": 0,
+ "created": 1000000000,
+ "currency": null,
+ "default_currency": null,
+ "default_source": null,
+ "delinquent": false,
+ "description": "demo.example.com 6cde5f7a-1f7",
+ "discount": null,
+ "email": "[email protected]",
+ "id": "cus_NORMALIZED0001",
+ "invoice_prefix": "NORMA01",
+ "invoice_settings": {
+ "custom_fields": null,
+ "default_payment_method": "pm_1OcUXjDEQaroqDjsQFQ2bE1e",
+ "footer": null,
+ "rendering_options": null
+ },
+ "livemode": false,
+ "metadata": {
+ "remote_server_str": "demo.example.com 6cde5f7a-1f7",
+ "remote_server_uuid": "6cde5f7a-1f7e-4978-9716-49f69ebfc9fe"
+ },
+ "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/schedule_server_legacy_plan_upgrade_to_fixed_price_plan--Customer.retrieve.1.json b/corporate/tests/stripe_fixtures/schedule_server_legacy_plan_upgrade_to_fixed_price_plan--Customer.retrieve.1.json
new file mode 100644
index 00000000000..83a435845f5
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_server_legacy_plan_upgrade_to_fixed_price_plan--Customer.retrieve.1.json
@@ -0,0 +1,79 @@
+{
+ "address": null,
+ "balance": 0,
+ "created": 1000000000,
+ "currency": null,
+ "default_currency": null,
+ "default_source": null,
+ "delinquent": false,
+ "description": "demo.example.com 6cde5f7a-1f7",
+ "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": 1,
+ "exp_year": 2025,
+ "fingerprint": "NORMALIZED000001",
+ "funding": "credit",
+ "generated_from": null,
+ "last4": "4242",
+ "networks": {
+ "available": [
+ "visa"
+ ],
+ "preferred": null
+ },
+ "three_d_secure_usage": {
+ "supported": true
+ },
+ "wallet": null
+ },
+ "created": 1000000000,
+ "customer": "cus_NORMALIZED0001",
+ "id": "pm_1OcUXjDEQaroqDjsQFQ2bE1e",
+ "livemode": false,
+ "metadata": {},
+ "object": "payment_method",
+ "type": "card"
+ },
+ "footer": null,
+ "rendering_options": null
+ },
+ "livemode": false,
+ "metadata": {
+ "remote_server_str": "demo.example.com 6cde5f7a-1f7",
+ "remote_server_uuid": "6cde5f7a-1f7e-4978-9716-49f69ebfc9fe"
+ },
+ "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/schedule_server_legacy_plan_upgrade_to_fixed_price_plan--Customer.retrieve.2.json b/corporate/tests/stripe_fixtures/schedule_server_legacy_plan_upgrade_to_fixed_price_plan--Customer.retrieve.2.json
new file mode 100644
index 00000000000..83a435845f5
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_server_legacy_plan_upgrade_to_fixed_price_plan--Customer.retrieve.2.json
@@ -0,0 +1,79 @@
+{
+ "address": null,
+ "balance": 0,
+ "created": 1000000000,
+ "currency": null,
+ "default_currency": null,
+ "default_source": null,
+ "delinquent": false,
+ "description": "demo.example.com 6cde5f7a-1f7",
+ "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": 1,
+ "exp_year": 2025,
+ "fingerprint": "NORMALIZED000001",
+ "funding": "credit",
+ "generated_from": null,
+ "last4": "4242",
+ "networks": {
+ "available": [
+ "visa"
+ ],
+ "preferred": null
+ },
+ "three_d_secure_usage": {
+ "supported": true
+ },
+ "wallet": null
+ },
+ "created": 1000000000,
+ "customer": "cus_NORMALIZED0001",
+ "id": "pm_1OcUXjDEQaroqDjsQFQ2bE1e",
+ "livemode": false,
+ "metadata": {},
+ "object": "payment_method",
+ "type": "card"
+ },
+ "footer": null,
+ "rendering_options": null
+ },
+ "livemode": false,
+ "metadata": {
+ "remote_server_str": "demo.example.com 6cde5f7a-1f7",
+ "remote_server_uuid": "6cde5f7a-1f7e-4978-9716-49f69ebfc9fe"
+ },
+ "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/schedule_server_legacy_plan_upgrade_to_fixed_price_plan--Customer.retrieve.3.json b/corporate/tests/stripe_fixtures/schedule_server_legacy_plan_upgrade_to_fixed_price_plan--Customer.retrieve.3.json
new file mode 100644
index 00000000000..83a435845f5
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_server_legacy_plan_upgrade_to_fixed_price_plan--Customer.retrieve.3.json
@@ -0,0 +1,79 @@
+{
+ "address": null,
+ "balance": 0,
+ "created": 1000000000,
+ "currency": null,
+ "default_currency": null,
+ "default_source": null,
+ "delinquent": false,
+ "description": "demo.example.com 6cde5f7a-1f7",
+ "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": 1,
+ "exp_year": 2025,
+ "fingerprint": "NORMALIZED000001",
+ "funding": "credit",
+ "generated_from": null,
+ "last4": "4242",
+ "networks": {
+ "available": [
+ "visa"
+ ],
+ "preferred": null
+ },
+ "three_d_secure_usage": {
+ "supported": true
+ },
+ "wallet": null
+ },
+ "created": 1000000000,
+ "customer": "cus_NORMALIZED0001",
+ "id": "pm_1OcUXjDEQaroqDjsQFQ2bE1e",
+ "livemode": false,
+ "metadata": {},
+ "object": "payment_method",
+ "type": "card"
+ },
+ "footer": null,
+ "rendering_options": null
+ },
+ "livemode": false,
+ "metadata": {
+ "remote_server_str": "demo.example.com 6cde5f7a-1f7",
+ "remote_server_uuid": "6cde5f7a-1f7e-4978-9716-49f69ebfc9fe"
+ },
+ "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/schedule_server_legacy_plan_upgrade_to_fixed_price_plan--Customer.retrieve.4.json b/corporate/tests/stripe_fixtures/schedule_server_legacy_plan_upgrade_to_fixed_price_plan--Customer.retrieve.4.json
new file mode 100644
index 00000000000..83a435845f5
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_server_legacy_plan_upgrade_to_fixed_price_plan--Customer.retrieve.4.json
@@ -0,0 +1,79 @@
+{
+ "address": null,
+ "balance": 0,
+ "created": 1000000000,
+ "currency": null,
+ "default_currency": null,
+ "default_source": null,
+ "delinquent": false,
+ "description": "demo.example.com 6cde5f7a-1f7",
+ "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": 1,
+ "exp_year": 2025,
+ "fingerprint": "NORMALIZED000001",
+ "funding": "credit",
+ "generated_from": null,
+ "last4": "4242",
+ "networks": {
+ "available": [
+ "visa"
+ ],
+ "preferred": null
+ },
+ "three_d_secure_usage": {
+ "supported": true
+ },
+ "wallet": null
+ },
+ "created": 1000000000,
+ "customer": "cus_NORMALIZED0001",
+ "id": "pm_1OcUXjDEQaroqDjsQFQ2bE1e",
+ "livemode": false,
+ "metadata": {},
+ "object": "payment_method",
+ "type": "card"
+ },
+ "footer": null,
+ "rendering_options": null
+ },
+ "livemode": false,
+ "metadata": {
+ "remote_server_str": "demo.example.com 6cde5f7a-1f7",
+ "remote_server_uuid": "6cde5f7a-1f7e-4978-9716-49f69ebfc9fe"
+ },
+ "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/schedule_server_legacy_plan_upgrade_to_fixed_price_plan--Invoice.create.1.json b/corporate/tests/stripe_fixtures/schedule_server_legacy_plan_upgrade_to_fixed_price_plan--Invoice.create.1.json
new file mode 100644
index 00000000000..a8cd1350dee
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_server_legacy_plan_upgrade_to_fixed_price_plan--Invoice.create.1.json
@@ -0,0 +1,162 @@
+{
+ "account_country": "US",
+ "account_name": "Kandra Labs, Inc.",
+ "account_tax_ids": null,
+ "amount_due": 120000,
+ "amount_paid": 0,
+ "amount_remaining": 120000,
+ "amount_shipping": 0,
+ "application": null,
+ "application_fee_amount": null,
+ "attempt_count": 0,
+ "attempted": false,
+ "auto_advance": true,
+ "automatic_tax": {
+ "enabled": false,
+ "liability": null,
+ "status": null
+ },
+ "billing_reason": "manual",
+ "charge": null,
+ "collection_method": "charge_automatically",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_fields": null,
+ "customer": "cus_NORMALIZED0001",
+ "customer_address": null,
+ "customer_email": "[email protected]",
+ "customer_name": null,
+ "customer_phone": null,
+ "customer_shipping": null,
+ "customer_tax_exempt": "none",
+ "customer_tax_ids": [],
+ "default_payment_method": null,
+ "default_source": null,
+ "default_tax_rates": [],
+ "description": null,
+ "discount": null,
+ "discounts": [],
+ "due_date": null,
+ "effective_at": null,
+ "ending_balance": null,
+ "footer": null,
+ "from_invoice": null,
+ "hosted_invoice_url": null,
+ "id": "in_NORMALIZED00000000000001",
+ "invoice_pdf": null,
+ "issuer": {
+ "type": "self"
+ },
+ "last_finalization_error": null,
+ "latest_revision": null,
+ "lines": {
+ "data": [
+ {
+ "amount": 120000,
+ "amount_excluding_tax": 120000,
+ "currency": "usd",
+ "description": "Zulip Business - renewal",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_NORMALIZED00000000000001",
+ "invoice_item": "ii_NORMALIZED00000000000001",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1364871845,
+ "start": 1333335845
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_NORMALIZED00000000000001",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_NORMALIZED0001",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": 120000,
+ "unit_amount_decimal": "120000"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "120000"
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "total_count": 1,
+ "url": "/v1/invoices/in_NORMALIZED00000000000001/lines"
+ },
+ "livemode": false,
+ "metadata": {},
+ "next_payment_attempt": 1000000000,
+ "number": null,
+ "object": "invoice",
+ "on_behalf_of": null,
+ "paid": false,
+ "paid_out_of_band": false,
+ "payment_intent": null,
+ "payment_settings": {
+ "default_mandate": null,
+ "payment_method_options": null,
+ "payment_method_types": null
+ },
+ "period_end": 1000000000,
+ "period_start": 1000000000,
+ "post_payment_credit_notes_amount": 0,
+ "pre_payment_credit_notes_amount": 0,
+ "quote": null,
+ "receipt_number": null,
+ "rendering": {
+ "amount_tax_display": null,
+ "pdf": {
+ "page_size": "auto"
+ }
+ },
+ "rendering_options": null,
+ "shipping_cost": null,
+ "shipping_details": null,
+ "starting_balance": 0,
+ "statement_descriptor": "Zulip Business",
+ "status": "draft",
+ "status_transitions": {
+ "finalized_at": null,
+ "marked_uncollectible_at": null,
+ "paid_at": null,
+ "voided_at": null
+ },
+ "subscription": null,
+ "subscription_details": {
+ "metadata": null
+ },
+ "subtotal": 120000,
+ "subtotal_excluding_tax": 120000,
+ "tax": null,
+ "test_clock": null,
+ "total": 120000,
+ "total_discount_amounts": [],
+ "total_excluding_tax": 120000,
+ "total_tax_amounts": [],
+ "transfer_data": null,
+ "webhooks_delivered_at": null
+}
diff --git a/corporate/tests/stripe_fixtures/schedule_server_legacy_plan_upgrade_to_fixed_price_plan--Invoice.finalize_invoice.1.json b/corporate/tests/stripe_fixtures/schedule_server_legacy_plan_upgrade_to_fixed_price_plan--Invoice.finalize_invoice.1.json
new file mode 100644
index 00000000000..b2bb83b5019
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_server_legacy_plan_upgrade_to_fixed_price_plan--Invoice.finalize_invoice.1.json
@@ -0,0 +1,162 @@
+{
+ "account_country": "US",
+ "account_name": "Kandra Labs, Inc.",
+ "account_tax_ids": null,
+ "amount_due": 120000,
+ "amount_paid": 0,
+ "amount_remaining": 120000,
+ "amount_shipping": 0,
+ "application": null,
+ "application_fee_amount": null,
+ "attempt_count": 0,
+ "attempted": false,
+ "auto_advance": true,
+ "automatic_tax": {
+ "enabled": false,
+ "liability": null,
+ "status": null
+ },
+ "billing_reason": "manual",
+ "charge": null,
+ "collection_method": "charge_automatically",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_fields": null,
+ "customer": "cus_NORMALIZED0001",
+ "customer_address": null,
+ "customer_email": "[email protected]",
+ "customer_name": null,
+ "customer_phone": null,
+ "customer_shipping": null,
+ "customer_tax_exempt": "none",
+ "customer_tax_ids": [],
+ "default_payment_method": null,
+ "default_source": null,
+ "default_tax_rates": [],
+ "description": null,
+ "discount": null,
+ "discounts": [],
+ "due_date": null,
+ "effective_at": 1000000000,
+ "ending_balance": 0,
+ "footer": null,
+ "from_invoice": null,
+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QUk5JSmpIQlhHRjd1Wk5zNkhRQWdHbXRVVkR1OUFFLDk2NzM2MTI102007M4QwEgJ?s=ap",
+ "id": "in_NORMALIZED00000000000001",
+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QUk5JSmpIQlhHRjd1Wk5zNkhRQWdHbXRVVkR1OUFFLDk2NzM2MTI102007M4QwEgJ/pdf?s=ap",
+ "issuer": {
+ "type": "self"
+ },
+ "last_finalization_error": null,
+ "latest_revision": null,
+ "lines": {
+ "data": [
+ {
+ "amount": 120000,
+ "amount_excluding_tax": 120000,
+ "currency": "usd",
+ "description": "Zulip Business - renewal",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_NORMALIZED00000000000001",
+ "invoice_item": "ii_NORMALIZED00000000000001",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1364871845,
+ "start": 1333335845
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_NORMALIZED00000000000001",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_NORMALIZED0001",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": 120000,
+ "unit_amount_decimal": "120000"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "120000"
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "total_count": 1,
+ "url": "/v1/invoices/in_NORMALIZED00000000000001/lines"
+ },
+ "livemode": false,
+ "metadata": {},
+ "next_payment_attempt": 1000000000,
+ "number": "NORMALI-0001",
+ "object": "invoice",
+ "on_behalf_of": null,
+ "paid": false,
+ "paid_out_of_band": false,
+ "payment_intent": "pi_NORMALIZED00000000000001",
+ "payment_settings": {
+ "default_mandate": null,
+ "payment_method_options": null,
+ "payment_method_types": null
+ },
+ "period_end": 1000000000,
+ "period_start": 1000000000,
+ "post_payment_credit_notes_amount": 0,
+ "pre_payment_credit_notes_amount": 0,
+ "quote": null,
+ "receipt_number": null,
+ "rendering": {
+ "amount_tax_display": null,
+ "pdf": {
+ "page_size": "letter"
+ }
+ },
+ "rendering_options": null,
+ "shipping_cost": null,
+ "shipping_details": null,
+ "starting_balance": 0,
+ "statement_descriptor": "Zulip Business",
+ "status": "open",
+ "status_transitions": {
+ "finalized_at": 1000000000,
+ "marked_uncollectible_at": null,
+ "paid_at": null,
+ "voided_at": null
+ },
+ "subscription": null,
+ "subscription_details": {
+ "metadata": null
+ },
+ "subtotal": 120000,
+ "subtotal_excluding_tax": 120000,
+ "tax": null,
+ "test_clock": null,
+ "total": 120000,
+ "total_discount_amounts": [],
+ "total_excluding_tax": 120000,
+ "total_tax_amounts": [],
+ "transfer_data": null,
+ "webhooks_delivered_at": null
+}
diff --git a/corporate/tests/stripe_fixtures/schedule_server_legacy_plan_upgrade_to_fixed_price_plan--Invoice.list.1.json b/corporate/tests/stripe_fixtures/schedule_server_legacy_plan_upgrade_to_fixed_price_plan--Invoice.list.1.json
new file mode 100644
index 00000000000..e39960ab725
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_server_legacy_plan_upgrade_to_fixed_price_plan--Invoice.list.1.json
@@ -0,0 +1,6 @@
+{
+ "data": [],
+ "has_more": false,
+ "object": "list",
+ "url": "/v1/invoices"
+}
diff --git a/corporate/tests/stripe_fixtures/schedule_server_legacy_plan_upgrade_to_fixed_price_plan--InvoiceItem.create.1.json b/corporate/tests/stripe_fixtures/schedule_server_legacy_plan_upgrade_to_fixed_price_plan--InvoiceItem.create.1.json
new file mode 100644
index 00000000000..20b4bcf572b
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_server_legacy_plan_upgrade_to_fixed_price_plan--InvoiceItem.create.1.json
@@ -0,0 +1,47 @@
+{
+ "amount": 120000,
+ "currency": "usd",
+ "customer": "cus_NORMALIZED0001",
+ "date": 1000000000,
+ "description": "Zulip Business - renewal",
+ "discountable": false,
+ "discounts": [],
+ "id": "ii_NORMALIZED00000000000001",
+ "invoice": null,
+ "livemode": false,
+ "metadata": {},
+ "object": "invoiceitem",
+ "period": {
+ "end": 1364871845,
+ "start": 1333335845
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_NORMALIZED00000000000001",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_NORMALIZED0001",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": 120000,
+ "unit_amount_decimal": "120000"
+ },
+ "proration": false,
+ "quantity": 1,
+ "subscription": null,
+ "tax_rates": [],
+ "test_clock": null,
+ "unit_amount": 120000,
+ "unit_amount_decimal": "120000"
+}
diff --git a/corporate/tests/stripe_fixtures/schedule_server_legacy_plan_upgrade_to_fixed_price_plan--SetupIntent.create.1.json b/corporate/tests/stripe_fixtures/schedule_server_legacy_plan_upgrade_to_fixed_price_plan--SetupIntent.create.1.json
new file mode 100644
index 00000000000..5a372844175
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_server_legacy_plan_upgrade_to_fixed_price_plan--SetupIntent.create.1.json
@@ -0,0 +1,34 @@
+{
+ "application": null,
+ "automatic_payment_methods": null,
+ "cancellation_reason": null,
+ "client_secret": "seti_1OcUXjDEQaroqDjsCY177nba_secret_PRNIRuso6hw8iyvN4pa79L7bcNGX7te",
+ "created": 1000000000,
+ "customer": "cus_NORMALIZED0001",
+ "description": null,
+ "flow_directions": null,
+ "id": "seti_1OcUXjDEQaroqDjsCY177nba",
+ "last_setup_error": null,
+ "latest_attempt": "setatt_1OcUXjDEQaroqDjsD4HH2KO9",
+ "livemode": false,
+ "mandate": null,
+ "metadata": {},
+ "next_action": null,
+ "object": "setup_intent",
+ "on_behalf_of": null,
+ "payment_method": "pm_1OcUXjDEQaroqDjsQFQ2bE1e",
+ "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/schedule_server_legacy_plan_upgrade_to_fixed_price_plan--SetupIntent.list.1.json b/corporate/tests/stripe_fixtures/schedule_server_legacy_plan_upgrade_to_fixed_price_plan--SetupIntent.list.1.json
new file mode 100644
index 00000000000..27af8080ef7
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_server_legacy_plan_upgrade_to_fixed_price_plan--SetupIntent.list.1.json
@@ -0,0 +1,41 @@
+{
+ "data": [
+ {
+ "application": null,
+ "automatic_payment_methods": null,
+ "cancellation_reason": null,
+ "client_secret": "seti_1OcUXiDEQaroqDjsBdvWwybr_secret_PRNIWvWRbe7YkCuZwogV6a9td6CMigl",
+ "created": 1000000000,
+ "customer": "cus_NORMALIZED0001",
+ "description": null,
+ "flow_directions": null,
+ "id": "seti_1OcUXiDEQaroqDjsBdvWwybr",
+ "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/schedule_server_legacy_plan_upgrade_to_fixed_price_plan--SetupIntent.retrieve.1.json b/corporate/tests/stripe_fixtures/schedule_server_legacy_plan_upgrade_to_fixed_price_plan--SetupIntent.retrieve.1.json
new file mode 100644
index 00000000000..5a372844175
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_server_legacy_plan_upgrade_to_fixed_price_plan--SetupIntent.retrieve.1.json
@@ -0,0 +1,34 @@
+{
+ "application": null,
+ "automatic_payment_methods": null,
+ "cancellation_reason": null,
+ "client_secret": "seti_1OcUXjDEQaroqDjsCY177nba_secret_PRNIRuso6hw8iyvN4pa79L7bcNGX7te",
+ "created": 1000000000,
+ "customer": "cus_NORMALIZED0001",
+ "description": null,
+ "flow_directions": null,
+ "id": "seti_1OcUXjDEQaroqDjsCY177nba",
+ "last_setup_error": null,
+ "latest_attempt": "setatt_1OcUXjDEQaroqDjsD4HH2KO9",
+ "livemode": false,
+ "mandate": null,
+ "metadata": {},
+ "next_action": null,
+ "object": "setup_intent",
+ "on_behalf_of": null,
+ "payment_method": "pm_1OcUXjDEQaroqDjsQFQ2bE1e",
+ "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/schedule_server_legacy_plan_upgrade_to_fixed_price_plan--checkout.Session.create.1.json b/corporate/tests/stripe_fixtures/schedule_server_legacy_plan_upgrade_to_fixed_price_plan--checkout.Session.create.1.json
new file mode 100644
index 00000000000..092e6a3e223
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_server_legacy_plan_upgrade_to_fixed_price_plan--checkout.Session.create.1.json
@@ -0,0 +1,75 @@
+{
+ "after_expiration": null,
+ "allow_promotion_codes": null,
+ "amount_subtotal": null,
+ "amount_total": null,
+ "automatic_tax": {
+ "enabled": false,
+ "liability": null,
+ "status": null
+ },
+ "billing_address_collection": null,
+ "cancel_url": "http://selfhosting.testserver/server/6cde5f7a-1f7e-4978-9716-49f69ebfc9fe/upgrade/?manual_license_management=false&tier=1",
+ "client_reference_id": null,
+ "client_secret": null,
+ "consent": null,
+ "consent_collection": null,
+ "created": 1000000000,
+ "currency": null,
+ "currency_conversion": null,
+ "custom_fields": [],
+ "custom_text": {
+ "after_submit": null,
+ "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_NORMALIZED02XqsWXBDgPDEN2vJOC26R1jM14ULNDesUM4qXM9usYC59Gi",
+ "invoice": null,
+ "invoice_creation": null,
+ "livemode": false,
+ "locale": null,
+ "metadata": {
+ "remote_server_user_id": "1",
+ "type": "card_update"
+ },
+ "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_1OcUXiDEQaroqDjsBdvWwybr",
+ "shipping": null,
+ "shipping_address_collection": null,
+ "shipping_options": [],
+ "shipping_rate": null,
+ "status": "open",
+ "submit_type": null,
+ "subscription": null,
+ "success_url": "http://selfhosting.testserver/server/6cde5f7a-1f7e-4978-9716-49f69ebfc9fe/billing/event_status/?stripe_session_id={CHECKOUT_SESSION_ID}",
+ "total_details": null,
+ "ui_mode": "hosted",
+ "url": "https://checkout.stripe.com/c/pay/cs_test_NORMALIZED02XqsWXBDgPDEN2vJOC26R1jM14ULNDesUM4qXM9usYC59Gi#fid1d2BpamRhQ2prcSc%2FJ1ZqcHdmYCVWZGt2JVV3aicpJ2R1bE5gfCc%2FJ3VuWnFgdnFaXVRmMU5zNkldQTY9SnNRY09XZml2UXNQJyknY3dqaFZgd3Ngdyc%2FcXdwYCknaWR8anBxUXx1YCc%2FJ3Zsa2JpYFpmamlwaGsnKSdga2RnaWBVaWRmYG1qaWFgd3YnP3F3cGB4JSUl"
+}
diff --git a/corporate/tests/stripe_fixtures/schedule_server_legacy_plan_upgrade_to_fixed_price_plan--checkout.Session.list.1.json b/corporate/tests/stripe_fixtures/schedule_server_legacy_plan_upgrade_to_fixed_price_plan--checkout.Session.list.1.json
new file mode 100644
index 00000000000..dd8a7e5b46d
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_server_legacy_plan_upgrade_to_fixed_price_plan--checkout.Session.list.1.json
@@ -0,0 +1,82 @@
+{
+ "data": [
+ {
+ "after_expiration": null,
+ "allow_promotion_codes": null,
+ "amount_subtotal": null,
+ "amount_total": null,
+ "automatic_tax": {
+ "enabled": false,
+ "liability": null,
+ "status": null
+ },
+ "billing_address_collection": null,
+ "cancel_url": "http://selfhosting.testserver/server/6cde5f7a-1f7e-4978-9716-49f69ebfc9fe/upgrade/?manual_license_management=false&tier=1",
+ "client_reference_id": null,
+ "client_secret": null,
+ "consent": null,
+ "consent_collection": null,
+ "created": 1000000000,
+ "currency": null,
+ "currency_conversion": null,
+ "custom_fields": [],
+ "custom_text": {
+ "after_submit": null,
+ "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_NORMALIZED02XqsWXBDgPDEN2vJOC26R1jM14ULNDesUM4qXM9usYC59Gi",
+ "invoice": null,
+ "invoice_creation": null,
+ "livemode": false,
+ "locale": null,
+ "metadata": {
+ "remote_server_user_id": "1",
+ "type": "card_update"
+ },
+ "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_1OcUXiDEQaroqDjsBdvWwybr",
+ "shipping": null,
+ "shipping_address_collection": null,
+ "shipping_options": [],
+ "shipping_rate": null,
+ "status": "open",
+ "submit_type": null,
+ "subscription": null,
+ "success_url": "http://selfhosting.testserver/server/6cde5f7a-1f7e-4978-9716-49f69ebfc9fe/billing/event_status/?stripe_session_id={CHECKOUT_SESSION_ID}",
+ "total_details": null,
+ "ui_mode": "hosted",
+ "url": "https://checkout.stripe.com/c/pay/cs_test_NORMALIZED02XqsWXBDgPDEN2vJOC26R1jM14ULNDesUM4qXM9usYC59Gi#fid1d2BpamRhQ2prcSc%2FJ1ZqcHdmYCVWZGt2JVV3aicpJ2R1bE5gfCc%2FJ3VuWnFgdnFaXVRmMU5zNkldQTY9SnNRY09XZml2UXNQJyknY3dqaFZgd3Ngdyc%2FcXdwYCknaWR8anBxUXx1YCc%2FJ3Zsa2JpYFpmamlwaGsnKSdga2RnaWBVaWRmYG1qaWFgd3YnP3F3cGB4JSUl"
+ }
+ ],
+ "has_more": true,
+ "object": "list",
+ "url": "/v1/checkout/sessions"
+}
diff --git a/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--Customer.create.1.json b/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--Customer.create.1.json
new file mode 100644
index 00000000000..3d6b9bc66c1
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--Customer.create.1.json
@@ -0,0 +1,33 @@
+{
+ "address": null,
+ "balance": 0,
+ "created": 1000000000,
+ "currency": null,
+ "default_currency": null,
+ "default_source": null,
+ "delinquent": false,
+ "description": "demo.example.com 6cde5f7a-1f7",
+ "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": {
+ "remote_server_str": "demo.example.com 6cde5f7a-1f7",
+ "remote_server_uuid": "6cde5f7a-1f7e-4978-9716-49f69ebfc9fe"
+ },
+ "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/schedule_server_upgrade_to_fixed_price_business_plan--Customer.modify.1.json b/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--Customer.modify.1.json
new file mode 100644
index 00000000000..e40d967f175
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--Customer.modify.1.json
@@ -0,0 +1,33 @@
+{
+ "address": null,
+ "balance": 0,
+ "created": 1000000000,
+ "currency": null,
+ "default_currency": null,
+ "default_source": null,
+ "delinquent": false,
+ "description": "demo.example.com 6cde5f7a-1f7",
+ "discount": null,
+ "email": "[email protected]",
+ "id": "cus_NORMALIZED0001",
+ "invoice_prefix": "NORMA01",
+ "invoice_settings": {
+ "custom_fields": null,
+ "default_payment_method": "pm_1OcUN6DEQaroqDjsqTe76J6Y",
+ "footer": null,
+ "rendering_options": null
+ },
+ "livemode": false,
+ "metadata": {
+ "remote_server_str": "demo.example.com 6cde5f7a-1f7",
+ "remote_server_uuid": "6cde5f7a-1f7e-4978-9716-49f69ebfc9fe"
+ },
+ "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/schedule_server_upgrade_to_fixed_price_business_plan--Customer.retrieve.1.json b/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--Customer.retrieve.1.json
new file mode 100644
index 00000000000..267e4bb71b8
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--Customer.retrieve.1.json
@@ -0,0 +1,79 @@
+{
+ "address": null,
+ "balance": 0,
+ "created": 1000000000,
+ "currency": null,
+ "default_currency": null,
+ "default_source": null,
+ "delinquent": false,
+ "description": "demo.example.com 6cde5f7a-1f7",
+ "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": 1,
+ "exp_year": 2025,
+ "fingerprint": "NORMALIZED000001",
+ "funding": "credit",
+ "generated_from": null,
+ "last4": "4242",
+ "networks": {
+ "available": [
+ "visa"
+ ],
+ "preferred": null
+ },
+ "three_d_secure_usage": {
+ "supported": true
+ },
+ "wallet": null
+ },
+ "created": 1000000000,
+ "customer": "cus_NORMALIZED0001",
+ "id": "pm_1OcUN6DEQaroqDjsqTe76J6Y",
+ "livemode": false,
+ "metadata": {},
+ "object": "payment_method",
+ "type": "card"
+ },
+ "footer": null,
+ "rendering_options": null
+ },
+ "livemode": false,
+ "metadata": {
+ "remote_server_str": "demo.example.com 6cde5f7a-1f7",
+ "remote_server_uuid": "6cde5f7a-1f7e-4978-9716-49f69ebfc9fe"
+ },
+ "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/schedule_server_upgrade_to_fixed_price_business_plan--Customer.retrieve.2.json b/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--Customer.retrieve.2.json
new file mode 100644
index 00000000000..267e4bb71b8
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--Customer.retrieve.2.json
@@ -0,0 +1,79 @@
+{
+ "address": null,
+ "balance": 0,
+ "created": 1000000000,
+ "currency": null,
+ "default_currency": null,
+ "default_source": null,
+ "delinquent": false,
+ "description": "demo.example.com 6cde5f7a-1f7",
+ "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": 1,
+ "exp_year": 2025,
+ "fingerprint": "NORMALIZED000001",
+ "funding": "credit",
+ "generated_from": null,
+ "last4": "4242",
+ "networks": {
+ "available": [
+ "visa"
+ ],
+ "preferred": null
+ },
+ "three_d_secure_usage": {
+ "supported": true
+ },
+ "wallet": null
+ },
+ "created": 1000000000,
+ "customer": "cus_NORMALIZED0001",
+ "id": "pm_1OcUN6DEQaroqDjsqTe76J6Y",
+ "livemode": false,
+ "metadata": {},
+ "object": "payment_method",
+ "type": "card"
+ },
+ "footer": null,
+ "rendering_options": null
+ },
+ "livemode": false,
+ "metadata": {
+ "remote_server_str": "demo.example.com 6cde5f7a-1f7",
+ "remote_server_uuid": "6cde5f7a-1f7e-4978-9716-49f69ebfc9fe"
+ },
+ "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/schedule_server_upgrade_to_fixed_price_business_plan--Customer.retrieve.3.json b/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--Customer.retrieve.3.json
new file mode 100644
index 00000000000..267e4bb71b8
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--Customer.retrieve.3.json
@@ -0,0 +1,79 @@
+{
+ "address": null,
+ "balance": 0,
+ "created": 1000000000,
+ "currency": null,
+ "default_currency": null,
+ "default_source": null,
+ "delinquent": false,
+ "description": "demo.example.com 6cde5f7a-1f7",
+ "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": 1,
+ "exp_year": 2025,
+ "fingerprint": "NORMALIZED000001",
+ "funding": "credit",
+ "generated_from": null,
+ "last4": "4242",
+ "networks": {
+ "available": [
+ "visa"
+ ],
+ "preferred": null
+ },
+ "three_d_secure_usage": {
+ "supported": true
+ },
+ "wallet": null
+ },
+ "created": 1000000000,
+ "customer": "cus_NORMALIZED0001",
+ "id": "pm_1OcUN6DEQaroqDjsqTe76J6Y",
+ "livemode": false,
+ "metadata": {},
+ "object": "payment_method",
+ "type": "card"
+ },
+ "footer": null,
+ "rendering_options": null
+ },
+ "livemode": false,
+ "metadata": {
+ "remote_server_str": "demo.example.com 6cde5f7a-1f7",
+ "remote_server_uuid": "6cde5f7a-1f7e-4978-9716-49f69ebfc9fe"
+ },
+ "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/schedule_server_upgrade_to_fixed_price_business_plan--Customer.retrieve.4.json b/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--Customer.retrieve.4.json
new file mode 100644
index 00000000000..267e4bb71b8
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--Customer.retrieve.4.json
@@ -0,0 +1,79 @@
+{
+ "address": null,
+ "balance": 0,
+ "created": 1000000000,
+ "currency": null,
+ "default_currency": null,
+ "default_source": null,
+ "delinquent": false,
+ "description": "demo.example.com 6cde5f7a-1f7",
+ "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": 1,
+ "exp_year": 2025,
+ "fingerprint": "NORMALIZED000001",
+ "funding": "credit",
+ "generated_from": null,
+ "last4": "4242",
+ "networks": {
+ "available": [
+ "visa"
+ ],
+ "preferred": null
+ },
+ "three_d_secure_usage": {
+ "supported": true
+ },
+ "wallet": null
+ },
+ "created": 1000000000,
+ "customer": "cus_NORMALIZED0001",
+ "id": "pm_1OcUN6DEQaroqDjsqTe76J6Y",
+ "livemode": false,
+ "metadata": {},
+ "object": "payment_method",
+ "type": "card"
+ },
+ "footer": null,
+ "rendering_options": null
+ },
+ "livemode": false,
+ "metadata": {
+ "remote_server_str": "demo.example.com 6cde5f7a-1f7",
+ "remote_server_uuid": "6cde5f7a-1f7e-4978-9716-49f69ebfc9fe"
+ },
+ "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/schedule_server_upgrade_to_fixed_price_business_plan--Customer.retrieve.5.json b/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--Customer.retrieve.5.json
new file mode 100644
index 00000000000..323de834d21
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--Customer.retrieve.5.json
@@ -0,0 +1,79 @@
+{
+ "address": null,
+ "balance": 0,
+ "created": 1000000000,
+ "currency": "usd",
+ "default_currency": "usd",
+ "default_source": null,
+ "delinquent": false,
+ "description": "demo.example.com 6cde5f7a-1f7",
+ "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": 1,
+ "exp_year": 2025,
+ "fingerprint": "NORMALIZED000001",
+ "funding": "credit",
+ "generated_from": null,
+ "last4": "4242",
+ "networks": {
+ "available": [
+ "visa"
+ ],
+ "preferred": null
+ },
+ "three_d_secure_usage": {
+ "supported": true
+ },
+ "wallet": null
+ },
+ "created": 1000000000,
+ "customer": "cus_NORMALIZED0001",
+ "id": "pm_1OcUN6DEQaroqDjsqTe76J6Y",
+ "livemode": false,
+ "metadata": {},
+ "object": "payment_method",
+ "type": "card"
+ },
+ "footer": null,
+ "rendering_options": null
+ },
+ "livemode": false,
+ "metadata": {
+ "remote_server_str": "demo.example.com 6cde5f7a-1f7",
+ "remote_server_uuid": "6cde5f7a-1f7e-4978-9716-49f69ebfc9fe"
+ },
+ "name": null,
+ "next_invoice_sequence": 3,
+ "object": "customer",
+ "phone": null,
+ "preferred_locales": [],
+ "shipping": null,
+ "tax_exempt": "none",
+ "test_clock": null
+}
diff --git a/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--Event.list.1.json b/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--Event.list.1.json
new file mode 100644
index 00000000000..6237b500bfc
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--Event.list.1.json
@@ -0,0 +1,60 @@
+{
+ "data": [
+ {
+ "api_version": "2020-08-27",
+ "created": 1000000000,
+ "data": {
+ "object": {
+ "address": null,
+ "balance": 0,
+ "created": 1000000000,
+ "currency": null,
+ "default_currency": null,
+ "default_source": null,
+ "delinquent": false,
+ "description": "demo.example.com 6cde5f7a-1f7",
+ "discount": null,
+ "email": "[email protected]",
+ "id": "cus_NORMALIZED0001",
+ "invoice_prefix": "NORMA01",
+ "invoice_settings": {
+ "custom_fields": null,
+ "default_payment_method": "pm_1OcUN6DEQaroqDjsqTe76J6Y",
+ "footer": null,
+ "rendering_options": null
+ },
+ "livemode": false,
+ "metadata": {
+ "remote_server_str": "demo.example.com 6cde5f7a-1f7",
+ "remote_server_uuid": "6cde5f7a-1f7e-4978-9716-49f69ebfc9fe"
+ },
+ "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_1OcUN8DEQaroqDjs6Wn3qjYu",
+ "livemode": false,
+ "object": "event",
+ "pending_webhooks": 0,
+ "request": {
+ "id": "req_NORMALIZED0001",
+ "idempotency_key": "6ad4d9ea-716b-42ef-a63a-1533533c7394"
+ },
+ "type": "customer.updated"
+ }
+ ],
+ "has_more": true,
+ "object": "list",
+ "url": "/v1/events"
+}
diff --git a/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--Event.list.2.json b/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--Event.list.2.json
new file mode 100644
index 00000000000..8e7babe454a
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--Event.list.2.json
@@ -0,0 +1,447 @@
+{
+ "data": [
+ {
+ "api_version": "2020-08-27",
+ "created": 1000000000,
+ "data": {
+ "object": {
+ "amount": 51600,
+ "amount_capturable": 0,
+ "amount_details": {
+ "tip": {}
+ },
+ "amount_received": 51600,
+ "application": null,
+ "application_fee_amount": null,
+ "automatic_payment_methods": null,
+ "canceled_at": null,
+ "cancellation_reason": null,
+ "capture_method": "automatic",
+ "charges": {
+ "data": [
+ {
+ "amount": 51600,
+ "amount_captured": 51600,
+ "amount_refunded": 0,
+ "application": null,
+ "application_fee": null,
+ "application_fee_amount": null,
+ "balance_transaction": "txn_NORMALIZED00000000000001",
+ "billing_details": {
+ "address": {
+ "city": null,
+ "country": null,
+ "line1": null,
+ "line2": null,
+ "postal_code": null,
+ "state": null
+ },
+ "email": null,
+ "name": null,
+ "phone": null
+ },
+ "calculated_statement_descriptor": "ZULIP BASIC",
+ "captured": true,
+ "created": 1000000000,
+ "currency": "usd",
+ "customer": "cus_NORMALIZED0001",
+ "description": "Upgrade to Zulip Basic, $42.0 x 18 - $20.0 x 12",
+ "destination": null,
+ "dispute": null,
+ "disputed": false,
+ "failure_balance_transaction": null,
+ "failure_code": null,
+ "failure_message": null,
+ "fraud_details": {},
+ "id": "ch_NORMALIZED00000000000001",
+ "invoice": null,
+ "livemode": false,
+ "metadata": {
+ "billing_modality": "charge_automatically",
+ "billing_schedule": "1",
+ "license_management": "automatic",
+ "licenses": "18",
+ "plan_tier": "103",
+ "price_per_license": "4200",
+ "remote_server_host": "demo.example.com",
+ "remote_server_user_email": "[email protected]",
+ "remote_server_user_id": "1",
+ "seat_count": "18",
+ "type": "upgrade"
+ },
+ "object": "charge",
+ "on_behalf_of": null,
+ "order": null,
+ "outcome": {
+ "network_status": "approved_by_network",
+ "reason": null,
+ "risk_level": "normal",
+ "risk_score": 0,
+ "seller_message": "Payment complete.",
+ "type": "authorized"
+ },
+ "paid": true,
+ "payment_intent": "pi_NORMALIZED00000000000001",
+ "payment_method": "pm_1OcUN6DEQaroqDjsqTe76J6Y",
+ "payment_method_details": {
+ "card": {
+ "amount_authorized": 51600,
+ "brand": "visa",
+ "checks": {
+ "address_line1_check": null,
+ "address_postal_code_check": null,
+ "cvc_check": "pass"
+ },
+ "country": "US",
+ "exp_month": 1,
+ "exp_year": 2025,
+ "extended_authorization": {
+ "status": "disabled"
+ },
+ "fingerprint": "NORMALIZED000001",
+ "funding": "credit",
+ "incremental_authorization": {
+ "status": "unavailable"
+ },
+ "installments": null,
+ "last4": "4242",
+ "mandate": null,
+ "multicapture": {
+ "status": "unavailable"
+ },
+ "network": "visa",
+ "network_token": {
+ "used": false
+ },
+ "overcapture": {
+ "maximum_amount_capturable": 51600,
+ "status": "unavailable"
+ },
+ "three_d_secure": null,
+ "wallet": null
+ },
+ "type": "card"
+ },
+ "radar_options": {},
+ "receipt_email": "[email protected]",
+ "receipt_number": null,
+ "receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xN3ZUa3dERVFhcm9xRGpzKOvtya0GMgb0gV0kQhA6LBaX65CTj7kafw5ZR-9zojCiAL6iar3Lsk_d9oDyGUNvPpVAPvPphu1v7BPI",
+ "refunded": false,
+ "refunds": {
+ "data": [],
+ "has_more": false,
+ "object": "list",
+ "total_count": 0,
+ "url": "/v1/charges/ch_NORMALIZED00000000000001/refunds"
+ },
+ "review": null,
+ "shipping": null,
+ "source": null,
+ "source_transfer": null,
+ "statement_descriptor": "Zulip Basic",
+ "statement_descriptor_suffix": null,
+ "status": "succeeded",
+ "transfer_data": null,
+ "transfer_group": null
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "total_count": 1,
+ "url": "/v1/charges?payment_intent=pi_NORMALIZED00000000000001"
+ },
+ "client_secret": "pi_NORMALIZED00000000000001_secret_IJ3QSB7UsjmDnYn4ic3Kiz21j",
+ "confirmation_method": "automatic",
+ "created": 1000000000,
+ "currency": "usd",
+ "customer": "cus_NORMALIZED0001",
+ "description": "Upgrade to Zulip Basic, $42.0 x 18 - $20.0 x 12",
+ "id": "pi_NORMALIZED00000000000001",
+ "invoice": null,
+ "last_payment_error": null,
+ "latest_charge": "ch_NORMALIZED00000000000001",
+ "livemode": false,
+ "metadata": {
+ "billing_modality": "charge_automatically",
+ "billing_schedule": "1",
+ "license_management": "automatic",
+ "licenses": "18",
+ "plan_tier": "103",
+ "price_per_license": "4200",
+ "remote_server_host": "demo.example.com",
+ "remote_server_user_email": "[email protected]",
+ "remote_server_user_id": "1",
+ "seat_count": "18",
+ "type": "upgrade"
+ },
+ "next_action": null,
+ "object": "payment_intent",
+ "on_behalf_of": null,
+ "payment_method": "pm_1OcUN6DEQaroqDjsqTe76J6Y",
+ "payment_method_configuration_details": null,
+ "payment_method_options": {
+ "card": {
+ "installments": null,
+ "mandate_options": null,
+ "network": null,
+ "request_three_d_secure": "automatic"
+ }
+ },
+ "payment_method_types": [
+ "card"
+ ],
+ "processing": null,
+ "receipt_email": "[email protected]",
+ "review": null,
+ "setup_future_usage": null,
+ "shipping": null,
+ "source": null,
+ "statement_descriptor": "Zulip Basic",
+ "statement_descriptor_suffix": null,
+ "status": "succeeded",
+ "transfer_data": null,
+ "transfer_group": null
+ }
+ },
+ "id": "evt_3OcUNCDEQaroqDjs019ohH4Y",
+ "livemode": false,
+ "object": "event",
+ "pending_webhooks": 2,
+ "request": {
+ "id": "req_NORMALIZED0002",
+ "idempotency_key": "c999a274-8a2e-4a0a-88e2-f0e51cb3ff64"
+ },
+ "type": "payment_intent.succeeded"
+ },
+ {
+ "api_version": "2020-08-27",
+ "created": 1000000000,
+ "data": {
+ "object": {
+ "amount": 51600,
+ "amount_captured": 51600,
+ "amount_refunded": 0,
+ "application": null,
+ "application_fee": null,
+ "application_fee_amount": null,
+ "balance_transaction": "txn_NORMALIZED00000000000001",
+ "billing_details": {
+ "address": {
+ "city": null,
+ "country": null,
+ "line1": null,
+ "line2": null,
+ "postal_code": null,
+ "state": null
+ },
+ "email": null,
+ "name": null,
+ "phone": null
+ },
+ "calculated_statement_descriptor": "ZULIP BASIC",
+ "captured": true,
+ "created": 1000000000,
+ "currency": "usd",
+ "customer": "cus_NORMALIZED0001",
+ "description": "Upgrade to Zulip Basic, $42.0 x 18 - $20.0 x 12",
+ "destination": null,
+ "dispute": null,
+ "disputed": false,
+ "failure_balance_transaction": null,
+ "failure_code": null,
+ "failure_message": null,
+ "fraud_details": {},
+ "id": "ch_NORMALIZED00000000000001",
+ "invoice": null,
+ "livemode": false,
+ "metadata": {
+ "billing_modality": "charge_automatically",
+ "billing_schedule": "1",
+ "license_management": "automatic",
+ "licenses": "18",
+ "plan_tier": "103",
+ "price_per_license": "4200",
+ "remote_server_host": "demo.example.com",
+ "remote_server_user_email": "[email protected]",
+ "remote_server_user_id": "1",
+ "seat_count": "18",
+ "type": "upgrade"
+ },
+ "object": "charge",
+ "on_behalf_of": null,
+ "order": null,
+ "outcome": {
+ "network_status": "approved_by_network",
+ "reason": null,
+ "risk_level": "normal",
+ "risk_score": 0,
+ "seller_message": "Payment complete.",
+ "type": "authorized"
+ },
+ "paid": true,
+ "payment_intent": "pi_NORMALIZED00000000000001",
+ "payment_method": "pm_1OcUN6DEQaroqDjsqTe76J6Y",
+ "payment_method_details": {
+ "card": {
+ "amount_authorized": 51600,
+ "brand": "visa",
+ "checks": {
+ "address_line1_check": null,
+ "address_postal_code_check": null,
+ "cvc_check": "pass"
+ },
+ "country": "US",
+ "exp_month": 1,
+ "exp_year": 2025,
+ "extended_authorization": {
+ "status": "disabled"
+ },
+ "fingerprint": "NORMALIZED000001",
+ "funding": "credit",
+ "incremental_authorization": {
+ "status": "unavailable"
+ },
+ "installments": null,
+ "last4": "4242",
+ "mandate": null,
+ "multicapture": {
+ "status": "unavailable"
+ },
+ "network": "visa",
+ "network_token": {
+ "used": false
+ },
+ "overcapture": {
+ "maximum_amount_capturable": 51600,
+ "status": "unavailable"
+ },
+ "three_d_secure": null,
+ "wallet": null
+ },
+ "type": "card"
+ },
+ "radar_options": {},
+ "receipt_email": "[email protected]",
+ "receipt_number": null,
+ "receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xN3ZUa3dERVFhcm9xRGpzKOvtya0GMgaD0WPg3q86LBaQastHR23rqZvlt1kydRLNpET_M99UqClXdHJnqmekd598shAWIfOY_PGv",
+ "refunded": false,
+ "refunds": {
+ "data": [],
+ "has_more": false,
+ "object": "list",
+ "total_count": 0,
+ "url": "/v1/charges/ch_NORMALIZED00000000000001/refunds"
+ },
+ "review": null,
+ "shipping": null,
+ "source": null,
+ "source_transfer": null,
+ "statement_descriptor": "Zulip Basic",
+ "statement_descriptor_suffix": null,
+ "status": "succeeded",
+ "transfer_data": null,
+ "transfer_group": null
+ }
+ },
+ "id": "evt_3OcUNCDEQaroqDjs0G9R2V5f",
+ "livemode": false,
+ "object": "event",
+ "pending_webhooks": 0,
+ "request": {
+ "id": "req_NORMALIZED0002",
+ "idempotency_key": "c999a274-8a2e-4a0a-88e2-f0e51cb3ff64"
+ },
+ "type": "charge.succeeded"
+ },
+ {
+ "api_version": "2020-08-27",
+ "created": 1000000000,
+ "data": {
+ "object": {
+ "amount": 51600,
+ "amount_capturable": 0,
+ "amount_details": {
+ "tip": {}
+ },
+ "amount_received": 0,
+ "application": null,
+ "application_fee_amount": null,
+ "automatic_payment_methods": null,
+ "canceled_at": null,
+ "cancellation_reason": null,
+ "capture_method": "automatic",
+ "charges": {
+ "data": [],
+ "has_more": false,
+ "object": "list",
+ "total_count": 0,
+ "url": "/v1/charges?payment_intent=pi_NORMALIZED00000000000001"
+ },
+ "client_secret": "pi_NORMALIZED00000000000001_secret_IJ3QSB7UsjmDnYn4ic3Kiz21j",
+ "confirmation_method": "automatic",
+ "created": 1000000000,
+ "currency": "usd",
+ "customer": "cus_NORMALIZED0001",
+ "description": "Upgrade to Zulip Basic, $42.0 x 18 - $20.0 x 12",
+ "id": "pi_NORMALIZED00000000000001",
+ "invoice": null,
+ "last_payment_error": null,
+ "latest_charge": null,
+ "livemode": false,
+ "metadata": {
+ "billing_modality": "charge_automatically",
+ "billing_schedule": "1",
+ "license_management": "automatic",
+ "licenses": "18",
+ "plan_tier": "103",
+ "price_per_license": "4200",
+ "remote_server_host": "demo.example.com",
+ "remote_server_user_email": "[email protected]",
+ "remote_server_user_id": "1",
+ "seat_count": "18",
+ "type": "upgrade"
+ },
+ "next_action": null,
+ "object": "payment_intent",
+ "on_behalf_of": null,
+ "payment_method": null,
+ "payment_method_configuration_details": null,
+ "payment_method_options": {
+ "card": {
+ "installments": null,
+ "mandate_options": null,
+ "network": null,
+ "request_three_d_secure": "automatic"
+ }
+ },
+ "payment_method_types": [
+ "card"
+ ],
+ "processing": null,
+ "receipt_email": "[email protected]",
+ "review": null,
+ "setup_future_usage": null,
+ "shipping": null,
+ "source": null,
+ "statement_descriptor": "Zulip Basic",
+ "statement_descriptor_suffix": null,
+ "status": "requires_payment_method",
+ "transfer_data": null,
+ "transfer_group": null
+ }
+ },
+ "id": "evt_3OcUNCDEQaroqDjs0XrELJTo",
+ "livemode": false,
+ "object": "event",
+ "pending_webhooks": 2,
+ "request": {
+ "id": "req_NORMALIZED0002",
+ "idempotency_key": "c999a274-8a2e-4a0a-88e2-f0e51cb3ff64"
+ },
+ "type": "payment_intent.created"
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "url": "/v1/events"
+}
diff --git a/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--Event.list.3.json b/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--Event.list.3.json
new file mode 100644
index 00000000000..4a73bcbfee2
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--Event.list.3.json
@@ -0,0 +1,820 @@
+{
+ "data": [
+ {
+ "api_version": "2020-08-27",
+ "created": 1000000000,
+ "data": {
+ "object": {
+ "account_country": "US",
+ "account_name": "Kandra Labs, Inc.",
+ "account_tax_ids": null,
+ "amount_due": 0,
+ "amount_paid": 0,
+ "amount_remaining": 0,
+ "amount_shipping": 0,
+ "application": null,
+ "application_fee_amount": null,
+ "attempt_count": 0,
+ "attempted": true,
+ "auto_advance": false,
+ "automatic_tax": {
+ "enabled": false,
+ "liability": null,
+ "status": null
+ },
+ "billing_reason": "manual",
+ "charge": null,
+ "collection_method": "charge_automatically",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_fields": null,
+ "customer": "cus_NORMALIZED0001",
+ "customer_address": null,
+ "customer_email": "[email protected]",
+ "customer_name": null,
+ "customer_phone": null,
+ "customer_shipping": null,
+ "customer_tax_exempt": "none",
+ "customer_tax_ids": [],
+ "default_payment_method": null,
+ "default_source": null,
+ "default_tax_rates": [],
+ "description": null,
+ "discount": null,
+ "discounts": [],
+ "due_date": null,
+ "effective_at": 1000000000,
+ "ending_balance": 0,
+ "footer": null,
+ "from_invoice": null,
+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QUk43VTM2cHowYmVoaGRna2JiMDNnR2tuMHYwa21PLDk2NzM1NDcw0200jdTteL9R?s=ap",
+ "id": "in_NORMALIZED00000000000001",
+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QUk43VTM2cHowYmVoaGRna2JiMDNnR2tuMHYwa21PLDk2NzM1NDcw0200jdTteL9R/pdf?s=ap",
+ "issuer": {
+ "type": "self"
+ },
+ "last_finalization_error": null,
+ "latest_revision": null,
+ "lines": {
+ "data": [
+ {
+ "amount": -24000,
+ "amount_excluding_tax": -24000,
+ "currency": "usd",
+ "description": "$20.00/month new customer discount",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_NORMALIZED00000000000001",
+ "invoice_item": "ii_NORMALIZED00000000000001",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1000000000,
+ "start": 1000000000
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_NORMALIZED00000000000001",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_NORMALIZED0001",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": -24000,
+ "unit_amount_decimal": "-24000"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "-24000"
+ },
+ {
+ "amount": 75600,
+ "amount_excluding_tax": 75600,
+ "currency": "usd",
+ "description": "Zulip Basic",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_NORMALIZED00000000000002",
+ "invoice_item": "ii_NORMALIZED00000000000002",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1357095845,
+ "start": 1325473445
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_NORMALIZED00000000000002",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_NORMALIZED0002",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": 4200,
+ "unit_amount_decimal": "4200"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 18,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "4200"
+ },
+ {
+ "amount": -51600,
+ "amount_excluding_tax": -51600,
+ "currency": "usd",
+ "description": "Payment (Card ending in 4242)",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_NORMALIZED00000000000003",
+ "invoice_item": "ii_NORMALIZED00000000000003",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1000000000,
+ "start": 1000000000
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_NORMALIZED00000000000003",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_NORMALIZED0003",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": -51600,
+ "unit_amount_decimal": "-51600"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "-51600"
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "total_count": 3,
+ "url": "/v1/invoices/in_NORMALIZED00000000000001/lines"
+ },
+ "livemode": false,
+ "metadata": {},
+ "next_payment_attempt": null,
+ "number": "NORMALI-0001",
+ "object": "invoice",
+ "on_behalf_of": null,
+ "paid": true,
+ "paid_out_of_band": false,
+ "payment_intent": null,
+ "payment_settings": {
+ "default_mandate": null,
+ "payment_method_options": null,
+ "payment_method_types": null
+ },
+ "period_end": 1000000000,
+ "period_start": 1000000000,
+ "post_payment_credit_notes_amount": 0,
+ "pre_payment_credit_notes_amount": 0,
+ "quote": null,
+ "receipt_number": null,
+ "rendering": {
+ "amount_tax_display": null,
+ "pdf": {
+ "page_size": "letter"
+ }
+ },
+ "rendering_options": null,
+ "shipping_cost": null,
+ "shipping_details": null,
+ "starting_balance": 0,
+ "statement_descriptor": "Zulip Basic",
+ "status": "paid",
+ "status_transitions": {
+ "finalized_at": 1000000000,
+ "marked_uncollectible_at": null,
+ "paid_at": 1000000000,
+ "voided_at": null
+ },
+ "subscription": null,
+ "subscription_details": {
+ "metadata": null
+ },
+ "subtotal": 0,
+ "subtotal_excluding_tax": 0,
+ "tax": null,
+ "test_clock": null,
+ "total": 0,
+ "total_discount_amounts": [],
+ "total_excluding_tax": 0,
+ "total_tax_amounts": [],
+ "transfer_data": null,
+ "webhooks_delivered_at": 1000000000
+ },
+ "previous_attributes": {
+ "attempted": false,
+ "auto_advance": true,
+ "effective_at": null,
+ "ending_balance": null,
+ "hosted_invoice_url": null,
+ "invoice_pdf": null,
+ "next_payment_attempt": 1000000000,
+ "number": null,
+ "paid": false,
+ "rendering": {
+ "pdf": {
+ "page_size": "auto"
+ }
+ },
+ "status": "draft",
+ "status_transitions": {
+ "finalized_at": null,
+ "paid_at": null
+ }
+ }
+ },
+ "id": "evt_1OcUNGDEQaroqDjsjzrXKYlx",
+ "livemode": false,
+ "object": "event",
+ "pending_webhooks": 2,
+ "request": {
+ "id": "req_NORMALIZED0003",
+ "idempotency_key": "ddf949fe-d836-412a-bae8-56cb6f71f244"
+ },
+ "type": "invoice.updated"
+ },
+ {
+ "api_version": "2020-08-27",
+ "created": 1000000000,
+ "data": {
+ "object": {
+ "account_country": "US",
+ "account_name": "Kandra Labs, Inc.",
+ "account_tax_ids": null,
+ "amount_due": 0,
+ "amount_paid": 0,
+ "amount_remaining": 0,
+ "amount_shipping": 0,
+ "application": null,
+ "application_fee_amount": null,
+ "attempt_count": 0,
+ "attempted": false,
+ "auto_advance": true,
+ "automatic_tax": {
+ "enabled": false,
+ "liability": null,
+ "status": null
+ },
+ "billing_reason": "manual",
+ "charge": null,
+ "collection_method": "charge_automatically",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_fields": null,
+ "customer": "cus_NORMALIZED0001",
+ "customer_address": null,
+ "customer_email": "[email protected]",
+ "customer_name": null,
+ "customer_phone": null,
+ "customer_shipping": null,
+ "customer_tax_exempt": "none",
+ "customer_tax_ids": [],
+ "default_payment_method": null,
+ "default_source": null,
+ "default_tax_rates": [],
+ "description": null,
+ "discount": null,
+ "discounts": [],
+ "due_date": null,
+ "effective_at": null,
+ "ending_balance": null,
+ "footer": null,
+ "from_invoice": null,
+ "hosted_invoice_url": null,
+ "id": "in_NORMALIZED00000000000001",
+ "invoice_pdf": null,
+ "issuer": {
+ "type": "self"
+ },
+ "last_finalization_error": null,
+ "latest_revision": null,
+ "lines": {
+ "data": [
+ {
+ "amount": -24000,
+ "amount_excluding_tax": -24000,
+ "currency": "usd",
+ "description": "$20.00/month new customer discount",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_NORMALIZED00000000000001",
+ "invoice_item": "ii_NORMALIZED00000000000001",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1000000000,
+ "start": 1000000000
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_NORMALIZED00000000000001",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_NORMALIZED0001",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": -24000,
+ "unit_amount_decimal": "-24000"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "-24000"
+ },
+ {
+ "amount": 75600,
+ "amount_excluding_tax": 75600,
+ "currency": "usd",
+ "description": "Zulip Basic",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_NORMALIZED00000000000002",
+ "invoice_item": "ii_NORMALIZED00000000000002",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1357095845,
+ "start": 1325473445
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_NORMALIZED00000000000002",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_NORMALIZED0002",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": 4200,
+ "unit_amount_decimal": "4200"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 18,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "4200"
+ },
+ {
+ "amount": -51600,
+ "amount_excluding_tax": -51600,
+ "currency": "usd",
+ "description": "Payment (Card ending in 4242)",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_NORMALIZED00000000000003",
+ "invoice_item": "ii_NORMALIZED00000000000003",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1000000000,
+ "start": 1000000000
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_NORMALIZED00000000000003",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_NORMALIZED0003",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": -51600,
+ "unit_amount_decimal": "-51600"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "-51600"
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "total_count": 3,
+ "url": "/v1/invoices/in_NORMALIZED00000000000001/lines"
+ },
+ "livemode": false,
+ "metadata": {},
+ "next_payment_attempt": 1000000000,
+ "number": null,
+ "object": "invoice",
+ "on_behalf_of": null,
+ "paid": false,
+ "paid_out_of_band": false,
+ "payment_intent": null,
+ "payment_settings": {
+ "default_mandate": null,
+ "payment_method_options": null,
+ "payment_method_types": null
+ },
+ "period_end": 1000000000,
+ "period_start": 1000000000,
+ "post_payment_credit_notes_amount": 0,
+ "pre_payment_credit_notes_amount": 0,
+ "quote": null,
+ "receipt_number": null,
+ "rendering": {
+ "amount_tax_display": null,
+ "pdf": {
+ "page_size": "auto"
+ }
+ },
+ "rendering_options": null,
+ "shipping_cost": null,
+ "shipping_details": null,
+ "starting_balance": 0,
+ "statement_descriptor": "Zulip Basic",
+ "status": "draft",
+ "status_transitions": {
+ "finalized_at": null,
+ "marked_uncollectible_at": null,
+ "paid_at": null,
+ "voided_at": null
+ },
+ "subscription": null,
+ "subscription_details": {
+ "metadata": null
+ },
+ "subtotal": 0,
+ "subtotal_excluding_tax": 0,
+ "tax": null,
+ "test_clock": null,
+ "total": 0,
+ "total_discount_amounts": [],
+ "total_excluding_tax": 0,
+ "total_tax_amounts": [],
+ "transfer_data": null,
+ "webhooks_delivered_at": null
+ }
+ },
+ "id": "evt_1OcUNFDEQaroqDjsQa3BPZiu",
+ "livemode": false,
+ "object": "event",
+ "pending_webhooks": 0,
+ "request": {
+ "id": "req_NORMALIZED0004",
+ "idempotency_key": "85b2a441-7d0f-4b7c-955f-7eb0c37ab1ee"
+ },
+ "type": "invoice.created"
+ },
+ {
+ "api_version": "2020-08-27",
+ "created": 1000000000,
+ "data": {
+ "object": {
+ "amount": -24000,
+ "currency": "usd",
+ "customer": "cus_NORMALIZED0001",
+ "date": 1000000000,
+ "description": "$20.00/month new customer discount",
+ "discountable": false,
+ "discounts": [],
+ "id": "ii_NORMALIZED00000000000001",
+ "invoice": null,
+ "livemode": false,
+ "metadata": {},
+ "object": "invoiceitem",
+ "period": {
+ "end": 1000000000,
+ "start": 1000000000
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_NORMALIZED00000000000001",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_NORMALIZED0001",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": -24000,
+ "unit_amount_decimal": "-24000"
+ },
+ "proration": false,
+ "quantity": 1,
+ "subscription": null,
+ "tax_rates": [],
+ "test_clock": null,
+ "unit_amount": -24000,
+ "unit_amount_decimal": "-24000"
+ }
+ },
+ "id": "evt_1OcUNFDEQaroqDjsKXzJDmcz",
+ "livemode": false,
+ "object": "event",
+ "pending_webhooks": 0,
+ "request": {
+ "id": "req_NORMALIZED0005",
+ "idempotency_key": "f9de0e30-7a35-4587-bde7-1c47b6c409d7"
+ },
+ "type": "invoiceitem.created"
+ },
+ {
+ "api_version": "2020-08-27",
+ "created": 1000000000,
+ "data": {
+ "object": {
+ "amount": 75600,
+ "currency": "usd",
+ "customer": "cus_NORMALIZED0001",
+ "date": 1000000000,
+ "description": "Zulip Basic",
+ "discountable": false,
+ "discounts": [],
+ "id": "ii_NORMALIZED00000000000002",
+ "invoice": null,
+ "livemode": false,
+ "metadata": {},
+ "object": "invoiceitem",
+ "period": {
+ "end": 1357095845,
+ "start": 1325473445
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_NORMALIZED00000000000002",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_NORMALIZED0002",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": 4200,
+ "unit_amount_decimal": "4200"
+ },
+ "proration": false,
+ "quantity": 18,
+ "subscription": null,
+ "tax_rates": [],
+ "test_clock": null,
+ "unit_amount": 4200,
+ "unit_amount_decimal": "4200"
+ }
+ },
+ "id": "evt_1OcUNEDEQaroqDjsB6YrUc0t",
+ "livemode": false,
+ "object": "event",
+ "pending_webhooks": 0,
+ "request": {
+ "id": "req_NORMALIZED0006",
+ "idempotency_key": "6be81a4d-af65-4cb1-8929-33fb851b4746"
+ },
+ "type": "invoiceitem.created"
+ },
+ {
+ "api_version": "2020-08-27",
+ "created": 1000000000,
+ "data": {
+ "object": {
+ "amount": -51600,
+ "currency": "usd",
+ "customer": "cus_NORMALIZED0001",
+ "date": 1000000000,
+ "description": "Payment (Card ending in 4242)",
+ "discountable": false,
+ "discounts": [],
+ "id": "ii_NORMALIZED00000000000003",
+ "invoice": null,
+ "livemode": false,
+ "metadata": {},
+ "object": "invoiceitem",
+ "period": {
+ "end": 1000000000,
+ "start": 1000000000
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_NORMALIZED00000000000003",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_NORMALIZED0003",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": -51600,
+ "unit_amount_decimal": "-51600"
+ },
+ "proration": false,
+ "quantity": 1,
+ "subscription": null,
+ "tax_rates": [],
+ "test_clock": null,
+ "unit_amount": -51600,
+ "unit_amount_decimal": "-51600"
+ }
+ },
+ "id": "evt_1OcUNEDEQaroqDjs6v239YOO",
+ "livemode": false,
+ "object": "event",
+ "pending_webhooks": 0,
+ "request": {
+ "id": "req_NORMALIZED0007",
+ "idempotency_key": "b8edaa1d-a563-459e-a9b4-fbe48ca15287"
+ },
+ "type": "invoiceitem.created"
+ },
+ {
+ "api_version": "2020-08-27",
+ "created": 1000000000,
+ "data": {
+ "object": {
+ "address": null,
+ "balance": 0,
+ "created": 1000000000,
+ "currency": "usd",
+ "default_currency": "usd",
+ "default_source": null,
+ "delinquent": false,
+ "description": "demo.example.com 6cde5f7a-1f7",
+ "discount": null,
+ "email": "[email protected]",
+ "id": "cus_NORMALIZED0001",
+ "invoice_prefix": "NORMA01",
+ "invoice_settings": {
+ "custom_fields": null,
+ "default_payment_method": "pm_1OcUN6DEQaroqDjsqTe76J6Y",
+ "footer": null,
+ "rendering_options": null
+ },
+ "livemode": false,
+ "metadata": {
+ "remote_server_str": "demo.example.com 6cde5f7a-1f7",
+ "remote_server_uuid": "6cde5f7a-1f7e-4978-9716-49f69ebfc9fe"
+ },
+ "name": null,
+ "next_invoice_sequence": 1,
+ "object": "customer",
+ "phone": null,
+ "preferred_locales": [],
+ "shipping": null,
+ "tax_exempt": "none",
+ "test_clock": null
+ },
+ "previous_attributes": {
+ "currency": null,
+ "default_currency": null
+ }
+ },
+ "id": "evt_1OcUNEDEQaroqDjsO1fZ17DW",
+ "livemode": false,
+ "object": "event",
+ "pending_webhooks": 0,
+ "request": {
+ "id": "req_NORMALIZED0007",
+ "idempotency_key": "b8edaa1d-a563-459e-a9b4-fbe48ca15287"
+ },
+ "type": "customer.updated"
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "url": "/v1/events"
+}
diff --git a/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--Event.list.4.json b/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--Event.list.4.json
new file mode 100644
index 00000000000..31a6cebf511
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--Event.list.4.json
@@ -0,0 +1,838 @@
+{
+ "data": [
+ {
+ "api_version": "2020-08-27",
+ "created": 1000000000,
+ "data": {
+ "object": {
+ "account_country": "US",
+ "account_name": "Kandra Labs, Inc.",
+ "account_tax_ids": null,
+ "amount_due": 0,
+ "amount_paid": 0,
+ "amount_remaining": 0,
+ "amount_shipping": 0,
+ "application": null,
+ "application_fee_amount": null,
+ "attempt_count": 0,
+ "attempted": true,
+ "auto_advance": false,
+ "automatic_tax": {
+ "enabled": false,
+ "liability": null,
+ "status": null
+ },
+ "billing_reason": "manual",
+ "charge": null,
+ "collection_method": "charge_automatically",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_fields": null,
+ "customer": "cus_NORMALIZED0001",
+ "customer_address": null,
+ "customer_email": "[email protected]",
+ "customer_name": null,
+ "customer_phone": null,
+ "customer_shipping": null,
+ "customer_tax_exempt": "none",
+ "customer_tax_ids": [],
+ "default_payment_method": null,
+ "default_source": null,
+ "default_tax_rates": [],
+ "description": null,
+ "discount": null,
+ "discounts": [],
+ "due_date": null,
+ "effective_at": 1000000000,
+ "ending_balance": 0,
+ "footer": null,
+ "from_invoice": null,
+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QUk43VTM2cHowYmVoaGRna2JiMDNnR2tuMHYwa21PLDk2NzM1NDcx0200zIA4VJsS?s=ap",
+ "id": "in_NORMALIZED00000000000001",
+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QUk43VTM2cHowYmVoaGRna2JiMDNnR2tuMHYwa21PLDk2NzM1NDcx0200zIA4VJsS/pdf?s=ap",
+ "issuer": {
+ "type": "self"
+ },
+ "last_finalization_error": null,
+ "latest_revision": null,
+ "lines": {
+ "data": [
+ {
+ "amount": -24000,
+ "amount_excluding_tax": -24000,
+ "currency": "usd",
+ "description": "$20.00/month new customer discount",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_NORMALIZED00000000000001",
+ "invoice_item": "ii_NORMALIZED00000000000001",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1000000000,
+ "start": 1000000000
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_NORMALIZED00000000000001",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_NORMALIZED0001",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": -24000,
+ "unit_amount_decimal": "-24000"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "-24000"
+ },
+ {
+ "amount": 75600,
+ "amount_excluding_tax": 75600,
+ "currency": "usd",
+ "description": "Zulip Basic",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_NORMALIZED00000000000002",
+ "invoice_item": "ii_NORMALIZED00000000000002",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1357095845,
+ "start": 1325473445
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_NORMALIZED00000000000002",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_NORMALIZED0002",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": 4200,
+ "unit_amount_decimal": "4200"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 18,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "4200"
+ },
+ {
+ "amount": -51600,
+ "amount_excluding_tax": -51600,
+ "currency": "usd",
+ "description": "Payment (Card ending in 4242)",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_NORMALIZED00000000000003",
+ "invoice_item": "ii_NORMALIZED00000000000003",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1000000000,
+ "start": 1000000000
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_NORMALIZED00000000000003",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_NORMALIZED0003",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": -51600,
+ "unit_amount_decimal": "-51600"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "-51600"
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "total_count": 3,
+ "url": "/v1/invoices/in_NORMALIZED00000000000001/lines"
+ },
+ "livemode": false,
+ "metadata": {},
+ "next_payment_attempt": null,
+ "number": "NORMALI-0002",
+ "object": "invoice",
+ "on_behalf_of": null,
+ "paid": true,
+ "paid_out_of_band": false,
+ "payment_intent": null,
+ "payment_settings": {
+ "default_mandate": null,
+ "payment_method_options": null,
+ "payment_method_types": null
+ },
+ "period_end": 1000000000,
+ "period_start": 1000000000,
+ "post_payment_credit_notes_amount": 0,
+ "pre_payment_credit_notes_amount": 0,
+ "quote": null,
+ "receipt_number": null,
+ "rendering": {
+ "amount_tax_display": null,
+ "pdf": {
+ "page_size": "letter"
+ }
+ },
+ "rendering_options": null,
+ "shipping_cost": null,
+ "shipping_details": null,
+ "starting_balance": 0,
+ "statement_descriptor": "Zulip Basic",
+ "status": "paid",
+ "status_transitions": {
+ "finalized_at": 1000000000,
+ "marked_uncollectible_at": null,
+ "paid_at": 1000000000,
+ "voided_at": null
+ },
+ "subscription": null,
+ "subscription_details": {
+ "metadata": null
+ },
+ "subtotal": 0,
+ "subtotal_excluding_tax": 0,
+ "tax": null,
+ "test_clock": null,
+ "total": 0,
+ "total_discount_amounts": [],
+ "total_excluding_tax": 0,
+ "total_tax_amounts": [],
+ "transfer_data": null,
+ "webhooks_delivered_at": 1000000000
+ }
+ },
+ "id": "evt_1OcUNHDEQaroqDjsHy9Ur1sL",
+ "livemode": false,
+ "object": "event",
+ "pending_webhooks": 2,
+ "request": {
+ "id": "req_NORMALIZED0003",
+ "idempotency_key": "ddf949fe-d836-412a-bae8-56cb6f71f244"
+ },
+ "type": "invoice.payment_succeeded"
+ },
+ {
+ "api_version": "2020-08-27",
+ "created": 1000000000,
+ "data": {
+ "object": {
+ "account_country": "US",
+ "account_name": "Kandra Labs, Inc.",
+ "account_tax_ids": null,
+ "amount_due": 0,
+ "amount_paid": 0,
+ "amount_remaining": 0,
+ "amount_shipping": 0,
+ "application": null,
+ "application_fee_amount": null,
+ "attempt_count": 0,
+ "attempted": true,
+ "auto_advance": false,
+ "automatic_tax": {
+ "enabled": false,
+ "liability": null,
+ "status": null
+ },
+ "billing_reason": "manual",
+ "charge": null,
+ "collection_method": "charge_automatically",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_fields": null,
+ "customer": "cus_NORMALIZED0001",
+ "customer_address": null,
+ "customer_email": "[email protected]",
+ "customer_name": null,
+ "customer_phone": null,
+ "customer_shipping": null,
+ "customer_tax_exempt": "none",
+ "customer_tax_ids": [],
+ "default_payment_method": null,
+ "default_source": null,
+ "default_tax_rates": [],
+ "description": null,
+ "discount": null,
+ "discounts": [],
+ "due_date": null,
+ "effective_at": 1000000000,
+ "ending_balance": 0,
+ "footer": null,
+ "from_invoice": null,
+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QUk43VTM2cHowYmVoaGRna2JiMDNnR2tuMHYwa21PLDk2NzM1NDcx0200zIA4VJsS?s=ap",
+ "id": "in_NORMALIZED00000000000001",
+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QUk43VTM2cHowYmVoaGRna2JiMDNnR2tuMHYwa21PLDk2NzM1NDcx0200zIA4VJsS/pdf?s=ap",
+ "issuer": {
+ "type": "self"
+ },
+ "last_finalization_error": null,
+ "latest_revision": null,
+ "lines": {
+ "data": [
+ {
+ "amount": -24000,
+ "amount_excluding_tax": -24000,
+ "currency": "usd",
+ "description": "$20.00/month new customer discount",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_NORMALIZED00000000000001",
+ "invoice_item": "ii_NORMALIZED00000000000001",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1000000000,
+ "start": 1000000000
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_NORMALIZED00000000000001",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_NORMALIZED0001",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": -24000,
+ "unit_amount_decimal": "-24000"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "-24000"
+ },
+ {
+ "amount": 75600,
+ "amount_excluding_tax": 75600,
+ "currency": "usd",
+ "description": "Zulip Basic",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_NORMALIZED00000000000002",
+ "invoice_item": "ii_NORMALIZED00000000000002",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1357095845,
+ "start": 1325473445
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_NORMALIZED00000000000002",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_NORMALIZED0002",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": 4200,
+ "unit_amount_decimal": "4200"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 18,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "4200"
+ },
+ {
+ "amount": -51600,
+ "amount_excluding_tax": -51600,
+ "currency": "usd",
+ "description": "Payment (Card ending in 4242)",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_NORMALIZED00000000000003",
+ "invoice_item": "ii_NORMALIZED00000000000003",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1000000000,
+ "start": 1000000000
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_NORMALIZED00000000000003",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_NORMALIZED0003",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": -51600,
+ "unit_amount_decimal": "-51600"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "-51600"
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "total_count": 3,
+ "url": "/v1/invoices/in_NORMALIZED00000000000001/lines"
+ },
+ "livemode": false,
+ "metadata": {},
+ "next_payment_attempt": null,
+ "number": "NORMALI-0002",
+ "object": "invoice",
+ "on_behalf_of": null,
+ "paid": true,
+ "paid_out_of_band": false,
+ "payment_intent": null,
+ "payment_settings": {
+ "default_mandate": null,
+ "payment_method_options": null,
+ "payment_method_types": null
+ },
+ "period_end": 1000000000,
+ "period_start": 1000000000,
+ "post_payment_credit_notes_amount": 0,
+ "pre_payment_credit_notes_amount": 0,
+ "quote": null,
+ "receipt_number": null,
+ "rendering": {
+ "amount_tax_display": null,
+ "pdf": {
+ "page_size": "letter"
+ }
+ },
+ "rendering_options": null,
+ "shipping_cost": null,
+ "shipping_details": null,
+ "starting_balance": 0,
+ "statement_descriptor": "Zulip Basic",
+ "status": "paid",
+ "status_transitions": {
+ "finalized_at": 1000000000,
+ "marked_uncollectible_at": null,
+ "paid_at": 1000000000,
+ "voided_at": null
+ },
+ "subscription": null,
+ "subscription_details": {
+ "metadata": null
+ },
+ "subtotal": 0,
+ "subtotal_excluding_tax": 0,
+ "tax": null,
+ "test_clock": null,
+ "total": 0,
+ "total_discount_amounts": [],
+ "total_excluding_tax": 0,
+ "total_tax_amounts": [],
+ "transfer_data": null,
+ "webhooks_delivered_at": 1000000000
+ }
+ },
+ "id": "evt_1OcUNHDEQaroqDjsr4mnGdvC",
+ "livemode": false,
+ "object": "event",
+ "pending_webhooks": 0,
+ "request": {
+ "id": "req_NORMALIZED0003",
+ "idempotency_key": "ddf949fe-d836-412a-bae8-56cb6f71f244"
+ },
+ "type": "invoice.paid"
+ },
+ {
+ "api_version": "2020-08-27",
+ "created": 1000000000,
+ "data": {
+ "object": {
+ "account_country": "US",
+ "account_name": "Kandra Labs, Inc.",
+ "account_tax_ids": null,
+ "amount_due": 0,
+ "amount_paid": 0,
+ "amount_remaining": 0,
+ "amount_shipping": 0,
+ "application": null,
+ "application_fee_amount": null,
+ "attempt_count": 0,
+ "attempted": true,
+ "auto_advance": false,
+ "automatic_tax": {
+ "enabled": false,
+ "liability": null,
+ "status": null
+ },
+ "billing_reason": "manual",
+ "charge": null,
+ "collection_method": "charge_automatically",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_fields": null,
+ "customer": "cus_NORMALIZED0001",
+ "customer_address": null,
+ "customer_email": "[email protected]",
+ "customer_name": null,
+ "customer_phone": null,
+ "customer_shipping": null,
+ "customer_tax_exempt": "none",
+ "customer_tax_ids": [],
+ "default_payment_method": null,
+ "default_source": null,
+ "default_tax_rates": [],
+ "description": null,
+ "discount": null,
+ "discounts": [],
+ "due_date": null,
+ "effective_at": 1000000000,
+ "ending_balance": 0,
+ "footer": null,
+ "from_invoice": null,
+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QUk43VTM2cHowYmVoaGRna2JiMDNnR2tuMHYwa21PLDk2NzM1NDcw0200jdTteL9R?s=ap",
+ "id": "in_NORMALIZED00000000000001",
+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QUk43VTM2cHowYmVoaGRna2JiMDNnR2tuMHYwa21PLDk2NzM1NDcw0200jdTteL9R/pdf?s=ap",
+ "issuer": {
+ "type": "self"
+ },
+ "last_finalization_error": null,
+ "latest_revision": null,
+ "lines": {
+ "data": [
+ {
+ "amount": -24000,
+ "amount_excluding_tax": -24000,
+ "currency": "usd",
+ "description": "$20.00/month new customer discount",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_NORMALIZED00000000000001",
+ "invoice_item": "ii_NORMALIZED00000000000001",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1000000000,
+ "start": 1000000000
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_NORMALIZED00000000000001",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_NORMALIZED0001",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": -24000,
+ "unit_amount_decimal": "-24000"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "-24000"
+ },
+ {
+ "amount": 75600,
+ "amount_excluding_tax": 75600,
+ "currency": "usd",
+ "description": "Zulip Basic",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_NORMALIZED00000000000002",
+ "invoice_item": "ii_NORMALIZED00000000000002",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1357095845,
+ "start": 1325473445
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_NORMALIZED00000000000002",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_NORMALIZED0002",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": 4200,
+ "unit_amount_decimal": "4200"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 18,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "4200"
+ },
+ {
+ "amount": -51600,
+ "amount_excluding_tax": -51600,
+ "currency": "usd",
+ "description": "Payment (Card ending in 4242)",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_NORMALIZED00000000000003",
+ "invoice_item": "ii_NORMALIZED00000000000003",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1000000000,
+ "start": 1000000000
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_NORMALIZED00000000000003",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_NORMALIZED0003",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": -51600,
+ "unit_amount_decimal": "-51600"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "-51600"
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "total_count": 3,
+ "url": "/v1/invoices/in_NORMALIZED00000000000001/lines"
+ },
+ "livemode": false,
+ "metadata": {},
+ "next_payment_attempt": null,
+ "number": "NORMALI-0002",
+ "object": "invoice",
+ "on_behalf_of": null,
+ "paid": true,
+ "paid_out_of_band": false,
+ "payment_intent": null,
+ "payment_settings": {
+ "default_mandate": null,
+ "payment_method_options": null,
+ "payment_method_types": null
+ },
+ "period_end": 1000000000,
+ "period_start": 1000000000,
+ "post_payment_credit_notes_amount": 0,
+ "pre_payment_credit_notes_amount": 0,
+ "quote": null,
+ "receipt_number": null,
+ "rendering": {
+ "amount_tax_display": null,
+ "pdf": {
+ "page_size": "letter"
+ }
+ },
+ "rendering_options": null,
+ "shipping_cost": null,
+ "shipping_details": null,
+ "starting_balance": 0,
+ "statement_descriptor": "Zulip Basic",
+ "status": "paid",
+ "status_transitions": {
+ "finalized_at": 1000000000,
+ "marked_uncollectible_at": null,
+ "paid_at": 1000000000,
+ "voided_at": null
+ },
+ "subscription": null,
+ "subscription_details": {
+ "metadata": null
+ },
+ "subtotal": 0,
+ "subtotal_excluding_tax": 0,
+ "tax": null,
+ "test_clock": null,
+ "total": 0,
+ "total_discount_amounts": [],
+ "total_excluding_tax": 0,
+ "total_tax_amounts": [],
+ "transfer_data": null,
+ "webhooks_delivered_at": 1000000000
+ }
+ },
+ "id": "evt_1OcUNHDEQaroqDjsRU8RvtDO",
+ "livemode": false,
+ "object": "event",
+ "pending_webhooks": 0,
+ "request": {
+ "id": "req_NORMALIZED0003",
+ "idempotency_key": "ddf949fe-d836-412a-bae8-56cb6f71f244"
+ },
+ "type": "invoice.finalized"
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "url": "/v1/events"
+}
diff --git a/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--Event.list.5.json b/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--Event.list.5.json
new file mode 100644
index 00000000000..6d922067afe
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--Event.list.5.json
@@ -0,0 +1,6 @@
+{
+ "data": [],
+ "has_more": false,
+ "object": "list",
+ "url": "/v1/events"
+}
diff --git a/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--Invoice.create.1.json b/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--Invoice.create.1.json
new file mode 100644
index 00000000000..9b4d3b824a8
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--Invoice.create.1.json
@@ -0,0 +1,262 @@
+{
+ "account_country": "US",
+ "account_name": "Kandra Labs, Inc.",
+ "account_tax_ids": null,
+ "amount_due": 0,
+ "amount_paid": 0,
+ "amount_remaining": 0,
+ "amount_shipping": 0,
+ "application": null,
+ "application_fee_amount": null,
+ "attempt_count": 0,
+ "attempted": false,
+ "auto_advance": true,
+ "automatic_tax": {
+ "enabled": false,
+ "liability": null,
+ "status": null
+ },
+ "billing_reason": "manual",
+ "charge": null,
+ "collection_method": "charge_automatically",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_fields": null,
+ "customer": "cus_NORMALIZED0001",
+ "customer_address": null,
+ "customer_email": "[email protected]",
+ "customer_name": null,
+ "customer_phone": null,
+ "customer_shipping": null,
+ "customer_tax_exempt": "none",
+ "customer_tax_ids": [],
+ "default_payment_method": null,
+ "default_source": null,
+ "default_tax_rates": [],
+ "description": null,
+ "discount": null,
+ "discounts": [],
+ "due_date": null,
+ "effective_at": null,
+ "ending_balance": null,
+ "footer": null,
+ "from_invoice": null,
+ "hosted_invoice_url": null,
+ "id": "in_NORMALIZED00000000000001",
+ "invoice_pdf": null,
+ "issuer": {
+ "type": "self"
+ },
+ "last_finalization_error": null,
+ "latest_revision": null,
+ "lines": {
+ "data": [
+ {
+ "amount": -24000,
+ "amount_excluding_tax": -24000,
+ "currency": "usd",
+ "description": "$20.00/month new customer discount",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_NORMALIZED00000000000001",
+ "invoice_item": "ii_NORMALIZED00000000000001",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1000000000,
+ "start": 1000000000
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_NORMALIZED00000000000001",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_NORMALIZED0001",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": -24000,
+ "unit_amount_decimal": "-24000"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "-24000"
+ },
+ {
+ "amount": 75600,
+ "amount_excluding_tax": 75600,
+ "currency": "usd",
+ "description": "Zulip Basic",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_NORMALIZED00000000000002",
+ "invoice_item": "ii_NORMALIZED00000000000002",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1357095845,
+ "start": 1325473445
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_NORMALIZED00000000000002",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_NORMALIZED0002",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": 4200,
+ "unit_amount_decimal": "4200"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 18,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "4200"
+ },
+ {
+ "amount": -51600,
+ "amount_excluding_tax": -51600,
+ "currency": "usd",
+ "description": "Payment (Card ending in 4242)",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_NORMALIZED00000000000003",
+ "invoice_item": "ii_NORMALIZED00000000000003",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1000000000,
+ "start": 1000000000
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_NORMALIZED00000000000003",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_NORMALIZED0003",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": -51600,
+ "unit_amount_decimal": "-51600"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "-51600"
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "total_count": 3,
+ "url": "/v1/invoices/in_NORMALIZED00000000000001/lines"
+ },
+ "livemode": false,
+ "metadata": {},
+ "next_payment_attempt": 1000000000,
+ "number": null,
+ "object": "invoice",
+ "on_behalf_of": null,
+ "paid": false,
+ "paid_out_of_band": false,
+ "payment_intent": null,
+ "payment_settings": {
+ "default_mandate": null,
+ "payment_method_options": null,
+ "payment_method_types": null
+ },
+ "period_end": 1000000000,
+ "period_start": 1000000000,
+ "post_payment_credit_notes_amount": 0,
+ "pre_payment_credit_notes_amount": 0,
+ "quote": null,
+ "receipt_number": null,
+ "rendering": {
+ "amount_tax_display": null,
+ "pdf": {
+ "page_size": "auto"
+ }
+ },
+ "rendering_options": null,
+ "shipping_cost": null,
+ "shipping_details": null,
+ "starting_balance": 0,
+ "statement_descriptor": "Zulip Basic",
+ "status": "draft",
+ "status_transitions": {
+ "finalized_at": null,
+ "marked_uncollectible_at": null,
+ "paid_at": null,
+ "voided_at": null
+ },
+ "subscription": null,
+ "subscription_details": {
+ "metadata": null
+ },
+ "subtotal": 0,
+ "subtotal_excluding_tax": 0,
+ "tax": null,
+ "test_clock": null,
+ "total": 0,
+ "total_discount_amounts": [],
+ "total_excluding_tax": 0,
+ "total_tax_amounts": [],
+ "transfer_data": null,
+ "webhooks_delivered_at": null
+}
diff --git a/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--Invoice.create.2.json b/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--Invoice.create.2.json
new file mode 100644
index 00000000000..9d08efb7ea2
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--Invoice.create.2.json
@@ -0,0 +1,162 @@
+{
+ "account_country": "US",
+ "account_name": "Kandra Labs, Inc.",
+ "account_tax_ids": null,
+ "amount_due": 120000,
+ "amount_paid": 0,
+ "amount_remaining": 120000,
+ "amount_shipping": 0,
+ "application": null,
+ "application_fee_amount": null,
+ "attempt_count": 0,
+ "attempted": false,
+ "auto_advance": true,
+ "automatic_tax": {
+ "enabled": false,
+ "liability": null,
+ "status": null
+ },
+ "billing_reason": "manual",
+ "charge": null,
+ "collection_method": "charge_automatically",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_fields": null,
+ "customer": "cus_NORMALIZED0001",
+ "customer_address": null,
+ "customer_email": "[email protected]",
+ "customer_name": null,
+ "customer_phone": null,
+ "customer_shipping": null,
+ "customer_tax_exempt": "none",
+ "customer_tax_ids": [],
+ "default_payment_method": null,
+ "default_source": null,
+ "default_tax_rates": [],
+ "description": null,
+ "discount": null,
+ "discounts": [],
+ "due_date": null,
+ "effective_at": null,
+ "ending_balance": null,
+ "footer": null,
+ "from_invoice": null,
+ "hosted_invoice_url": null,
+ "id": "in_NORMALIZED00000000000002",
+ "invoice_pdf": null,
+ "issuer": {
+ "type": "self"
+ },
+ "last_finalization_error": null,
+ "latest_revision": null,
+ "lines": {
+ "data": [
+ {
+ "amount": 120000,
+ "amount_excluding_tax": 120000,
+ "currency": "usd",
+ "description": "Zulip Business - renewal",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_NORMALIZED00000000000004",
+ "invoice_item": "ii_NORMALIZED00000000000004",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1362193445,
+ "start": 1330657445
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_NORMALIZED00000000000004",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_NORMALIZED0004",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": 120000,
+ "unit_amount_decimal": "120000"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "120000"
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "total_count": 1,
+ "url": "/v1/invoices/in_NORMALIZED00000000000002/lines"
+ },
+ "livemode": false,
+ "metadata": {},
+ "next_payment_attempt": 1000000000,
+ "number": null,
+ "object": "invoice",
+ "on_behalf_of": null,
+ "paid": false,
+ "paid_out_of_band": false,
+ "payment_intent": null,
+ "payment_settings": {
+ "default_mandate": null,
+ "payment_method_options": null,
+ "payment_method_types": null
+ },
+ "period_end": 1000000000,
+ "period_start": 1000000000,
+ "post_payment_credit_notes_amount": 0,
+ "pre_payment_credit_notes_amount": 0,
+ "quote": null,
+ "receipt_number": null,
+ "rendering": {
+ "amount_tax_display": null,
+ "pdf": {
+ "page_size": "auto"
+ }
+ },
+ "rendering_options": null,
+ "shipping_cost": null,
+ "shipping_details": null,
+ "starting_balance": 0,
+ "statement_descriptor": "Zulip Business",
+ "status": "draft",
+ "status_transitions": {
+ "finalized_at": null,
+ "marked_uncollectible_at": null,
+ "paid_at": null,
+ "voided_at": null
+ },
+ "subscription": null,
+ "subscription_details": {
+ "metadata": null
+ },
+ "subtotal": 120000,
+ "subtotal_excluding_tax": 120000,
+ "tax": null,
+ "test_clock": null,
+ "total": 120000,
+ "total_discount_amounts": [],
+ "total_excluding_tax": 120000,
+ "total_tax_amounts": [],
+ "transfer_data": null,
+ "webhooks_delivered_at": null
+}
diff --git a/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--Invoice.finalize_invoice.1.json b/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--Invoice.finalize_invoice.1.json
new file mode 100644
index 00000000000..dc4434647af
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--Invoice.finalize_invoice.1.json
@@ -0,0 +1,262 @@
+{
+ "account_country": "US",
+ "account_name": "Kandra Labs, Inc.",
+ "account_tax_ids": null,
+ "amount_due": 0,
+ "amount_paid": 0,
+ "amount_remaining": 0,
+ "amount_shipping": 0,
+ "application": null,
+ "application_fee_amount": null,
+ "attempt_count": 0,
+ "attempted": true,
+ "auto_advance": false,
+ "automatic_tax": {
+ "enabled": false,
+ "liability": null,
+ "status": null
+ },
+ "billing_reason": "manual",
+ "charge": null,
+ "collection_method": "charge_automatically",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_fields": null,
+ "customer": "cus_NORMALIZED0001",
+ "customer_address": null,
+ "customer_email": "[email protected]",
+ "customer_name": null,
+ "customer_phone": null,
+ "customer_shipping": null,
+ "customer_tax_exempt": "none",
+ "customer_tax_ids": [],
+ "default_payment_method": null,
+ "default_source": null,
+ "default_tax_rates": [],
+ "description": null,
+ "discount": null,
+ "discounts": [],
+ "due_date": null,
+ "effective_at": 1000000000,
+ "ending_balance": 0,
+ "footer": null,
+ "from_invoice": null,
+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QUk43VTM2cHowYmVoaGRna2JiMDNnR2tuMHYwa21PLDk2NzM1NDcw0200jdTteL9R?s=ap",
+ "id": "in_NORMALIZED00000000000001",
+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QUk43VTM2cHowYmVoaGRna2JiMDNnR2tuMHYwa21PLDk2NzM1NDcw0200jdTteL9R/pdf?s=ap",
+ "issuer": {
+ "type": "self"
+ },
+ "last_finalization_error": null,
+ "latest_revision": null,
+ "lines": {
+ "data": [
+ {
+ "amount": -24000,
+ "amount_excluding_tax": -24000,
+ "currency": "usd",
+ "description": "$20.00/month new customer discount",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_NORMALIZED00000000000001",
+ "invoice_item": "ii_NORMALIZED00000000000001",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1000000000,
+ "start": 1000000000
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_NORMALIZED00000000000001",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_NORMALIZED0001",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": -24000,
+ "unit_amount_decimal": "-24000"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "-24000"
+ },
+ {
+ "amount": 75600,
+ "amount_excluding_tax": 75600,
+ "currency": "usd",
+ "description": "Zulip Basic",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_NORMALIZED00000000000002",
+ "invoice_item": "ii_NORMALIZED00000000000002",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1357095845,
+ "start": 1325473445
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_NORMALIZED00000000000002",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_NORMALIZED0002",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": 4200,
+ "unit_amount_decimal": "4200"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 18,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "4200"
+ },
+ {
+ "amount": -51600,
+ "amount_excluding_tax": -51600,
+ "currency": "usd",
+ "description": "Payment (Card ending in 4242)",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_NORMALIZED00000000000003",
+ "invoice_item": "ii_NORMALIZED00000000000003",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1000000000,
+ "start": 1000000000
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_NORMALIZED00000000000003",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_NORMALIZED0003",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": -51600,
+ "unit_amount_decimal": "-51600"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "-51600"
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "total_count": 3,
+ "url": "/v1/invoices/in_NORMALIZED00000000000001/lines"
+ },
+ "livemode": false,
+ "metadata": {},
+ "next_payment_attempt": null,
+ "number": "NORMALI-0002",
+ "object": "invoice",
+ "on_behalf_of": null,
+ "paid": true,
+ "paid_out_of_band": false,
+ "payment_intent": null,
+ "payment_settings": {
+ "default_mandate": null,
+ "payment_method_options": null,
+ "payment_method_types": null
+ },
+ "period_end": 1000000000,
+ "period_start": 1000000000,
+ "post_payment_credit_notes_amount": 0,
+ "pre_payment_credit_notes_amount": 0,
+ "quote": null,
+ "receipt_number": null,
+ "rendering": {
+ "amount_tax_display": null,
+ "pdf": {
+ "page_size": "letter"
+ }
+ },
+ "rendering_options": null,
+ "shipping_cost": null,
+ "shipping_details": null,
+ "starting_balance": 0,
+ "statement_descriptor": "Zulip Basic",
+ "status": "paid",
+ "status_transitions": {
+ "finalized_at": 1000000000,
+ "marked_uncollectible_at": null,
+ "paid_at": 1000000000,
+ "voided_at": null
+ },
+ "subscription": null,
+ "subscription_details": {
+ "metadata": null
+ },
+ "subtotal": 0,
+ "subtotal_excluding_tax": 0,
+ "tax": null,
+ "test_clock": null,
+ "total": 0,
+ "total_discount_amounts": [],
+ "total_excluding_tax": 0,
+ "total_tax_amounts": [],
+ "transfer_data": null,
+ "webhooks_delivered_at": 1000000000
+}
diff --git a/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--Invoice.finalize_invoice.2.json b/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--Invoice.finalize_invoice.2.json
new file mode 100644
index 00000000000..34a47c3af6a
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--Invoice.finalize_invoice.2.json
@@ -0,0 +1,162 @@
+{
+ "account_country": "US",
+ "account_name": "Kandra Labs, Inc.",
+ "account_tax_ids": null,
+ "amount_due": 120000,
+ "amount_paid": 0,
+ "amount_remaining": 120000,
+ "amount_shipping": 0,
+ "application": null,
+ "application_fee_amount": null,
+ "attempt_count": 0,
+ "attempted": false,
+ "auto_advance": true,
+ "automatic_tax": {
+ "enabled": false,
+ "liability": null,
+ "status": null
+ },
+ "billing_reason": "manual",
+ "charge": null,
+ "collection_method": "charge_automatically",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_fields": null,
+ "customer": "cus_NORMALIZED0001",
+ "customer_address": null,
+ "customer_email": "[email protected]",
+ "customer_name": null,
+ "customer_phone": null,
+ "customer_shipping": null,
+ "customer_tax_exempt": "none",
+ "customer_tax_ids": [],
+ "default_payment_method": null,
+ "default_source": null,
+ "default_tax_rates": [],
+ "description": null,
+ "discount": null,
+ "discounts": [],
+ "due_date": null,
+ "effective_at": 1000000000,
+ "ending_balance": 0,
+ "footer": null,
+ "from_invoice": null,
+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QUk43VGFMUVF5Smg1d043dEllVWtPQXJXVUtpRTVULDk2NzM1NDc002008yCItbkM?s=ap",
+ "id": "in_NORMALIZED00000000000002",
+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QUk43VGFMUVF5Smg1d043dEllVWtPQXJXVUtpRTVULDk2NzM1NDc002008yCItbkM/pdf?s=ap",
+ "issuer": {
+ "type": "self"
+ },
+ "last_finalization_error": null,
+ "latest_revision": null,
+ "lines": {
+ "data": [
+ {
+ "amount": 120000,
+ "amount_excluding_tax": 120000,
+ "currency": "usd",
+ "description": "Zulip Business - renewal",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_NORMALIZED00000000000004",
+ "invoice_item": "ii_NORMALIZED00000000000004",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1362193445,
+ "start": 1330657445
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_NORMALIZED00000000000004",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_NORMALIZED0004",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": 120000,
+ "unit_amount_decimal": "120000"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "120000"
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "total_count": 1,
+ "url": "/v1/invoices/in_NORMALIZED00000000000002/lines"
+ },
+ "livemode": false,
+ "metadata": {},
+ "next_payment_attempt": 1000000000,
+ "number": "NORMALI-0003",
+ "object": "invoice",
+ "on_behalf_of": null,
+ "paid": false,
+ "paid_out_of_band": false,
+ "payment_intent": "pi_NORMALIZED00000000000002",
+ "payment_settings": {
+ "default_mandate": null,
+ "payment_method_options": null,
+ "payment_method_types": null
+ },
+ "period_end": 1000000000,
+ "period_start": 1000000000,
+ "post_payment_credit_notes_amount": 0,
+ "pre_payment_credit_notes_amount": 0,
+ "quote": null,
+ "receipt_number": null,
+ "rendering": {
+ "amount_tax_display": null,
+ "pdf": {
+ "page_size": "letter"
+ }
+ },
+ "rendering_options": null,
+ "shipping_cost": null,
+ "shipping_details": null,
+ "starting_balance": 0,
+ "statement_descriptor": "Zulip Business",
+ "status": "open",
+ "status_transitions": {
+ "finalized_at": 1000000000,
+ "marked_uncollectible_at": null,
+ "paid_at": null,
+ "voided_at": null
+ },
+ "subscription": null,
+ "subscription_details": {
+ "metadata": null
+ },
+ "subtotal": 120000,
+ "subtotal_excluding_tax": 120000,
+ "tax": null,
+ "test_clock": null,
+ "total": 120000,
+ "total_discount_amounts": [],
+ "total_excluding_tax": 120000,
+ "total_tax_amounts": [],
+ "transfer_data": null,
+ "webhooks_delivered_at": 1000000000
+}
diff --git a/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--Invoice.list.1.json b/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--Invoice.list.1.json
new file mode 100644
index 00000000000..e39960ab725
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--Invoice.list.1.json
@@ -0,0 +1,6 @@
+{
+ "data": [],
+ "has_more": false,
+ "object": "list",
+ "url": "/v1/invoices"
+}
diff --git a/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--InvoiceItem.create.1.json b/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--InvoiceItem.create.1.json
new file mode 100644
index 00000000000..a881a900d08
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--InvoiceItem.create.1.json
@@ -0,0 +1,47 @@
+{
+ "amount": -51600,
+ "currency": "usd",
+ "customer": "cus_NORMALIZED0001",
+ "date": 1000000000,
+ "description": "Payment (Card ending in 4242)",
+ "discountable": false,
+ "discounts": [],
+ "id": "ii_NORMALIZED00000000000003",
+ "invoice": null,
+ "livemode": false,
+ "metadata": {},
+ "object": "invoiceitem",
+ "period": {
+ "end": 1000000000,
+ "start": 1000000000
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_NORMALIZED00000000000003",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_NORMALIZED0003",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": -51600,
+ "unit_amount_decimal": "-51600"
+ },
+ "proration": false,
+ "quantity": 1,
+ "subscription": null,
+ "tax_rates": [],
+ "test_clock": null,
+ "unit_amount": -51600,
+ "unit_amount_decimal": "-51600"
+}
diff --git a/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--InvoiceItem.create.2.json b/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--InvoiceItem.create.2.json
new file mode 100644
index 00000000000..2f3abc4af2d
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--InvoiceItem.create.2.json
@@ -0,0 +1,47 @@
+{
+ "amount": 75600,
+ "currency": "usd",
+ "customer": "cus_NORMALIZED0001",
+ "date": 1000000000,
+ "description": "Zulip Basic",
+ "discountable": false,
+ "discounts": [],
+ "id": "ii_NORMALIZED00000000000002",
+ "invoice": null,
+ "livemode": false,
+ "metadata": {},
+ "object": "invoiceitem",
+ "period": {
+ "end": 1357095845,
+ "start": 1325473445
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_NORMALIZED00000000000002",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_NORMALIZED0002",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": 4200,
+ "unit_amount_decimal": "4200"
+ },
+ "proration": false,
+ "quantity": 18,
+ "subscription": null,
+ "tax_rates": [],
+ "test_clock": null,
+ "unit_amount": 4200,
+ "unit_amount_decimal": "4200"
+}
diff --git a/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--InvoiceItem.create.3.json b/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--InvoiceItem.create.3.json
new file mode 100644
index 00000000000..df3e1a69858
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--InvoiceItem.create.3.json
@@ -0,0 +1,47 @@
+{
+ "amount": -24000,
+ "currency": "usd",
+ "customer": "cus_NORMALIZED0001",
+ "date": 1000000000,
+ "description": "$20.00/month new customer discount",
+ "discountable": false,
+ "discounts": [],
+ "id": "ii_NORMALIZED00000000000001",
+ "invoice": null,
+ "livemode": false,
+ "metadata": {},
+ "object": "invoiceitem",
+ "period": {
+ "end": 1000000000,
+ "start": 1000000000
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_NORMALIZED00000000000001",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_NORMALIZED0001",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": -24000,
+ "unit_amount_decimal": "-24000"
+ },
+ "proration": false,
+ "quantity": 1,
+ "subscription": null,
+ "tax_rates": [],
+ "test_clock": null,
+ "unit_amount": -24000,
+ "unit_amount_decimal": "-24000"
+}
diff --git a/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--InvoiceItem.create.4.json b/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--InvoiceItem.create.4.json
new file mode 100644
index 00000000000..31853fdbac1
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--InvoiceItem.create.4.json
@@ -0,0 +1,47 @@
+{
+ "amount": 120000,
+ "currency": "usd",
+ "customer": "cus_NORMALIZED0001",
+ "date": 1000000000,
+ "description": "Zulip Business - renewal",
+ "discountable": false,
+ "discounts": [],
+ "id": "ii_NORMALIZED00000000000004",
+ "invoice": null,
+ "livemode": false,
+ "metadata": {},
+ "object": "invoiceitem",
+ "period": {
+ "end": 1362193445,
+ "start": 1330657445
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_NORMALIZED00000000000004",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_NORMALIZED0004",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": 120000,
+ "unit_amount_decimal": "120000"
+ },
+ "proration": false,
+ "quantity": 1,
+ "subscription": null,
+ "tax_rates": [],
+ "test_clock": null,
+ "unit_amount": 120000,
+ "unit_amount_decimal": "120000"
+}
diff --git a/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--PaymentIntent.create.1.json b/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--PaymentIntent.create.1.json
new file mode 100644
index 00000000000..2e71955a27b
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--PaymentIntent.create.1.json
@@ -0,0 +1,198 @@
+{
+ "amount": 51600,
+ "amount_capturable": 0,
+ "amount_details": {
+ "tip": {}
+ },
+ "amount_received": 51600,
+ "application": null,
+ "application_fee_amount": null,
+ "automatic_payment_methods": null,
+ "canceled_at": null,
+ "cancellation_reason": null,
+ "capture_method": "automatic",
+ "charges": {
+ "data": [
+ {
+ "amount": 51600,
+ "amount_captured": 51600,
+ "amount_refunded": 0,
+ "application": null,
+ "application_fee": null,
+ "application_fee_amount": null,
+ "balance_transaction": "txn_NORMALIZED00000000000001",
+ "billing_details": {
+ "address": {
+ "city": null,
+ "country": null,
+ "line1": null,
+ "line2": null,
+ "postal_code": null,
+ "state": null
+ },
+ "email": null,
+ "name": null,
+ "phone": null
+ },
+ "calculated_statement_descriptor": "ZULIP BASIC",
+ "captured": true,
+ "created": 1000000000,
+ "currency": "usd",
+ "customer": "cus_NORMALIZED0001",
+ "description": "Upgrade to Zulip Basic, $42.0 x 18 - $20.0 x 12",
+ "destination": null,
+ "dispute": null,
+ "disputed": false,
+ "failure_balance_transaction": null,
+ "failure_code": null,
+ "failure_message": null,
+ "fraud_details": {},
+ "id": "ch_NORMALIZED00000000000001",
+ "invoice": null,
+ "livemode": false,
+ "metadata": {
+ "billing_modality": "charge_automatically",
+ "billing_schedule": "1",
+ "license_management": "automatic",
+ "licenses": "18",
+ "plan_tier": "103",
+ "price_per_license": "4200",
+ "remote_server_host": "demo.example.com",
+ "remote_server_user_email": "[email protected]",
+ "remote_server_user_id": "1",
+ "seat_count": "18",
+ "type": "upgrade"
+ },
+ "object": "charge",
+ "on_behalf_of": null,
+ "order": null,
+ "outcome": {
+ "network_status": "approved_by_network",
+ "reason": null,
+ "risk_level": "normal",
+ "risk_score": 0,
+ "seller_message": "Payment complete.",
+ "type": "authorized"
+ },
+ "paid": true,
+ "payment_intent": "pi_NORMALIZED00000000000001",
+ "payment_method": "pm_1OcUN6DEQaroqDjsqTe76J6Y",
+ "payment_method_details": {
+ "card": {
+ "amount_authorized": 51600,
+ "brand": "visa",
+ "checks": {
+ "address_line1_check": null,
+ "address_postal_code_check": null,
+ "cvc_check": "pass"
+ },
+ "country": "US",
+ "exp_month": 1,
+ "exp_year": 2025,
+ "extended_authorization": {
+ "status": "disabled"
+ },
+ "fingerprint": "NORMALIZED000001",
+ "funding": "credit",
+ "incremental_authorization": {
+ "status": "unavailable"
+ },
+ "installments": null,
+ "last4": "4242",
+ "mandate": null,
+ "multicapture": {
+ "status": "unavailable"
+ },
+ "network": "visa",
+ "network_token": {
+ "used": false
+ },
+ "overcapture": {
+ "maximum_amount_capturable": 51600,
+ "status": "unavailable"
+ },
+ "three_d_secure": null,
+ "wallet": null
+ },
+ "type": "card"
+ },
+ "radar_options": {},
+ "receipt_email": "[email protected]",
+ "receipt_number": null,
+ "receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xN3ZUa3dERVFhcm9xRGpzKOrtya0GMgaMp8tnMUs6LBbeVUhqzRF7hqrxhW2JYQ4wZIxEiwKK1rb_CCbPG7rrm4KdhTzQfZb2jA5B",
+ "refunded": false,
+ "refunds": {
+ "data": [],
+ "has_more": false,
+ "object": "list",
+ "total_count": 0,
+ "url": "/v1/charges/ch_NORMALIZED00000000000001/refunds"
+ },
+ "review": null,
+ "shipping": null,
+ "source": null,
+ "source_transfer": null,
+ "statement_descriptor": "Zulip Basic",
+ "statement_descriptor_suffix": null,
+ "status": "succeeded",
+ "transfer_data": null,
+ "transfer_group": null
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "total_count": 1,
+ "url": "/v1/charges?payment_intent=pi_NORMALIZED00000000000001"
+ },
+ "client_secret": "pi_NORMALIZED00000000000001_secret_IJ3QSB7UsjmDnYn4ic3Kiz21j",
+ "confirmation_method": "automatic",
+ "created": 1000000000,
+ "currency": "usd",
+ "customer": "cus_NORMALIZED0001",
+ "description": "Upgrade to Zulip Basic, $42.0 x 18 - $20.0 x 12",
+ "id": "pi_NORMALIZED00000000000001",
+ "invoice": null,
+ "last_payment_error": null,
+ "latest_charge": "ch_NORMALIZED00000000000001",
+ "livemode": false,
+ "metadata": {
+ "billing_modality": "charge_automatically",
+ "billing_schedule": "1",
+ "license_management": "automatic",
+ "licenses": "18",
+ "plan_tier": "103",
+ "price_per_license": "4200",
+ "remote_server_host": "demo.example.com",
+ "remote_server_user_email": "[email protected]",
+ "remote_server_user_id": "1",
+ "seat_count": "18",
+ "type": "upgrade"
+ },
+ "next_action": null,
+ "object": "payment_intent",
+ "on_behalf_of": null,
+ "payment_method": "pm_1OcUN6DEQaroqDjsqTe76J6Y",
+ "payment_method_configuration_details": null,
+ "payment_method_options": {
+ "card": {
+ "installments": null,
+ "mandate_options": null,
+ "network": null,
+ "request_three_d_secure": "automatic"
+ }
+ },
+ "payment_method_types": [
+ "card"
+ ],
+ "processing": null,
+ "receipt_email": "[email protected]",
+ "review": null,
+ "setup_future_usage": null,
+ "shipping": null,
+ "source": null,
+ "statement_descriptor": "Zulip Basic",
+ "statement_descriptor_suffix": null,
+ "status": "succeeded",
+ "transfer_data": null,
+ "transfer_group": null
+}
diff --git a/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--SetupIntent.create.1.json b/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--SetupIntent.create.1.json
new file mode 100644
index 00000000000..d8c5644b9f9
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--SetupIntent.create.1.json
@@ -0,0 +1,34 @@
+{
+ "application": null,
+ "automatic_payment_methods": null,
+ "cancellation_reason": null,
+ "client_secret": "seti_1OcUN6DEQaroqDjsm8mXlQeC_secret_PRN7XGJhBDRfK0bgVKFUuD2wZS6QjN0",
+ "created": 1000000000,
+ "customer": "cus_NORMALIZED0001",
+ "description": null,
+ "flow_directions": null,
+ "id": "seti_1OcUN6DEQaroqDjsm8mXlQeC",
+ "last_setup_error": null,
+ "latest_attempt": "setatt_1OcUN6DEQaroqDjsx33hDEyd",
+ "livemode": false,
+ "mandate": null,
+ "metadata": {},
+ "next_action": null,
+ "object": "setup_intent",
+ "on_behalf_of": null,
+ "payment_method": "pm_1OcUN6DEQaroqDjsqTe76J6Y",
+ "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/schedule_server_upgrade_to_fixed_price_business_plan--SetupIntent.list.1.json b/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--SetupIntent.list.1.json
new file mode 100644
index 00000000000..117fe79977e
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--SetupIntent.list.1.json
@@ -0,0 +1,41 @@
+{
+ "data": [
+ {
+ "application": null,
+ "automatic_payment_methods": null,
+ "cancellation_reason": null,
+ "client_secret": "seti_1OcUN5DEQaroqDjsCWXeV0IG_secret_PRN7fCs1wUIAcI3GtkhYpYRhNQrzC9I",
+ "created": 1000000000,
+ "customer": "cus_NORMALIZED0001",
+ "description": null,
+ "flow_directions": null,
+ "id": "seti_1OcUN5DEQaroqDjsCWXeV0IG",
+ "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/schedule_server_upgrade_to_fixed_price_business_plan--SetupIntent.retrieve.1.json b/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--SetupIntent.retrieve.1.json
new file mode 100644
index 00000000000..d8c5644b9f9
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--SetupIntent.retrieve.1.json
@@ -0,0 +1,34 @@
+{
+ "application": null,
+ "automatic_payment_methods": null,
+ "cancellation_reason": null,
+ "client_secret": "seti_1OcUN6DEQaroqDjsm8mXlQeC_secret_PRN7XGJhBDRfK0bgVKFUuD2wZS6QjN0",
+ "created": 1000000000,
+ "customer": "cus_NORMALIZED0001",
+ "description": null,
+ "flow_directions": null,
+ "id": "seti_1OcUN6DEQaroqDjsm8mXlQeC",
+ "last_setup_error": null,
+ "latest_attempt": "setatt_1OcUN6DEQaroqDjsx33hDEyd",
+ "livemode": false,
+ "mandate": null,
+ "metadata": {},
+ "next_action": null,
+ "object": "setup_intent",
+ "on_behalf_of": null,
+ "payment_method": "pm_1OcUN6DEQaroqDjsqTe76J6Y",
+ "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/schedule_server_upgrade_to_fixed_price_business_plan--checkout.Session.create.1.json b/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--checkout.Session.create.1.json
new file mode 100644
index 00000000000..785e302ca95
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--checkout.Session.create.1.json
@@ -0,0 +1,75 @@
+{
+ "after_expiration": null,
+ "allow_promotion_codes": null,
+ "amount_subtotal": null,
+ "amount_total": null,
+ "automatic_tax": {
+ "enabled": false,
+ "liability": null,
+ "status": null
+ },
+ "billing_address_collection": null,
+ "cancel_url": "http://selfhosting.testserver/server/6cde5f7a-1f7e-4978-9716-49f69ebfc9fe/upgrade/?manual_license_management=false&tier=1",
+ "client_reference_id": null,
+ "client_secret": null,
+ "consent": null,
+ "consent_collection": null,
+ "created": 1000000000,
+ "currency": null,
+ "currency_conversion": null,
+ "custom_fields": [],
+ "custom_text": {
+ "after_submit": null,
+ "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_NORMALIZED02NJoVtsIZ1R5DH7As9nCQ8PVcJYPW8UP4Hijnt5EyJcwofF",
+ "invoice": null,
+ "invoice_creation": null,
+ "livemode": false,
+ "locale": null,
+ "metadata": {
+ "remote_server_user_id": "1",
+ "type": "card_update"
+ },
+ "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_1OcUN5DEQaroqDjsCWXeV0IG",
+ "shipping": null,
+ "shipping_address_collection": null,
+ "shipping_options": [],
+ "shipping_rate": null,
+ "status": "open",
+ "submit_type": null,
+ "subscription": null,
+ "success_url": "http://selfhosting.testserver/server/6cde5f7a-1f7e-4978-9716-49f69ebfc9fe/billing/event_status/?stripe_session_id={CHECKOUT_SESSION_ID}",
+ "total_details": null,
+ "ui_mode": "hosted",
+ "url": "https://checkout.stripe.com/c/pay/cs_test_NORMALIZED02NJoVtsIZ1R5DH7As9nCQ8PVcJYPW8UP4Hijnt5EyJcwofF#fid1d2BpamRhQ2prcSc%2FJ1ZqcHdmYCVWZGt2JVV3aicpJ2R1bE5gfCc%2FJ3VuWnFgdnFaXVRmMU5zNkldQTY9SnNRY09XZml2UXNQJyknY3dqaFZgd3Ngdyc%2FcXdwYCknaWR8anBxUXx1YCc%2FJ3Zsa2JpYFpmamlwaGsnKSdga2RnaWBVaWRmYG1qaWFgd3YnP3F3cGB4JSUl"
+}
diff --git a/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--checkout.Session.list.1.json b/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--checkout.Session.list.1.json
new file mode 100644
index 00000000000..2e4cd60deda
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_server_upgrade_to_fixed_price_business_plan--checkout.Session.list.1.json
@@ -0,0 +1,82 @@
+{
+ "data": [
+ {
+ "after_expiration": null,
+ "allow_promotion_codes": null,
+ "amount_subtotal": null,
+ "amount_total": null,
+ "automatic_tax": {
+ "enabled": false,
+ "liability": null,
+ "status": null
+ },
+ "billing_address_collection": null,
+ "cancel_url": "http://selfhosting.testserver/server/6cde5f7a-1f7e-4978-9716-49f69ebfc9fe/upgrade/?manual_license_management=false&tier=1",
+ "client_reference_id": null,
+ "client_secret": null,
+ "consent": null,
+ "consent_collection": null,
+ "created": 1000000000,
+ "currency": null,
+ "currency_conversion": null,
+ "custom_fields": [],
+ "custom_text": {
+ "after_submit": null,
+ "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_NORMALIZED02NJoVtsIZ1R5DH7As9nCQ8PVcJYPW8UP4Hijnt5EyJcwofF",
+ "invoice": null,
+ "invoice_creation": null,
+ "livemode": false,
+ "locale": null,
+ "metadata": {
+ "remote_server_user_id": "1",
+ "type": "card_update"
+ },
+ "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_1OcUN5DEQaroqDjsCWXeV0IG",
+ "shipping": null,
+ "shipping_address_collection": null,
+ "shipping_options": [],
+ "shipping_rate": null,
+ "status": "open",
+ "submit_type": null,
+ "subscription": null,
+ "success_url": "http://selfhosting.testserver/server/6cde5f7a-1f7e-4978-9716-49f69ebfc9fe/billing/event_status/?stripe_session_id={CHECKOUT_SESSION_ID}",
+ "total_details": null,
+ "ui_mode": "hosted",
+ "url": "https://checkout.stripe.com/c/pay/cs_test_NORMALIZED02NJoVtsIZ1R5DH7As9nCQ8PVcJYPW8UP4Hijnt5EyJcwofF#fid1d2BpamRhQ2prcSc%2FJ1ZqcHdmYCVWZGt2JVV3aicpJ2R1bE5gfCc%2FJ3VuWnFgdnFaXVRmMU5zNkldQTY9SnNRY09XZml2UXNQJyknY3dqaFZgd3Ngdyc%2FcXdwYCknaWR8anBxUXx1YCc%2FJ3Zsa2JpYFpmamlwaGsnKSdga2RnaWBVaWRmYG1qaWFgd3YnP3F3cGB4JSUl"
+ }
+ ],
+ "has_more": true,
+ "object": "list",
+ "url": "/v1/checkout/sessions"
+}
diff --git a/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--Customer.create.1.json b/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--Customer.create.1.json
new file mode 100644
index 00000000000..20caf506303
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--Customer.create.1.json
@@ -0,0 +1,33 @@
+{
+ "address": null,
+ "balance": 0,
+ "created": 1706118987,
+ "currency": null,
+ "default_currency": null,
+ "default_source": null,
+ "delinquent": false,
+ "description": "zulip.testserver 9336fc3f-5b0",
+ "discount": null,
+ "email": "[email protected]",
+ "id": "cus_PR2muOX6W0EsbJ",
+ "invoice_prefix": "674DB534",
+ "invoice_settings": {
+ "custom_fields": null,
+ "default_payment_method": null,
+ "footer": null,
+ "rendering_options": null
+ },
+ "livemode": false,
+ "metadata": {
+ "remote_realm_host": "zulip.testserver",
+ "remote_realm_uuid": "9336fc3f-5b07-49e0-b0d6-5d48cc3e8d67"
+ },
+ "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/schedule_upgrade_to_fixed_price_annual_business_plan--Customer.modify.1.json b/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--Customer.modify.1.json
new file mode 100644
index 00000000000..7de126ac324
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--Customer.modify.1.json
@@ -0,0 +1,33 @@
+{
+ "address": null,
+ "balance": 0,
+ "created": 1706118987,
+ "currency": null,
+ "default_currency": null,
+ "default_source": null,
+ "delinquent": false,
+ "description": "zulip.testserver 9336fc3f-5b0",
+ "discount": null,
+ "email": "[email protected]",
+ "id": "cus_PR2muOX6W0EsbJ",
+ "invoice_prefix": "674DB534",
+ "invoice_settings": {
+ "custom_fields": null,
+ "default_payment_method": "pm_1OcAgaDEQaroqDjsnpLfvaAR",
+ "footer": null,
+ "rendering_options": null
+ },
+ "livemode": false,
+ "metadata": {
+ "remote_realm_host": "zulip.testserver",
+ "remote_realm_uuid": "9336fc3f-5b07-49e0-b0d6-5d48cc3e8d67"
+ },
+ "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/schedule_upgrade_to_fixed_price_annual_business_plan--Customer.retrieve.1.json b/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--Customer.retrieve.1.json
new file mode 100644
index 00000000000..c9f7c660832
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--Customer.retrieve.1.json
@@ -0,0 +1,79 @@
+{
+ "address": null,
+ "balance": 0,
+ "created": 1706118987,
+ "currency": null,
+ "default_currency": null,
+ "default_source": null,
+ "delinquent": false,
+ "description": "zulip.testserver 9336fc3f-5b0",
+ "discount": null,
+ "email": "[email protected]",
+ "id": "cus_PR2muOX6W0EsbJ",
+ "invoice_prefix": "674DB534",
+ "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": 1,
+ "exp_year": 2025,
+ "fingerprint": "9XKsMixKBi6kIIzd",
+ "funding": "credit",
+ "generated_from": null,
+ "last4": "4242",
+ "networks": {
+ "available": [
+ "visa"
+ ],
+ "preferred": null
+ },
+ "three_d_secure_usage": {
+ "supported": true
+ },
+ "wallet": null
+ },
+ "created": 1706118988,
+ "customer": "cus_PR2muOX6W0EsbJ",
+ "id": "pm_1OcAgaDEQaroqDjsnpLfvaAR",
+ "livemode": false,
+ "metadata": {},
+ "object": "payment_method",
+ "type": "card"
+ },
+ "footer": null,
+ "rendering_options": null
+ },
+ "livemode": false,
+ "metadata": {
+ "remote_realm_host": "zulip.testserver",
+ "remote_realm_uuid": "9336fc3f-5b07-49e0-b0d6-5d48cc3e8d67"
+ },
+ "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/schedule_upgrade_to_fixed_price_annual_business_plan--Customer.retrieve.2.json b/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--Customer.retrieve.2.json
new file mode 100644
index 00000000000..c9f7c660832
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--Customer.retrieve.2.json
@@ -0,0 +1,79 @@
+{
+ "address": null,
+ "balance": 0,
+ "created": 1706118987,
+ "currency": null,
+ "default_currency": null,
+ "default_source": null,
+ "delinquent": false,
+ "description": "zulip.testserver 9336fc3f-5b0",
+ "discount": null,
+ "email": "[email protected]",
+ "id": "cus_PR2muOX6W0EsbJ",
+ "invoice_prefix": "674DB534",
+ "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": 1,
+ "exp_year": 2025,
+ "fingerprint": "9XKsMixKBi6kIIzd",
+ "funding": "credit",
+ "generated_from": null,
+ "last4": "4242",
+ "networks": {
+ "available": [
+ "visa"
+ ],
+ "preferred": null
+ },
+ "three_d_secure_usage": {
+ "supported": true
+ },
+ "wallet": null
+ },
+ "created": 1706118988,
+ "customer": "cus_PR2muOX6W0EsbJ",
+ "id": "pm_1OcAgaDEQaroqDjsnpLfvaAR",
+ "livemode": false,
+ "metadata": {},
+ "object": "payment_method",
+ "type": "card"
+ },
+ "footer": null,
+ "rendering_options": null
+ },
+ "livemode": false,
+ "metadata": {
+ "remote_realm_host": "zulip.testserver",
+ "remote_realm_uuid": "9336fc3f-5b07-49e0-b0d6-5d48cc3e8d67"
+ },
+ "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/schedule_upgrade_to_fixed_price_annual_business_plan--Customer.retrieve.3.json b/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--Customer.retrieve.3.json
new file mode 100644
index 00000000000..c9f7c660832
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--Customer.retrieve.3.json
@@ -0,0 +1,79 @@
+{
+ "address": null,
+ "balance": 0,
+ "created": 1706118987,
+ "currency": null,
+ "default_currency": null,
+ "default_source": null,
+ "delinquent": false,
+ "description": "zulip.testserver 9336fc3f-5b0",
+ "discount": null,
+ "email": "[email protected]",
+ "id": "cus_PR2muOX6W0EsbJ",
+ "invoice_prefix": "674DB534",
+ "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": 1,
+ "exp_year": 2025,
+ "fingerprint": "9XKsMixKBi6kIIzd",
+ "funding": "credit",
+ "generated_from": null,
+ "last4": "4242",
+ "networks": {
+ "available": [
+ "visa"
+ ],
+ "preferred": null
+ },
+ "three_d_secure_usage": {
+ "supported": true
+ },
+ "wallet": null
+ },
+ "created": 1706118988,
+ "customer": "cus_PR2muOX6W0EsbJ",
+ "id": "pm_1OcAgaDEQaroqDjsnpLfvaAR",
+ "livemode": false,
+ "metadata": {},
+ "object": "payment_method",
+ "type": "card"
+ },
+ "footer": null,
+ "rendering_options": null
+ },
+ "livemode": false,
+ "metadata": {
+ "remote_realm_host": "zulip.testserver",
+ "remote_realm_uuid": "9336fc3f-5b07-49e0-b0d6-5d48cc3e8d67"
+ },
+ "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/schedule_upgrade_to_fixed_price_annual_business_plan--Customer.retrieve.4.json b/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--Customer.retrieve.4.json
new file mode 100644
index 00000000000..c9f7c660832
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--Customer.retrieve.4.json
@@ -0,0 +1,79 @@
+{
+ "address": null,
+ "balance": 0,
+ "created": 1706118987,
+ "currency": null,
+ "default_currency": null,
+ "default_source": null,
+ "delinquent": false,
+ "description": "zulip.testserver 9336fc3f-5b0",
+ "discount": null,
+ "email": "[email protected]",
+ "id": "cus_PR2muOX6W0EsbJ",
+ "invoice_prefix": "674DB534",
+ "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": 1,
+ "exp_year": 2025,
+ "fingerprint": "9XKsMixKBi6kIIzd",
+ "funding": "credit",
+ "generated_from": null,
+ "last4": "4242",
+ "networks": {
+ "available": [
+ "visa"
+ ],
+ "preferred": null
+ },
+ "three_d_secure_usage": {
+ "supported": true
+ },
+ "wallet": null
+ },
+ "created": 1706118988,
+ "customer": "cus_PR2muOX6W0EsbJ",
+ "id": "pm_1OcAgaDEQaroqDjsnpLfvaAR",
+ "livemode": false,
+ "metadata": {},
+ "object": "payment_method",
+ "type": "card"
+ },
+ "footer": null,
+ "rendering_options": null
+ },
+ "livemode": false,
+ "metadata": {
+ "remote_realm_host": "zulip.testserver",
+ "remote_realm_uuid": "9336fc3f-5b07-49e0-b0d6-5d48cc3e8d67"
+ },
+ "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/schedule_upgrade_to_fixed_price_annual_business_plan--Customer.retrieve.5.json b/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--Customer.retrieve.5.json
new file mode 100644
index 00000000000..5b2f185d496
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--Customer.retrieve.5.json
@@ -0,0 +1,79 @@
+{
+ "address": null,
+ "balance": 0,
+ "created": 1706118987,
+ "currency": "usd",
+ "default_currency": "usd",
+ "default_source": null,
+ "delinquent": false,
+ "description": "zulip.testserver 9336fc3f-5b0",
+ "discount": null,
+ "email": "[email protected]",
+ "id": "cus_PR2muOX6W0EsbJ",
+ "invoice_prefix": "674DB534",
+ "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": 1,
+ "exp_year": 2025,
+ "fingerprint": "9XKsMixKBi6kIIzd",
+ "funding": "credit",
+ "generated_from": null,
+ "last4": "4242",
+ "networks": {
+ "available": [
+ "visa"
+ ],
+ "preferred": null
+ },
+ "three_d_secure_usage": {
+ "supported": true
+ },
+ "wallet": null
+ },
+ "created": 1706118988,
+ "customer": "cus_PR2muOX6W0EsbJ",
+ "id": "pm_1OcAgaDEQaroqDjsnpLfvaAR",
+ "livemode": false,
+ "metadata": {},
+ "object": "payment_method",
+ "type": "card"
+ },
+ "footer": null,
+ "rendering_options": null
+ },
+ "livemode": false,
+ "metadata": {
+ "remote_realm_host": "zulip.testserver",
+ "remote_realm_uuid": "9336fc3f-5b07-49e0-b0d6-5d48cc3e8d67"
+ },
+ "name": null,
+ "next_invoice_sequence": 3,
+ "object": "customer",
+ "phone": null,
+ "preferred_locales": [],
+ "shipping": null,
+ "tax_exempt": "none",
+ "test_clock": null
+}
diff --git a/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--Event.list.1.json b/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--Event.list.1.json
new file mode 100644
index 00000000000..6f39edc965d
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--Event.list.1.json
@@ -0,0 +1,60 @@
+{
+ "data": [
+ {
+ "api_version": "2020-08-27",
+ "created": 1706118991,
+ "data": {
+ "object": {
+ "address": null,
+ "balance": 0,
+ "created": 1706118987,
+ "currency": null,
+ "default_currency": null,
+ "default_source": null,
+ "delinquent": false,
+ "description": "zulip.testserver 9336fc3f-5b0",
+ "discount": null,
+ "email": "[email protected]",
+ "id": "cus_PR2muOX6W0EsbJ",
+ "invoice_prefix": "674DB534",
+ "invoice_settings": {
+ "custom_fields": null,
+ "default_payment_method": "pm_1OcAgaDEQaroqDjsnpLfvaAR",
+ "footer": null,
+ "rendering_options": null
+ },
+ "livemode": false,
+ "metadata": {
+ "remote_realm_host": "zulip.testserver",
+ "remote_realm_uuid": "9336fc3f-5b07-49e0-b0d6-5d48cc3e8d67"
+ },
+ "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_1OcAgdDEQaroqDjslBf6kKhv",
+ "livemode": false,
+ "object": "event",
+ "pending_webhooks": 0,
+ "request": {
+ "id": "req_xdaMhwVX8EScj2",
+ "idempotency_key": "1d982f4c-4e5d-4079-aea7-18e465019832"
+ },
+ "type": "customer.updated"
+ }
+ ],
+ "has_more": true,
+ "object": "list",
+ "url": "/v1/events"
+}
diff --git a/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--Event.list.2.json b/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--Event.list.2.json
new file mode 100644
index 00000000000..4275a425b12
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--Event.list.2.json
@@ -0,0 +1,447 @@
+{
+ "data": [
+ {
+ "api_version": "2020-08-27",
+ "created": 1706118994,
+ "data": {
+ "object": {
+ "amount": 22200,
+ "amount_capturable": 0,
+ "amount_details": {
+ "tip": {}
+ },
+ "amount_received": 22200,
+ "application": null,
+ "application_fee_amount": null,
+ "automatic_payment_methods": null,
+ "canceled_at": null,
+ "cancellation_reason": null,
+ "capture_method": "automatic",
+ "charges": {
+ "data": [
+ {
+ "amount": 22200,
+ "amount_captured": 22200,
+ "amount_refunded": 0,
+ "application": null,
+ "application_fee": null,
+ "application_fee_amount": null,
+ "balance_transaction": "txn_3OcAggDEQaroqDjs1LOWyUMd",
+ "billing_details": {
+ "address": {
+ "city": null,
+ "country": null,
+ "line1": null,
+ "line2": null,
+ "postal_code": null,
+ "state": null
+ },
+ "email": null,
+ "name": null,
+ "phone": null
+ },
+ "calculated_statement_descriptor": "ZULIP BASIC",
+ "captured": true,
+ "created": 1706118994,
+ "currency": "usd",
+ "customer": "cus_PR2muOX6W0EsbJ",
+ "description": "Upgrade to Zulip Basic, $42.0 x 11 - $20.0 x 12",
+ "destination": null,
+ "dispute": null,
+ "disputed": false,
+ "failure_balance_transaction": null,
+ "failure_code": null,
+ "failure_message": null,
+ "fraud_details": {},
+ "id": "ch_3OcAggDEQaroqDjs1wCYJDW4",
+ "invoice": null,
+ "livemode": false,
+ "metadata": {
+ "billing_modality": "charge_automatically",
+ "billing_schedule": "1",
+ "license_management": "automatic",
+ "licenses": "11",
+ "plan_tier": "103",
+ "price_per_license": "4200",
+ "remote_realm_host": "zulip.testserver",
+ "remote_realm_user_email": "[email protected]",
+ "remote_realm_user_id": "1",
+ "seat_count": "11",
+ "type": "upgrade"
+ },
+ "object": "charge",
+ "on_behalf_of": null,
+ "order": null,
+ "outcome": {
+ "network_status": "approved_by_network",
+ "reason": null,
+ "risk_level": "normal",
+ "risk_score": 41,
+ "seller_message": "Payment complete.",
+ "type": "authorized"
+ },
+ "paid": true,
+ "payment_intent": "pi_3OcAggDEQaroqDjs1wPFoB8X",
+ "payment_method": "pm_1OcAgaDEQaroqDjsnpLfvaAR",
+ "payment_method_details": {
+ "card": {
+ "amount_authorized": 22200,
+ "brand": "visa",
+ "checks": {
+ "address_line1_check": null,
+ "address_postal_code_check": null,
+ "cvc_check": "pass"
+ },
+ "country": "US",
+ "exp_month": 1,
+ "exp_year": 2025,
+ "extended_authorization": {
+ "status": "disabled"
+ },
+ "fingerprint": "9XKsMixKBi6kIIzd",
+ "funding": "credit",
+ "incremental_authorization": {
+ "status": "unavailable"
+ },
+ "installments": null,
+ "last4": "4242",
+ "mandate": null,
+ "multicapture": {
+ "status": "unavailable"
+ },
+ "network": "visa",
+ "network_token": {
+ "used": false
+ },
+ "overcapture": {
+ "maximum_amount_capturable": 22200,
+ "status": "unavailable"
+ },
+ "three_d_secure": null,
+ "wallet": null
+ },
+ "type": "card"
+ },
+ "radar_options": {},
+ "receipt_email": "[email protected]",
+ "receipt_number": null,
+ "receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xN3ZUa3dERVFhcm9xRGpzKNOexa0GMgZU8lYaT1w6LBbP1rdjWBod7S4LD0XGZdSGU6YSf_ufOm3RMYEDqJ4Ige1v3_Ss4W_rcyL2",
+ "refunded": false,
+ "refunds": {
+ "data": [],
+ "has_more": false,
+ "object": "list",
+ "total_count": 0,
+ "url": "/v1/charges/ch_3OcAggDEQaroqDjs1wCYJDW4/refunds"
+ },
+ "review": null,
+ "shipping": null,
+ "source": null,
+ "source_transfer": null,
+ "statement_descriptor": "Zulip Basic",
+ "statement_descriptor_suffix": null,
+ "status": "succeeded",
+ "transfer_data": null,
+ "transfer_group": null
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "total_count": 1,
+ "url": "/v1/charges?payment_intent=pi_3OcAggDEQaroqDjs1wPFoB8X"
+ },
+ "client_secret": "pi_3OcAggDEQaroqDjs1wPFoB8X_secret_YT3YzqaVWlX0CSjx8mbG3te8B",
+ "confirmation_method": "automatic",
+ "created": 1706118994,
+ "currency": "usd",
+ "customer": "cus_PR2muOX6W0EsbJ",
+ "description": "Upgrade to Zulip Basic, $42.0 x 11 - $20.0 x 12",
+ "id": "pi_3OcAggDEQaroqDjs1wPFoB8X",
+ "invoice": null,
+ "last_payment_error": null,
+ "latest_charge": "ch_3OcAggDEQaroqDjs1wCYJDW4",
+ "livemode": false,
+ "metadata": {
+ "billing_modality": "charge_automatically",
+ "billing_schedule": "1",
+ "license_management": "automatic",
+ "licenses": "11",
+ "plan_tier": "103",
+ "price_per_license": "4200",
+ "remote_realm_host": "zulip.testserver",
+ "remote_realm_user_email": "[email protected]",
+ "remote_realm_user_id": "1",
+ "seat_count": "11",
+ "type": "upgrade"
+ },
+ "next_action": null,
+ "object": "payment_intent",
+ "on_behalf_of": null,
+ "payment_method": "pm_1OcAgaDEQaroqDjsnpLfvaAR",
+ "payment_method_configuration_details": null,
+ "payment_method_options": {
+ "card": {
+ "installments": null,
+ "mandate_options": null,
+ "network": null,
+ "request_three_d_secure": "automatic"
+ }
+ },
+ "payment_method_types": [
+ "card"
+ ],
+ "processing": null,
+ "receipt_email": "[email protected]",
+ "review": null,
+ "setup_future_usage": null,
+ "shipping": null,
+ "source": null,
+ "statement_descriptor": "Zulip Basic",
+ "statement_descriptor_suffix": null,
+ "status": "succeeded",
+ "transfer_data": null,
+ "transfer_group": null
+ }
+ },
+ "id": "evt_3OcAggDEQaroqDjs1Ihh5Qfk",
+ "livemode": false,
+ "object": "event",
+ "pending_webhooks": 2,
+ "request": {
+ "id": "req_cXgnOv0jHmoqg0",
+ "idempotency_key": "e5b22c55-0129-481d-a8f8-2457c0f35b4f"
+ },
+ "type": "payment_intent.succeeded"
+ },
+ {
+ "api_version": "2020-08-27",
+ "created": 1706118994,
+ "data": {
+ "object": {
+ "amount": 22200,
+ "amount_captured": 22200,
+ "amount_refunded": 0,
+ "application": null,
+ "application_fee": null,
+ "application_fee_amount": null,
+ "balance_transaction": "txn_3OcAggDEQaroqDjs1LOWyUMd",
+ "billing_details": {
+ "address": {
+ "city": null,
+ "country": null,
+ "line1": null,
+ "line2": null,
+ "postal_code": null,
+ "state": null
+ },
+ "email": null,
+ "name": null,
+ "phone": null
+ },
+ "calculated_statement_descriptor": "ZULIP BASIC",
+ "captured": true,
+ "created": 1706118994,
+ "currency": "usd",
+ "customer": "cus_PR2muOX6W0EsbJ",
+ "description": "Upgrade to Zulip Basic, $42.0 x 11 - $20.0 x 12",
+ "destination": null,
+ "dispute": null,
+ "disputed": false,
+ "failure_balance_transaction": null,
+ "failure_code": null,
+ "failure_message": null,
+ "fraud_details": {},
+ "id": "ch_3OcAggDEQaroqDjs1wCYJDW4",
+ "invoice": null,
+ "livemode": false,
+ "metadata": {
+ "billing_modality": "charge_automatically",
+ "billing_schedule": "1",
+ "license_management": "automatic",
+ "licenses": "11",
+ "plan_tier": "103",
+ "price_per_license": "4200",
+ "remote_realm_host": "zulip.testserver",
+ "remote_realm_user_email": "[email protected]",
+ "remote_realm_user_id": "1",
+ "seat_count": "11",
+ "type": "upgrade"
+ },
+ "object": "charge",
+ "on_behalf_of": null,
+ "order": null,
+ "outcome": {
+ "network_status": "approved_by_network",
+ "reason": null,
+ "risk_level": "normal",
+ "risk_score": 41,
+ "seller_message": "Payment complete.",
+ "type": "authorized"
+ },
+ "paid": true,
+ "payment_intent": "pi_3OcAggDEQaroqDjs1wPFoB8X",
+ "payment_method": "pm_1OcAgaDEQaroqDjsnpLfvaAR",
+ "payment_method_details": {
+ "card": {
+ "amount_authorized": 22200,
+ "brand": "visa",
+ "checks": {
+ "address_line1_check": null,
+ "address_postal_code_check": null,
+ "cvc_check": "pass"
+ },
+ "country": "US",
+ "exp_month": 1,
+ "exp_year": 2025,
+ "extended_authorization": {
+ "status": "disabled"
+ },
+ "fingerprint": "9XKsMixKBi6kIIzd",
+ "funding": "credit",
+ "incremental_authorization": {
+ "status": "unavailable"
+ },
+ "installments": null,
+ "last4": "4242",
+ "mandate": null,
+ "multicapture": {
+ "status": "unavailable"
+ },
+ "network": "visa",
+ "network_token": {
+ "used": false
+ },
+ "overcapture": {
+ "maximum_amount_capturable": 22200,
+ "status": "unavailable"
+ },
+ "three_d_secure": null,
+ "wallet": null
+ },
+ "type": "card"
+ },
+ "radar_options": {},
+ "receipt_email": "[email protected]",
+ "receipt_number": null,
+ "receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xN3ZUa3dERVFhcm9xRGpzKNOexa0GMgYVu5DyxyU6LBYDNagH0I_T66g-gOF8a0L4AJAy_y5t2_bzUR30FZCrLlCueuAMSkw7g2_T",
+ "refunded": false,
+ "refunds": {
+ "data": [],
+ "has_more": false,
+ "object": "list",
+ "total_count": 0,
+ "url": "/v1/charges/ch_3OcAggDEQaroqDjs1wCYJDW4/refunds"
+ },
+ "review": null,
+ "shipping": null,
+ "source": null,
+ "source_transfer": null,
+ "statement_descriptor": "Zulip Basic",
+ "statement_descriptor_suffix": null,
+ "status": "succeeded",
+ "transfer_data": null,
+ "transfer_group": null
+ }
+ },
+ "id": "evt_3OcAggDEQaroqDjs1g46gFTU",
+ "livemode": false,
+ "object": "event",
+ "pending_webhooks": 0,
+ "request": {
+ "id": "req_cXgnOv0jHmoqg0",
+ "idempotency_key": "e5b22c55-0129-481d-a8f8-2457c0f35b4f"
+ },
+ "type": "charge.succeeded"
+ },
+ {
+ "api_version": "2020-08-27",
+ "created": 1706118994,
+ "data": {
+ "object": {
+ "amount": 22200,
+ "amount_capturable": 0,
+ "amount_details": {
+ "tip": {}
+ },
+ "amount_received": 0,
+ "application": null,
+ "application_fee_amount": null,
+ "automatic_payment_methods": null,
+ "canceled_at": null,
+ "cancellation_reason": null,
+ "capture_method": "automatic",
+ "charges": {
+ "data": [],
+ "has_more": false,
+ "object": "list",
+ "total_count": 0,
+ "url": "/v1/charges?payment_intent=pi_3OcAggDEQaroqDjs1wPFoB8X"
+ },
+ "client_secret": "pi_3OcAggDEQaroqDjs1wPFoB8X_secret_YT3YzqaVWlX0CSjx8mbG3te8B",
+ "confirmation_method": "automatic",
+ "created": 1706118994,
+ "currency": "usd",
+ "customer": "cus_PR2muOX6W0EsbJ",
+ "description": "Upgrade to Zulip Basic, $42.0 x 11 - $20.0 x 12",
+ "id": "pi_3OcAggDEQaroqDjs1wPFoB8X",
+ "invoice": null,
+ "last_payment_error": null,
+ "latest_charge": null,
+ "livemode": false,
+ "metadata": {
+ "billing_modality": "charge_automatically",
+ "billing_schedule": "1",
+ "license_management": "automatic",
+ "licenses": "11",
+ "plan_tier": "103",
+ "price_per_license": "4200",
+ "remote_realm_host": "zulip.testserver",
+ "remote_realm_user_email": "[email protected]",
+ "remote_realm_user_id": "1",
+ "seat_count": "11",
+ "type": "upgrade"
+ },
+ "next_action": null,
+ "object": "payment_intent",
+ "on_behalf_of": null,
+ "payment_method": null,
+ "payment_method_configuration_details": null,
+ "payment_method_options": {
+ "card": {
+ "installments": null,
+ "mandate_options": null,
+ "network": null,
+ "request_three_d_secure": "automatic"
+ }
+ },
+ "payment_method_types": [
+ "card"
+ ],
+ "processing": null,
+ "receipt_email": "[email protected]",
+ "review": null,
+ "setup_future_usage": null,
+ "shipping": null,
+ "source": null,
+ "statement_descriptor": "Zulip Basic",
+ "statement_descriptor_suffix": null,
+ "status": "requires_payment_method",
+ "transfer_data": null,
+ "transfer_group": null
+ }
+ },
+ "id": "evt_3OcAggDEQaroqDjs1Rb9PTuq",
+ "livemode": false,
+ "object": "event",
+ "pending_webhooks": 2,
+ "request": {
+ "id": "req_cXgnOv0jHmoqg0",
+ "idempotency_key": "e5b22c55-0129-481d-a8f8-2457c0f35b4f"
+ },
+ "type": "payment_intent.created"
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "url": "/v1/events"
+}
diff --git a/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--Event.list.3.json b/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--Event.list.3.json
new file mode 100644
index 00000000000..7d0e7bc4eeb
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--Event.list.3.json
@@ -0,0 +1,820 @@
+{
+ "data": [
+ {
+ "api_version": "2020-08-27",
+ "created": 1706118998,
+ "data": {
+ "object": {
+ "account_country": "US",
+ "account_name": "Kandra Labs, Inc.",
+ "account_tax_ids": null,
+ "amount_due": 0,
+ "amount_paid": 0,
+ "amount_remaining": 0,
+ "amount_shipping": 0,
+ "application": null,
+ "application_fee_amount": null,
+ "attempt_count": 0,
+ "attempted": true,
+ "auto_advance": false,
+ "automatic_tax": {
+ "enabled": false,
+ "liability": null,
+ "status": null
+ },
+ "billing_reason": "manual",
+ "charge": null,
+ "collection_method": "charge_automatically",
+ "created": 1706118997,
+ "currency": "usd",
+ "custom_fields": null,
+ "customer": "cus_PR2muOX6W0EsbJ",
+ "customer_address": null,
+ "customer_email": "[email protected]",
+ "customer_name": null,
+ "customer_phone": null,
+ "customer_shipping": null,
+ "customer_tax_exempt": "none",
+ "customer_tax_ids": [],
+ "default_payment_method": null,
+ "default_source": null,
+ "default_tax_rates": [],
+ "description": null,
+ "discount": null,
+ "discounts": [],
+ "due_date": null,
+ "effective_at": 1706118997,
+ "ending_balance": 0,
+ "footer": null,
+ "from_invoice": null,
+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_17vTkwDEQaroqDjs/test_YWNjdF8xN3ZUa3dERVFhcm9xRGpzLF9QUjJtdTcwUVhCRVhjWHJ4MVBPdEExZGFJek9CcXl5LDk2NjU5Nzk40200zHKqpdBe?s=ap",
+ "id": "in_1OcAgjDEQaroqDjs3M3eXI0i",
+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_17vTkwDEQaroqDjs/test_YWNjdF8xN3ZUa3dERVFhcm9xRGpzLF9QUjJtdTcwUVhCRVhjWHJ4MVBPdEExZGFJek9CcXl5LDk2NjU5Nzk40200zHKqpdBe/pdf?s=ap",
+ "issuer": {
+ "type": "self"
+ },
+ "last_finalization_error": null,
+ "latest_revision": null,
+ "lines": {
+ "data": [
+ {
+ "amount": -24000,
+ "amount_excluding_tax": -24000,
+ "currency": "usd",
+ "description": "$20.00/month new customer discount",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_1OcAgiDEQaroqDjshFnuvRmq",
+ "invoice_item": "ii_1OcAgiDEQaroqDjsY91P1pCM",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1706118996,
+ "start": 1706118996
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1705038418,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_1OXda2DEQaroqDjsJIdzQXRS",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_PLhPbuhP0lDy6A",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": -24000,
+ "unit_amount_decimal": "-24000"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "-24000"
+ },
+ {
+ "amount": 46200,
+ "amount_excluding_tax": 46200,
+ "currency": "usd",
+ "description": "Zulip Basic",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_1OcAgjDEQaroqDjsHsEhqO0e",
+ "invoice_item": "ii_1OcAgiDEQaroqDjsKQgcbmlu",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1357095845,
+ "start": 1325473445
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1702998309,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_1OP4r3DEQaroqDjsEdwQ3p3N",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_PDUwJ9ZgTQzjad",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": 4200,
+ "unit_amount_decimal": "4200"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 11,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "4200"
+ },
+ {
+ "amount": -22200,
+ "amount_excluding_tax": -22200,
+ "currency": "usd",
+ "description": "Payment (Card ending in 4242)",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_1OcAgjDEQaroqDjs0sk0OWRN",
+ "invoice_item": "ii_1OcAghDEQaroqDjsjcMUJwKI",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1706118995,
+ "start": 1706118995
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1706118995,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_1OcAghDEQaroqDjsuFiXYUS6",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_OvY3hKgN66WIeP",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": -22200,
+ "unit_amount_decimal": "-22200"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "-22200"
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "total_count": 3,
+ "url": "/v1/invoices/in_1OcAgjDEQaroqDjs3M3eXI0i/lines"
+ },
+ "livemode": false,
+ "metadata": {},
+ "next_payment_attempt": null,
+ "number": "674DB534-0001",
+ "object": "invoice",
+ "on_behalf_of": null,
+ "paid": true,
+ "paid_out_of_band": false,
+ "payment_intent": null,
+ "payment_settings": {
+ "default_mandate": null,
+ "payment_method_options": null,
+ "payment_method_types": null
+ },
+ "period_end": 1706118997,
+ "period_start": 1706118997,
+ "post_payment_credit_notes_amount": 0,
+ "pre_payment_credit_notes_amount": 0,
+ "quote": null,
+ "receipt_number": null,
+ "rendering": {
+ "amount_tax_display": null,
+ "pdf": {
+ "page_size": "letter"
+ }
+ },
+ "rendering_options": null,
+ "shipping_cost": null,
+ "shipping_details": null,
+ "starting_balance": 0,
+ "statement_descriptor": "Zulip Basic",
+ "status": "paid",
+ "status_transitions": {
+ "finalized_at": 1706118997,
+ "marked_uncollectible_at": null,
+ "paid_at": 1706118997,
+ "voided_at": null
+ },
+ "subscription": null,
+ "subscription_details": {
+ "metadata": null
+ },
+ "subtotal": 0,
+ "subtotal_excluding_tax": 0,
+ "tax": null,
+ "test_clock": null,
+ "total": 0,
+ "total_discount_amounts": [],
+ "total_excluding_tax": 0,
+ "total_tax_amounts": [],
+ "transfer_data": null,
+ "webhooks_delivered_at": 1706118997
+ },
+ "previous_attributes": {
+ "attempted": false,
+ "auto_advance": true,
+ "effective_at": null,
+ "ending_balance": null,
+ "hosted_invoice_url": null,
+ "invoice_pdf": null,
+ "next_payment_attempt": 1706122597,
+ "number": null,
+ "paid": false,
+ "rendering": {
+ "pdf": {
+ "page_size": "auto"
+ }
+ },
+ "status": "draft",
+ "status_transitions": {
+ "finalized_at": null,
+ "paid_at": null
+ }
+ }
+ },
+ "id": "evt_1OcAgkDEQaroqDjsqupj7E4F",
+ "livemode": false,
+ "object": "event",
+ "pending_webhooks": 2,
+ "request": {
+ "id": "req_X7IGKC2znjSrgh",
+ "idempotency_key": "afcd6962-d347-4fa2-b729-6c99fbf4cbf3"
+ },
+ "type": "invoice.updated"
+ },
+ {
+ "api_version": "2020-08-27",
+ "created": 1706118997,
+ "data": {
+ "object": {
+ "account_country": "US",
+ "account_name": "Kandra Labs, Inc.",
+ "account_tax_ids": null,
+ "amount_due": 0,
+ "amount_paid": 0,
+ "amount_remaining": 0,
+ "amount_shipping": 0,
+ "application": null,
+ "application_fee_amount": null,
+ "attempt_count": 0,
+ "attempted": false,
+ "auto_advance": true,
+ "automatic_tax": {
+ "enabled": false,
+ "liability": null,
+ "status": null
+ },
+ "billing_reason": "manual",
+ "charge": null,
+ "collection_method": "charge_automatically",
+ "created": 1706118997,
+ "currency": "usd",
+ "custom_fields": null,
+ "customer": "cus_PR2muOX6W0EsbJ",
+ "customer_address": null,
+ "customer_email": "[email protected]",
+ "customer_name": null,
+ "customer_phone": null,
+ "customer_shipping": null,
+ "customer_tax_exempt": "none",
+ "customer_tax_ids": [],
+ "default_payment_method": null,
+ "default_source": null,
+ "default_tax_rates": [],
+ "description": null,
+ "discount": null,
+ "discounts": [],
+ "due_date": null,
+ "effective_at": null,
+ "ending_balance": null,
+ "footer": null,
+ "from_invoice": null,
+ "hosted_invoice_url": null,
+ "id": "in_1OcAgjDEQaroqDjs3M3eXI0i",
+ "invoice_pdf": null,
+ "issuer": {
+ "type": "self"
+ },
+ "last_finalization_error": null,
+ "latest_revision": null,
+ "lines": {
+ "data": [
+ {
+ "amount": -24000,
+ "amount_excluding_tax": -24000,
+ "currency": "usd",
+ "description": "$20.00/month new customer discount",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_1OcAgiDEQaroqDjshFnuvRmq",
+ "invoice_item": "ii_1OcAgiDEQaroqDjsY91P1pCM",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1706118996,
+ "start": 1706118996
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1705038418,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_1OXda2DEQaroqDjsJIdzQXRS",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_PLhPbuhP0lDy6A",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": -24000,
+ "unit_amount_decimal": "-24000"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "-24000"
+ },
+ {
+ "amount": 46200,
+ "amount_excluding_tax": 46200,
+ "currency": "usd",
+ "description": "Zulip Basic",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_1OcAgjDEQaroqDjsHsEhqO0e",
+ "invoice_item": "ii_1OcAgiDEQaroqDjsKQgcbmlu",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1357095845,
+ "start": 1325473445
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1702998309,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_1OP4r3DEQaroqDjsEdwQ3p3N",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_PDUwJ9ZgTQzjad",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": 4200,
+ "unit_amount_decimal": "4200"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 11,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "4200"
+ },
+ {
+ "amount": -22200,
+ "amount_excluding_tax": -22200,
+ "currency": "usd",
+ "description": "Payment (Card ending in 4242)",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_1OcAgjDEQaroqDjs0sk0OWRN",
+ "invoice_item": "ii_1OcAghDEQaroqDjsjcMUJwKI",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1706118995,
+ "start": 1706118995
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1706118995,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_1OcAghDEQaroqDjsuFiXYUS6",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_OvY3hKgN66WIeP",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": -22200,
+ "unit_amount_decimal": "-22200"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "-22200"
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "total_count": 3,
+ "url": "/v1/invoices/in_1OcAgjDEQaroqDjs3M3eXI0i/lines"
+ },
+ "livemode": false,
+ "metadata": {},
+ "next_payment_attempt": 1706122597,
+ "number": null,
+ "object": "invoice",
+ "on_behalf_of": null,
+ "paid": false,
+ "paid_out_of_band": false,
+ "payment_intent": null,
+ "payment_settings": {
+ "default_mandate": null,
+ "payment_method_options": null,
+ "payment_method_types": null
+ },
+ "period_end": 1706118997,
+ "period_start": 1706118997,
+ "post_payment_credit_notes_amount": 0,
+ "pre_payment_credit_notes_amount": 0,
+ "quote": null,
+ "receipt_number": null,
+ "rendering": {
+ "amount_tax_display": null,
+ "pdf": {
+ "page_size": "auto"
+ }
+ },
+ "rendering_options": null,
+ "shipping_cost": null,
+ "shipping_details": null,
+ "starting_balance": 0,
+ "statement_descriptor": "Zulip Basic",
+ "status": "draft",
+ "status_transitions": {
+ "finalized_at": null,
+ "marked_uncollectible_at": null,
+ "paid_at": null,
+ "voided_at": null
+ },
+ "subscription": null,
+ "subscription_details": {
+ "metadata": null
+ },
+ "subtotal": 0,
+ "subtotal_excluding_tax": 0,
+ "tax": null,
+ "test_clock": null,
+ "total": 0,
+ "total_discount_amounts": [],
+ "total_excluding_tax": 0,
+ "total_tax_amounts": [],
+ "transfer_data": null,
+ "webhooks_delivered_at": null
+ }
+ },
+ "id": "evt_1OcAgjDEQaroqDjsgHoJrMmv",
+ "livemode": false,
+ "object": "event",
+ "pending_webhooks": 0,
+ "request": {
+ "id": "req_qNAwVrqmD5Apos",
+ "idempotency_key": "9e9431ba-ee0b-4cf6-b249-e72b66ace45a"
+ },
+ "type": "invoice.created"
+ },
+ {
+ "api_version": "2020-08-27",
+ "created": 1706118996,
+ "data": {
+ "object": {
+ "amount": -24000,
+ "currency": "usd",
+ "customer": "cus_PR2muOX6W0EsbJ",
+ "date": 1706118996,
+ "description": "$20.00/month new customer discount",
+ "discountable": false,
+ "discounts": [],
+ "id": "ii_1OcAgiDEQaroqDjsY91P1pCM",
+ "invoice": null,
+ "livemode": false,
+ "metadata": {},
+ "object": "invoiceitem",
+ "period": {
+ "end": 1706118996,
+ "start": 1706118996
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1705038418,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_1OXda2DEQaroqDjsJIdzQXRS",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_PLhPbuhP0lDy6A",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": -24000,
+ "unit_amount_decimal": "-24000"
+ },
+ "proration": false,
+ "quantity": 1,
+ "subscription": null,
+ "tax_rates": [],
+ "test_clock": null,
+ "unit_amount": -24000,
+ "unit_amount_decimal": "-24000"
+ }
+ },
+ "id": "evt_1OcAgiDEQaroqDjszEBAOJcO",
+ "livemode": false,
+ "object": "event",
+ "pending_webhooks": 0,
+ "request": {
+ "id": "req_BGtZ1deYgwI8XZ",
+ "idempotency_key": "859a0dda-397e-45bb-a2a7-77ee607ee864"
+ },
+ "type": "invoiceitem.created"
+ },
+ {
+ "api_version": "2020-08-27",
+ "created": 1706118996,
+ "data": {
+ "object": {
+ "amount": 46200,
+ "currency": "usd",
+ "customer": "cus_PR2muOX6W0EsbJ",
+ "date": 1706118996,
+ "description": "Zulip Basic",
+ "discountable": false,
+ "discounts": [],
+ "id": "ii_1OcAgiDEQaroqDjsKQgcbmlu",
+ "invoice": null,
+ "livemode": false,
+ "metadata": {},
+ "object": "invoiceitem",
+ "period": {
+ "end": 1357095845,
+ "start": 1325473445
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1702998309,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_1OP4r3DEQaroqDjsEdwQ3p3N",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_PDUwJ9ZgTQzjad",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": 4200,
+ "unit_amount_decimal": "4200"
+ },
+ "proration": false,
+ "quantity": 11,
+ "subscription": null,
+ "tax_rates": [],
+ "test_clock": null,
+ "unit_amount": 4200,
+ "unit_amount_decimal": "4200"
+ }
+ },
+ "id": "evt_1OcAgiDEQaroqDjsqHeJ9Cu1",
+ "livemode": false,
+ "object": "event",
+ "pending_webhooks": 0,
+ "request": {
+ "id": "req_iI5HkJbFconJtF",
+ "idempotency_key": "aec007ae-888d-4b3c-91f8-70c619401824"
+ },
+ "type": "invoiceitem.created"
+ },
+ {
+ "api_version": "2020-08-27",
+ "created": 1706118995,
+ "data": {
+ "object": {
+ "amount": -22200,
+ "currency": "usd",
+ "customer": "cus_PR2muOX6W0EsbJ",
+ "date": 1706118995,
+ "description": "Payment (Card ending in 4242)",
+ "discountable": false,
+ "discounts": [],
+ "id": "ii_1OcAghDEQaroqDjsjcMUJwKI",
+ "invoice": null,
+ "livemode": false,
+ "metadata": {},
+ "object": "invoiceitem",
+ "period": {
+ "end": 1706118995,
+ "start": 1706118995
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1706118995,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_1OcAghDEQaroqDjsuFiXYUS6",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_OvY3hKgN66WIeP",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": -22200,
+ "unit_amount_decimal": "-22200"
+ },
+ "proration": false,
+ "quantity": 1,
+ "subscription": null,
+ "tax_rates": [],
+ "test_clock": null,
+ "unit_amount": -22200,
+ "unit_amount_decimal": "-22200"
+ }
+ },
+ "id": "evt_1OcAgiDEQaroqDjsaKERYQ7n",
+ "livemode": false,
+ "object": "event",
+ "pending_webhooks": 0,
+ "request": {
+ "id": "req_SYocBEs01H7wIC",
+ "idempotency_key": "c13de199-95c5-4bc3-8850-ae8fd2b05c4e"
+ },
+ "type": "invoiceitem.created"
+ },
+ {
+ "api_version": "2020-08-27",
+ "created": 1706118995,
+ "data": {
+ "object": {
+ "address": null,
+ "balance": 0,
+ "created": 1706118987,
+ "currency": "usd",
+ "default_currency": "usd",
+ "default_source": null,
+ "delinquent": false,
+ "description": "zulip.testserver 9336fc3f-5b0",
+ "discount": null,
+ "email": "[email protected]",
+ "id": "cus_PR2muOX6W0EsbJ",
+ "invoice_prefix": "674DB534",
+ "invoice_settings": {
+ "custom_fields": null,
+ "default_payment_method": "pm_1OcAgaDEQaroqDjsnpLfvaAR",
+ "footer": null,
+ "rendering_options": null
+ },
+ "livemode": false,
+ "metadata": {
+ "remote_realm_host": "zulip.testserver",
+ "remote_realm_uuid": "9336fc3f-5b07-49e0-b0d6-5d48cc3e8d67"
+ },
+ "name": null,
+ "next_invoice_sequence": 1,
+ "object": "customer",
+ "phone": null,
+ "preferred_locales": [],
+ "shipping": null,
+ "tax_exempt": "none",
+ "test_clock": null
+ },
+ "previous_attributes": {
+ "currency": null,
+ "default_currency": null
+ }
+ },
+ "id": "evt_1OcAgiDEQaroqDjsU3Pru4R6",
+ "livemode": false,
+ "object": "event",
+ "pending_webhooks": 0,
+ "request": {
+ "id": "req_SYocBEs01H7wIC",
+ "idempotency_key": "c13de199-95c5-4bc3-8850-ae8fd2b05c4e"
+ },
+ "type": "customer.updated"
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "url": "/v1/events"
+}
diff --git a/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--Event.list.4.json b/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--Event.list.4.json
new file mode 100644
index 00000000000..77103978f86
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--Event.list.4.json
@@ -0,0 +1,561 @@
+{
+ "data": [
+ {
+ "api_version": "2020-08-27",
+ "created": 1706118998,
+ "data": {
+ "object": {
+ "account_country": "US",
+ "account_name": "Kandra Labs, Inc.",
+ "account_tax_ids": null,
+ "amount_due": 0,
+ "amount_paid": 0,
+ "amount_remaining": 0,
+ "amount_shipping": 0,
+ "application": null,
+ "application_fee_amount": null,
+ "attempt_count": 0,
+ "attempted": true,
+ "auto_advance": false,
+ "automatic_tax": {
+ "enabled": false,
+ "liability": null,
+ "status": null
+ },
+ "billing_reason": "manual",
+ "charge": null,
+ "collection_method": "charge_automatically",
+ "created": 1706118997,
+ "currency": "usd",
+ "custom_fields": null,
+ "customer": "cus_PR2muOX6W0EsbJ",
+ "customer_address": null,
+ "customer_email": "[email protected]",
+ "customer_name": null,
+ "customer_phone": null,
+ "customer_shipping": null,
+ "customer_tax_exempt": "none",
+ "customer_tax_ids": [],
+ "default_payment_method": null,
+ "default_source": null,
+ "default_tax_rates": [],
+ "description": null,
+ "discount": null,
+ "discounts": [],
+ "due_date": null,
+ "effective_at": 1706118997,
+ "ending_balance": 0,
+ "footer": null,
+ "from_invoice": null,
+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_17vTkwDEQaroqDjs/test_YWNjdF8xN3ZUa3dERVFhcm9xRGpzLF9QUjJtdTcwUVhCRVhjWHJ4MVBPdEExZGFJek9CcXl5LDk2NjU5Nzk40200zHKqpdBe?s=ap",
+ "id": "in_1OcAgjDEQaroqDjs3M3eXI0i",
+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_17vTkwDEQaroqDjs/test_YWNjdF8xN3ZUa3dERVFhcm9xRGpzLF9QUjJtdTcwUVhCRVhjWHJ4MVBPdEExZGFJek9CcXl5LDk2NjU5Nzk40200zHKqpdBe/pdf?s=ap",
+ "issuer": {
+ "type": "self"
+ },
+ "last_finalization_error": null,
+ "latest_revision": null,
+ "lines": {
+ "data": [
+ {
+ "amount": -24000,
+ "amount_excluding_tax": -24000,
+ "currency": "usd",
+ "description": "$20.00/month new customer discount",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_1OcAgiDEQaroqDjshFnuvRmq",
+ "invoice_item": "ii_1OcAgiDEQaroqDjsY91P1pCM",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1706118996,
+ "start": 1706118996
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1705038418,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_1OXda2DEQaroqDjsJIdzQXRS",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_PLhPbuhP0lDy6A",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": -24000,
+ "unit_amount_decimal": "-24000"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "-24000"
+ },
+ {
+ "amount": 46200,
+ "amount_excluding_tax": 46200,
+ "currency": "usd",
+ "description": "Zulip Basic",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_1OcAgjDEQaroqDjsHsEhqO0e",
+ "invoice_item": "ii_1OcAgiDEQaroqDjsKQgcbmlu",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1357095845,
+ "start": 1325473445
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1702998309,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_1OP4r3DEQaroqDjsEdwQ3p3N",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_PDUwJ9ZgTQzjad",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": 4200,
+ "unit_amount_decimal": "4200"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 11,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "4200"
+ },
+ {
+ "amount": -22200,
+ "amount_excluding_tax": -22200,
+ "currency": "usd",
+ "description": "Payment (Card ending in 4242)",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_1OcAgjDEQaroqDjs0sk0OWRN",
+ "invoice_item": "ii_1OcAghDEQaroqDjsjcMUJwKI",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1706118995,
+ "start": 1706118995
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1706118995,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_1OcAghDEQaroqDjsuFiXYUS6",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_OvY3hKgN66WIeP",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": -22200,
+ "unit_amount_decimal": "-22200"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "-22200"
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "total_count": 3,
+ "url": "/v1/invoices/in_1OcAgjDEQaroqDjs3M3eXI0i/lines"
+ },
+ "livemode": false,
+ "metadata": {},
+ "next_payment_attempt": null,
+ "number": "674DB534-0001",
+ "object": "invoice",
+ "on_behalf_of": null,
+ "paid": true,
+ "paid_out_of_band": false,
+ "payment_intent": null,
+ "payment_settings": {
+ "default_mandate": null,
+ "payment_method_options": null,
+ "payment_method_types": null
+ },
+ "period_end": 1706118997,
+ "period_start": 1706118997,
+ "post_payment_credit_notes_amount": 0,
+ "pre_payment_credit_notes_amount": 0,
+ "quote": null,
+ "receipt_number": null,
+ "rendering": {
+ "amount_tax_display": null,
+ "pdf": {
+ "page_size": "letter"
+ }
+ },
+ "rendering_options": null,
+ "shipping_cost": null,
+ "shipping_details": null,
+ "starting_balance": 0,
+ "statement_descriptor": "Zulip Basic",
+ "status": "paid",
+ "status_transitions": {
+ "finalized_at": 1706118997,
+ "marked_uncollectible_at": null,
+ "paid_at": 1706118997,
+ "voided_at": null
+ },
+ "subscription": null,
+ "subscription_details": {
+ "metadata": null
+ },
+ "subtotal": 0,
+ "subtotal_excluding_tax": 0,
+ "tax": null,
+ "test_clock": null,
+ "total": 0,
+ "total_discount_amounts": [],
+ "total_excluding_tax": 0,
+ "total_tax_amounts": [],
+ "transfer_data": null,
+ "webhooks_delivered_at": 1706118997
+ }
+ },
+ "id": "evt_1OcAgkDEQaroqDjsz4pqgMd1",
+ "livemode": false,
+ "object": "event",
+ "pending_webhooks": 2,
+ "request": {
+ "id": "req_X7IGKC2znjSrgh",
+ "idempotency_key": "afcd6962-d347-4fa2-b729-6c99fbf4cbf3"
+ },
+ "type": "invoice.paid"
+ },
+ {
+ "api_version": "2020-08-27",
+ "created": 1706118998,
+ "data": {
+ "object": {
+ "account_country": "US",
+ "account_name": "Kandra Labs, Inc.",
+ "account_tax_ids": null,
+ "amount_due": 0,
+ "amount_paid": 0,
+ "amount_remaining": 0,
+ "amount_shipping": 0,
+ "application": null,
+ "application_fee_amount": null,
+ "attempt_count": 0,
+ "attempted": true,
+ "auto_advance": false,
+ "automatic_tax": {
+ "enabled": false,
+ "liability": null,
+ "status": null
+ },
+ "billing_reason": "manual",
+ "charge": null,
+ "collection_method": "charge_automatically",
+ "created": 1706118997,
+ "currency": "usd",
+ "custom_fields": null,
+ "customer": "cus_PR2muOX6W0EsbJ",
+ "customer_address": null,
+ "customer_email": "[email protected]",
+ "customer_name": null,
+ "customer_phone": null,
+ "customer_shipping": null,
+ "customer_tax_exempt": "none",
+ "customer_tax_ids": [],
+ "default_payment_method": null,
+ "default_source": null,
+ "default_tax_rates": [],
+ "description": null,
+ "discount": null,
+ "discounts": [],
+ "due_date": null,
+ "effective_at": 1706118997,
+ "ending_balance": 0,
+ "footer": null,
+ "from_invoice": null,
+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_17vTkwDEQaroqDjs/test_YWNjdF8xN3ZUa3dERVFhcm9xRGpzLF9QUjJtdTcwUVhCRVhjWHJ4MVBPdEExZGFJek9CcXl5LDk2NjU5Nzk40200zHKqpdBe?s=ap",
+ "id": "in_1OcAgjDEQaroqDjs3M3eXI0i",
+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_17vTkwDEQaroqDjs/test_YWNjdF8xN3ZUa3dERVFhcm9xRGpzLF9QUjJtdTcwUVhCRVhjWHJ4MVBPdEExZGFJek9CcXl5LDk2NjU5Nzk40200zHKqpdBe/pdf?s=ap",
+ "issuer": {
+ "type": "self"
+ },
+ "last_finalization_error": null,
+ "latest_revision": null,
+ "lines": {
+ "data": [
+ {
+ "amount": -24000,
+ "amount_excluding_tax": -24000,
+ "currency": "usd",
+ "description": "$20.00/month new customer discount",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_1OcAgiDEQaroqDjshFnuvRmq",
+ "invoice_item": "ii_1OcAgiDEQaroqDjsY91P1pCM",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1706118996,
+ "start": 1706118996
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1705038418,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_1OXda2DEQaroqDjsJIdzQXRS",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_PLhPbuhP0lDy6A",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": -24000,
+ "unit_amount_decimal": "-24000"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "-24000"
+ },
+ {
+ "amount": 46200,
+ "amount_excluding_tax": 46200,
+ "currency": "usd",
+ "description": "Zulip Basic",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_1OcAgjDEQaroqDjsHsEhqO0e",
+ "invoice_item": "ii_1OcAgiDEQaroqDjsKQgcbmlu",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1357095845,
+ "start": 1325473445
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1702998309,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_1OP4r3DEQaroqDjsEdwQ3p3N",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_PDUwJ9ZgTQzjad",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": 4200,
+ "unit_amount_decimal": "4200"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 11,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "4200"
+ },
+ {
+ "amount": -22200,
+ "amount_excluding_tax": -22200,
+ "currency": "usd",
+ "description": "Payment (Card ending in 4242)",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_1OcAgjDEQaroqDjs0sk0OWRN",
+ "invoice_item": "ii_1OcAghDEQaroqDjsjcMUJwKI",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1706118995,
+ "start": 1706118995
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1706118995,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_1OcAghDEQaroqDjsuFiXYUS6",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_OvY3hKgN66WIeP",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": -22200,
+ "unit_amount_decimal": "-22200"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "-22200"
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "total_count": 3,
+ "url": "/v1/invoices/in_1OcAgjDEQaroqDjs3M3eXI0i/lines"
+ },
+ "livemode": false,
+ "metadata": {},
+ "next_payment_attempt": null,
+ "number": "674DB534-0001",
+ "object": "invoice",
+ "on_behalf_of": null,
+ "paid": true,
+ "paid_out_of_band": false,
+ "payment_intent": null,
+ "payment_settings": {
+ "default_mandate": null,
+ "payment_method_options": null,
+ "payment_method_types": null
+ },
+ "period_end": 1706118997,
+ "period_start": 1706118997,
+ "post_payment_credit_notes_amount": 0,
+ "pre_payment_credit_notes_amount": 0,
+ "quote": null,
+ "receipt_number": null,
+ "rendering": {
+ "amount_tax_display": null,
+ "pdf": {
+ "page_size": "letter"
+ }
+ },
+ "rendering_options": null,
+ "shipping_cost": null,
+ "shipping_details": null,
+ "starting_balance": 0,
+ "statement_descriptor": "Zulip Basic",
+ "status": "paid",
+ "status_transitions": {
+ "finalized_at": 1706118997,
+ "marked_uncollectible_at": null,
+ "paid_at": 1706118997,
+ "voided_at": null
+ },
+ "subscription": null,
+ "subscription_details": {
+ "metadata": null
+ },
+ "subtotal": 0,
+ "subtotal_excluding_tax": 0,
+ "tax": null,
+ "test_clock": null,
+ "total": 0,
+ "total_discount_amounts": [],
+ "total_excluding_tax": 0,
+ "total_tax_amounts": [],
+ "transfer_data": null,
+ "webhooks_delivered_at": 1706118997
+ }
+ },
+ "id": "evt_1OcAgkDEQaroqDjsCv450ErG",
+ "livemode": false,
+ "object": "event",
+ "pending_webhooks": 0,
+ "request": {
+ "id": "req_X7IGKC2znjSrgh",
+ "idempotency_key": "afcd6962-d347-4fa2-b729-6c99fbf4cbf3"
+ },
+ "type": "invoice.finalized"
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "url": "/v1/events"
+}
diff --git a/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--Event.list.5.json b/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--Event.list.5.json
new file mode 100644
index 00000000000..ec051477509
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--Event.list.5.json
@@ -0,0 +1,284 @@
+{
+ "data": [
+ {
+ "api_version": "2020-08-27",
+ "created": 1706118998,
+ "data": {
+ "object": {
+ "account_country": "US",
+ "account_name": "Kandra Labs, Inc.",
+ "account_tax_ids": null,
+ "amount_due": 0,
+ "amount_paid": 0,
+ "amount_remaining": 0,
+ "amount_shipping": 0,
+ "application": null,
+ "application_fee_amount": null,
+ "attempt_count": 0,
+ "attempted": true,
+ "auto_advance": false,
+ "automatic_tax": {
+ "enabled": false,
+ "liability": null,
+ "status": null
+ },
+ "billing_reason": "manual",
+ "charge": null,
+ "collection_method": "charge_automatically",
+ "created": 1706118997,
+ "currency": "usd",
+ "custom_fields": null,
+ "customer": "cus_PR2muOX6W0EsbJ",
+ "customer_address": null,
+ "customer_email": "[email protected]",
+ "customer_name": null,
+ "customer_phone": null,
+ "customer_shipping": null,
+ "customer_tax_exempt": "none",
+ "customer_tax_ids": [],
+ "default_payment_method": null,
+ "default_source": null,
+ "default_tax_rates": [],
+ "description": null,
+ "discount": null,
+ "discounts": [],
+ "due_date": null,
+ "effective_at": 1706118997,
+ "ending_balance": 0,
+ "footer": null,
+ "from_invoice": null,
+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_17vTkwDEQaroqDjs/test_YWNjdF8xN3ZUa3dERVFhcm9xRGpzLF9QUjJtdTcwUVhCRVhjWHJ4MVBPdEExZGFJek9CcXl5LDk2NjU5Nzk5020087dxQbf7?s=ap",
+ "id": "in_1OcAgjDEQaroqDjs3M3eXI0i",
+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_17vTkwDEQaroqDjs/test_YWNjdF8xN3ZUa3dERVFhcm9xRGpzLF9QUjJtdTcwUVhCRVhjWHJ4MVBPdEExZGFJek9CcXl5LDk2NjU5Nzk5020087dxQbf7/pdf?s=ap",
+ "issuer": {
+ "type": "self"
+ },
+ "last_finalization_error": null,
+ "latest_revision": null,
+ "lines": {
+ "data": [
+ {
+ "amount": -24000,
+ "amount_excluding_tax": -24000,
+ "currency": "usd",
+ "description": "$20.00/month new customer discount",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_1OcAgiDEQaroqDjshFnuvRmq",
+ "invoice_item": "ii_1OcAgiDEQaroqDjsY91P1pCM",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1706118996,
+ "start": 1706118996
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1705038418,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_1OXda2DEQaroqDjsJIdzQXRS",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_PLhPbuhP0lDy6A",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": -24000,
+ "unit_amount_decimal": "-24000"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "-24000"
+ },
+ {
+ "amount": 46200,
+ "amount_excluding_tax": 46200,
+ "currency": "usd",
+ "description": "Zulip Basic",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_1OcAgjDEQaroqDjsHsEhqO0e",
+ "invoice_item": "ii_1OcAgiDEQaroqDjsKQgcbmlu",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1357095845,
+ "start": 1325473445
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1702998309,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_1OP4r3DEQaroqDjsEdwQ3p3N",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_PDUwJ9ZgTQzjad",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": 4200,
+ "unit_amount_decimal": "4200"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 11,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "4200"
+ },
+ {
+ "amount": -22200,
+ "amount_excluding_tax": -22200,
+ "currency": "usd",
+ "description": "Payment (Card ending in 4242)",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_1OcAgjDEQaroqDjs0sk0OWRN",
+ "invoice_item": "ii_1OcAghDEQaroqDjsjcMUJwKI",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1706118995,
+ "start": 1706118995
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1706118995,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_1OcAghDEQaroqDjsuFiXYUS6",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_OvY3hKgN66WIeP",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": -22200,
+ "unit_amount_decimal": "-22200"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "-22200"
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "total_count": 3,
+ "url": "/v1/invoices/in_1OcAgjDEQaroqDjs3M3eXI0i/lines"
+ },
+ "livemode": false,
+ "metadata": {},
+ "next_payment_attempt": null,
+ "number": "674DB534-0001",
+ "object": "invoice",
+ "on_behalf_of": null,
+ "paid": true,
+ "paid_out_of_band": false,
+ "payment_intent": null,
+ "payment_settings": {
+ "default_mandate": null,
+ "payment_method_options": null,
+ "payment_method_types": null
+ },
+ "period_end": 1706118997,
+ "period_start": 1706118997,
+ "post_payment_credit_notes_amount": 0,
+ "pre_payment_credit_notes_amount": 0,
+ "quote": null,
+ "receipt_number": null,
+ "rendering": {
+ "amount_tax_display": null,
+ "pdf": {
+ "page_size": "letter"
+ }
+ },
+ "rendering_options": null,
+ "shipping_cost": null,
+ "shipping_details": null,
+ "starting_balance": 0,
+ "statement_descriptor": "Zulip Basic",
+ "status": "paid",
+ "status_transitions": {
+ "finalized_at": 1706118997,
+ "marked_uncollectible_at": null,
+ "paid_at": 1706118997,
+ "voided_at": null
+ },
+ "subscription": null,
+ "subscription_details": {
+ "metadata": null
+ },
+ "subtotal": 0,
+ "subtotal_excluding_tax": 0,
+ "tax": null,
+ "test_clock": null,
+ "total": 0,
+ "total_discount_amounts": [],
+ "total_excluding_tax": 0,
+ "total_tax_amounts": [],
+ "transfer_data": null,
+ "webhooks_delivered_at": 1706118997
+ }
+ },
+ "id": "evt_1OcAglDEQaroqDjs3X1ERcDO",
+ "livemode": false,
+ "object": "event",
+ "pending_webhooks": 0,
+ "request": {
+ "id": "req_X7IGKC2znjSrgh",
+ "idempotency_key": "afcd6962-d347-4fa2-b729-6c99fbf4cbf3"
+ },
+ "type": "invoice.payment_succeeded"
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "url": "/v1/events"
+}
diff --git a/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--Event.list.6.json b/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--Event.list.6.json
new file mode 100644
index 00000000000..6d922067afe
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--Event.list.6.json
@@ -0,0 +1,6 @@
+{
+ "data": [],
+ "has_more": false,
+ "object": "list",
+ "url": "/v1/events"
+}
diff --git a/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--Invoice.create.1.json b/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--Invoice.create.1.json
new file mode 100644
index 00000000000..fca2a26990d
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--Invoice.create.1.json
@@ -0,0 +1,262 @@
+{
+ "account_country": "US",
+ "account_name": "Kandra Labs, Inc.",
+ "account_tax_ids": null,
+ "amount_due": 0,
+ "amount_paid": 0,
+ "amount_remaining": 0,
+ "amount_shipping": 0,
+ "application": null,
+ "application_fee_amount": null,
+ "attempt_count": 0,
+ "attempted": false,
+ "auto_advance": true,
+ "automatic_tax": {
+ "enabled": false,
+ "liability": null,
+ "status": null
+ },
+ "billing_reason": "manual",
+ "charge": null,
+ "collection_method": "charge_automatically",
+ "created": 1706118997,
+ "currency": "usd",
+ "custom_fields": null,
+ "customer": "cus_PR2muOX6W0EsbJ",
+ "customer_address": null,
+ "customer_email": "[email protected]",
+ "customer_name": null,
+ "customer_phone": null,
+ "customer_shipping": null,
+ "customer_tax_exempt": "none",
+ "customer_tax_ids": [],
+ "default_payment_method": null,
+ "default_source": null,
+ "default_tax_rates": [],
+ "description": null,
+ "discount": null,
+ "discounts": [],
+ "due_date": null,
+ "effective_at": null,
+ "ending_balance": null,
+ "footer": null,
+ "from_invoice": null,
+ "hosted_invoice_url": null,
+ "id": "in_1OcAgjDEQaroqDjs3M3eXI0i",
+ "invoice_pdf": null,
+ "issuer": {
+ "type": "self"
+ },
+ "last_finalization_error": null,
+ "latest_revision": null,
+ "lines": {
+ "data": [
+ {
+ "amount": -24000,
+ "amount_excluding_tax": -24000,
+ "currency": "usd",
+ "description": "$20.00/month new customer discount",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_1OcAgiDEQaroqDjshFnuvRmq",
+ "invoice_item": "ii_1OcAgiDEQaroqDjsY91P1pCM",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1706118996,
+ "start": 1706118996
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1705038418,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_1OXda2DEQaroqDjsJIdzQXRS",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_PLhPbuhP0lDy6A",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": -24000,
+ "unit_amount_decimal": "-24000"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "-24000"
+ },
+ {
+ "amount": 46200,
+ "amount_excluding_tax": 46200,
+ "currency": "usd",
+ "description": "Zulip Basic",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_1OcAgjDEQaroqDjsHsEhqO0e",
+ "invoice_item": "ii_1OcAgiDEQaroqDjsKQgcbmlu",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1357095845,
+ "start": 1325473445
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1702998309,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_1OP4r3DEQaroqDjsEdwQ3p3N",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_PDUwJ9ZgTQzjad",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": 4200,
+ "unit_amount_decimal": "4200"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 11,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "4200"
+ },
+ {
+ "amount": -22200,
+ "amount_excluding_tax": -22200,
+ "currency": "usd",
+ "description": "Payment (Card ending in 4242)",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_1OcAgjDEQaroqDjs0sk0OWRN",
+ "invoice_item": "ii_1OcAghDEQaroqDjsjcMUJwKI",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1706118995,
+ "start": 1706118995
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1706118995,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_1OcAghDEQaroqDjsuFiXYUS6",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_OvY3hKgN66WIeP",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": -22200,
+ "unit_amount_decimal": "-22200"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "-22200"
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "total_count": 3,
+ "url": "/v1/invoices/in_1OcAgjDEQaroqDjs3M3eXI0i/lines"
+ },
+ "livemode": false,
+ "metadata": {},
+ "next_payment_attempt": 1706122597,
+ "number": null,
+ "object": "invoice",
+ "on_behalf_of": null,
+ "paid": false,
+ "paid_out_of_band": false,
+ "payment_intent": null,
+ "payment_settings": {
+ "default_mandate": null,
+ "payment_method_options": null,
+ "payment_method_types": null
+ },
+ "period_end": 1706118997,
+ "period_start": 1706118997,
+ "post_payment_credit_notes_amount": 0,
+ "pre_payment_credit_notes_amount": 0,
+ "quote": null,
+ "receipt_number": null,
+ "rendering": {
+ "amount_tax_display": null,
+ "pdf": {
+ "page_size": "auto"
+ }
+ },
+ "rendering_options": null,
+ "shipping_cost": null,
+ "shipping_details": null,
+ "starting_balance": 0,
+ "statement_descriptor": "Zulip Basic",
+ "status": "draft",
+ "status_transitions": {
+ "finalized_at": null,
+ "marked_uncollectible_at": null,
+ "paid_at": null,
+ "voided_at": null
+ },
+ "subscription": null,
+ "subscription_details": {
+ "metadata": null
+ },
+ "subtotal": 0,
+ "subtotal_excluding_tax": 0,
+ "tax": null,
+ "test_clock": null,
+ "total": 0,
+ "total_discount_amounts": [],
+ "total_excluding_tax": 0,
+ "total_tax_amounts": [],
+ "transfer_data": null,
+ "webhooks_delivered_at": null
+}
diff --git a/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--Invoice.create.2.json b/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--Invoice.create.2.json
new file mode 100644
index 00000000000..bb39bd9dd89
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--Invoice.create.2.json
@@ -0,0 +1,162 @@
+{
+ "account_country": "US",
+ "account_name": "Kandra Labs, Inc.",
+ "account_tax_ids": null,
+ "amount_due": 120000,
+ "amount_paid": 0,
+ "amount_remaining": 120000,
+ "amount_shipping": 0,
+ "application": null,
+ "application_fee_amount": null,
+ "attempt_count": 0,
+ "attempted": false,
+ "auto_advance": true,
+ "automatic_tax": {
+ "enabled": false,
+ "liability": null,
+ "status": null
+ },
+ "billing_reason": "manual",
+ "charge": null,
+ "collection_method": "charge_automatically",
+ "created": 1706119000,
+ "currency": "usd",
+ "custom_fields": null,
+ "customer": "cus_PR2muOX6W0EsbJ",
+ "customer_address": null,
+ "customer_email": "[email protected]",
+ "customer_name": null,
+ "customer_phone": null,
+ "customer_shipping": null,
+ "customer_tax_exempt": "none",
+ "customer_tax_ids": [],
+ "default_payment_method": null,
+ "default_source": null,
+ "default_tax_rates": [],
+ "description": null,
+ "discount": null,
+ "discounts": [],
+ "due_date": null,
+ "effective_at": null,
+ "ending_balance": null,
+ "footer": null,
+ "from_invoice": null,
+ "hosted_invoice_url": null,
+ "id": "in_1OcAgmDEQaroqDjsehoi7FtP",
+ "invoice_pdf": null,
+ "issuer": {
+ "type": "self"
+ },
+ "last_finalization_error": null,
+ "latest_revision": null,
+ "lines": {
+ "data": [
+ {
+ "amount": 120000,
+ "amount_excluding_tax": 120000,
+ "currency": "usd",
+ "description": "Zulip Business - renewal",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_1OcAgmDEQaroqDjsE83aYyR6",
+ "invoice_item": "ii_1OcAgmDEQaroqDjsCp3pHp55",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1362193445,
+ "start": 1330657445
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1706119000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_1OcAgmDEQaroqDjsmTlT6jjs",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_PQEU5cW8VfaPha",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": 120000,
+ "unit_amount_decimal": "120000"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "120000"
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "total_count": 1,
+ "url": "/v1/invoices/in_1OcAgmDEQaroqDjsehoi7FtP/lines"
+ },
+ "livemode": false,
+ "metadata": {},
+ "next_payment_attempt": 1706122600,
+ "number": null,
+ "object": "invoice",
+ "on_behalf_of": null,
+ "paid": false,
+ "paid_out_of_band": false,
+ "payment_intent": null,
+ "payment_settings": {
+ "default_mandate": null,
+ "payment_method_options": null,
+ "payment_method_types": null
+ },
+ "period_end": 1706119000,
+ "period_start": 1706119000,
+ "post_payment_credit_notes_amount": 0,
+ "pre_payment_credit_notes_amount": 0,
+ "quote": null,
+ "receipt_number": null,
+ "rendering": {
+ "amount_tax_display": null,
+ "pdf": {
+ "page_size": "auto"
+ }
+ },
+ "rendering_options": null,
+ "shipping_cost": null,
+ "shipping_details": null,
+ "starting_balance": 0,
+ "statement_descriptor": "Zulip Business",
+ "status": "draft",
+ "status_transitions": {
+ "finalized_at": null,
+ "marked_uncollectible_at": null,
+ "paid_at": null,
+ "voided_at": null
+ },
+ "subscription": null,
+ "subscription_details": {
+ "metadata": null
+ },
+ "subtotal": 120000,
+ "subtotal_excluding_tax": 120000,
+ "tax": null,
+ "test_clock": null,
+ "total": 120000,
+ "total_discount_amounts": [],
+ "total_excluding_tax": 120000,
+ "total_tax_amounts": [],
+ "transfer_data": null,
+ "webhooks_delivered_at": null
+}
diff --git a/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--Invoice.finalize_invoice.1.json b/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--Invoice.finalize_invoice.1.json
new file mode 100644
index 00000000000..c8dacb2289e
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--Invoice.finalize_invoice.1.json
@@ -0,0 +1,262 @@
+{
+ "account_country": "US",
+ "account_name": "Kandra Labs, Inc.",
+ "account_tax_ids": null,
+ "amount_due": 0,
+ "amount_paid": 0,
+ "amount_remaining": 0,
+ "amount_shipping": 0,
+ "application": null,
+ "application_fee_amount": null,
+ "attempt_count": 0,
+ "attempted": true,
+ "auto_advance": false,
+ "automatic_tax": {
+ "enabled": false,
+ "liability": null,
+ "status": null
+ },
+ "billing_reason": "manual",
+ "charge": null,
+ "collection_method": "charge_automatically",
+ "created": 1706118997,
+ "currency": "usd",
+ "custom_fields": null,
+ "customer": "cus_PR2muOX6W0EsbJ",
+ "customer_address": null,
+ "customer_email": "[email protected]",
+ "customer_name": null,
+ "customer_phone": null,
+ "customer_shipping": null,
+ "customer_tax_exempt": "none",
+ "customer_tax_ids": [],
+ "default_payment_method": null,
+ "default_source": null,
+ "default_tax_rates": [],
+ "description": null,
+ "discount": null,
+ "discounts": [],
+ "due_date": null,
+ "effective_at": 1706118997,
+ "ending_balance": 0,
+ "footer": null,
+ "from_invoice": null,
+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_17vTkwDEQaroqDjs/test_YWNjdF8xN3ZUa3dERVFhcm9xRGpzLF9QUjJtdTcwUVhCRVhjWHJ4MVBPdEExZGFJek9CcXl5LDk2NjU5Nzk40200zHKqpdBe?s=ap",
+ "id": "in_1OcAgjDEQaroqDjs3M3eXI0i",
+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_17vTkwDEQaroqDjs/test_YWNjdF8xN3ZUa3dERVFhcm9xRGpzLF9QUjJtdTcwUVhCRVhjWHJ4MVBPdEExZGFJek9CcXl5LDk2NjU5Nzk40200zHKqpdBe/pdf?s=ap",
+ "issuer": {
+ "type": "self"
+ },
+ "last_finalization_error": null,
+ "latest_revision": null,
+ "lines": {
+ "data": [
+ {
+ "amount": -24000,
+ "amount_excluding_tax": -24000,
+ "currency": "usd",
+ "description": "$20.00/month new customer discount",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_1OcAgiDEQaroqDjshFnuvRmq",
+ "invoice_item": "ii_1OcAgiDEQaroqDjsY91P1pCM",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1706118996,
+ "start": 1706118996
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1705038418,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_1OXda2DEQaroqDjsJIdzQXRS",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_PLhPbuhP0lDy6A",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": -24000,
+ "unit_amount_decimal": "-24000"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "-24000"
+ },
+ {
+ "amount": 46200,
+ "amount_excluding_tax": 46200,
+ "currency": "usd",
+ "description": "Zulip Basic",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_1OcAgjDEQaroqDjsHsEhqO0e",
+ "invoice_item": "ii_1OcAgiDEQaroqDjsKQgcbmlu",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1357095845,
+ "start": 1325473445
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1702998309,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_1OP4r3DEQaroqDjsEdwQ3p3N",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_PDUwJ9ZgTQzjad",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": 4200,
+ "unit_amount_decimal": "4200"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 11,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "4200"
+ },
+ {
+ "amount": -22200,
+ "amount_excluding_tax": -22200,
+ "currency": "usd",
+ "description": "Payment (Card ending in 4242)",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_1OcAgjDEQaroqDjs0sk0OWRN",
+ "invoice_item": "ii_1OcAghDEQaroqDjsjcMUJwKI",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1706118995,
+ "start": 1706118995
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1706118995,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_1OcAghDEQaroqDjsuFiXYUS6",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_OvY3hKgN66WIeP",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": -22200,
+ "unit_amount_decimal": "-22200"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "-22200"
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "total_count": 3,
+ "url": "/v1/invoices/in_1OcAgjDEQaroqDjs3M3eXI0i/lines"
+ },
+ "livemode": false,
+ "metadata": {},
+ "next_payment_attempt": null,
+ "number": "674DB534-0001",
+ "object": "invoice",
+ "on_behalf_of": null,
+ "paid": true,
+ "paid_out_of_band": false,
+ "payment_intent": null,
+ "payment_settings": {
+ "default_mandate": null,
+ "payment_method_options": null,
+ "payment_method_types": null
+ },
+ "period_end": 1706118997,
+ "period_start": 1706118997,
+ "post_payment_credit_notes_amount": 0,
+ "pre_payment_credit_notes_amount": 0,
+ "quote": null,
+ "receipt_number": null,
+ "rendering": {
+ "amount_tax_display": null,
+ "pdf": {
+ "page_size": "letter"
+ }
+ },
+ "rendering_options": null,
+ "shipping_cost": null,
+ "shipping_details": null,
+ "starting_balance": 0,
+ "statement_descriptor": "Zulip Basic",
+ "status": "paid",
+ "status_transitions": {
+ "finalized_at": 1706118997,
+ "marked_uncollectible_at": null,
+ "paid_at": 1706118997,
+ "voided_at": null
+ },
+ "subscription": null,
+ "subscription_details": {
+ "metadata": null
+ },
+ "subtotal": 0,
+ "subtotal_excluding_tax": 0,
+ "tax": null,
+ "test_clock": null,
+ "total": 0,
+ "total_discount_amounts": [],
+ "total_excluding_tax": 0,
+ "total_tax_amounts": [],
+ "transfer_data": null,
+ "webhooks_delivered_at": 1706118997
+}
diff --git a/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--Invoice.finalize_invoice.2.json b/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--Invoice.finalize_invoice.2.json
new file mode 100644
index 00000000000..e647a38b380
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--Invoice.finalize_invoice.2.json
@@ -0,0 +1,162 @@
+{
+ "account_country": "US",
+ "account_name": "Kandra Labs, Inc.",
+ "account_tax_ids": null,
+ "amount_due": 120000,
+ "amount_paid": 0,
+ "amount_remaining": 120000,
+ "amount_shipping": 0,
+ "application": null,
+ "application_fee_amount": null,
+ "attempt_count": 0,
+ "attempted": false,
+ "auto_advance": true,
+ "automatic_tax": {
+ "enabled": false,
+ "liability": null,
+ "status": null
+ },
+ "billing_reason": "manual",
+ "charge": null,
+ "collection_method": "charge_automatically",
+ "created": 1706119000,
+ "currency": "usd",
+ "custom_fields": null,
+ "customer": "cus_PR2muOX6W0EsbJ",
+ "customer_address": null,
+ "customer_email": "[email protected]",
+ "customer_name": null,
+ "customer_phone": null,
+ "customer_shipping": null,
+ "customer_tax_exempt": "none",
+ "customer_tax_ids": [],
+ "default_payment_method": null,
+ "default_source": null,
+ "default_tax_rates": [],
+ "description": null,
+ "discount": null,
+ "discounts": [],
+ "due_date": null,
+ "effective_at": 1706119001,
+ "ending_balance": 0,
+ "footer": null,
+ "from_invoice": null,
+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_17vTkwDEQaroqDjs/test_YWNjdF8xN3ZUa3dERVFhcm9xRGpzLF9QUjJtb204bHk5ckxhMmV5TU0wMlpNTmQ0ajVmejZxLDk2NjU5ODAx0200Rr2ViGMF?s=ap",
+ "id": "in_1OcAgmDEQaroqDjsehoi7FtP",
+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_17vTkwDEQaroqDjs/test_YWNjdF8xN3ZUa3dERVFhcm9xRGpzLF9QUjJtb204bHk5ckxhMmV5TU0wMlpNTmQ0ajVmejZxLDk2NjU5ODAx0200Rr2ViGMF/pdf?s=ap",
+ "issuer": {
+ "type": "self"
+ },
+ "last_finalization_error": null,
+ "latest_revision": null,
+ "lines": {
+ "data": [
+ {
+ "amount": 120000,
+ "amount_excluding_tax": 120000,
+ "currency": "usd",
+ "description": "Zulip Business - renewal",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_1OcAgmDEQaroqDjsE83aYyR6",
+ "invoice_item": "ii_1OcAgmDEQaroqDjsCp3pHp55",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1362193445,
+ "start": 1330657445
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1706119000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_1OcAgmDEQaroqDjsmTlT6jjs",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_PQEU5cW8VfaPha",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": 120000,
+ "unit_amount_decimal": "120000"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "120000"
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "total_count": 1,
+ "url": "/v1/invoices/in_1OcAgmDEQaroqDjsehoi7FtP/lines"
+ },
+ "livemode": false,
+ "metadata": {},
+ "next_payment_attempt": 1706122600,
+ "number": "674DB534-0002",
+ "object": "invoice",
+ "on_behalf_of": null,
+ "paid": false,
+ "paid_out_of_band": false,
+ "payment_intent": "pi_3OcAgnDEQaroqDjs1E3DjYJI",
+ "payment_settings": {
+ "default_mandate": null,
+ "payment_method_options": null,
+ "payment_method_types": null
+ },
+ "period_end": 1706119000,
+ "period_start": 1706119000,
+ "post_payment_credit_notes_amount": 0,
+ "pre_payment_credit_notes_amount": 0,
+ "quote": null,
+ "receipt_number": null,
+ "rendering": {
+ "amount_tax_display": null,
+ "pdf": {
+ "page_size": "letter"
+ }
+ },
+ "rendering_options": null,
+ "shipping_cost": null,
+ "shipping_details": null,
+ "starting_balance": 0,
+ "statement_descriptor": "Zulip Business",
+ "status": "open",
+ "status_transitions": {
+ "finalized_at": 1706119001,
+ "marked_uncollectible_at": null,
+ "paid_at": null,
+ "voided_at": null
+ },
+ "subscription": null,
+ "subscription_details": {
+ "metadata": null
+ },
+ "subtotal": 120000,
+ "subtotal_excluding_tax": 120000,
+ "tax": null,
+ "test_clock": null,
+ "total": 120000,
+ "total_discount_amounts": [],
+ "total_excluding_tax": 120000,
+ "total_tax_amounts": [],
+ "transfer_data": null,
+ "webhooks_delivered_at": null
+}
diff --git a/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--Invoice.list.1.json b/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--Invoice.list.1.json
new file mode 100644
index 00000000000..e39960ab725
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--Invoice.list.1.json
@@ -0,0 +1,6 @@
+{
+ "data": [],
+ "has_more": false,
+ "object": "list",
+ "url": "/v1/invoices"
+}
diff --git a/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--InvoiceItem.create.1.json b/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--InvoiceItem.create.1.json
new file mode 100644
index 00000000000..ea4a30e3ddc
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--InvoiceItem.create.1.json
@@ -0,0 +1,47 @@
+{
+ "amount": -22200,
+ "currency": "usd",
+ "customer": "cus_PR2muOX6W0EsbJ",
+ "date": 1706118995,
+ "description": "Payment (Card ending in 4242)",
+ "discountable": false,
+ "discounts": [],
+ "id": "ii_1OcAghDEQaroqDjsjcMUJwKI",
+ "invoice": null,
+ "livemode": false,
+ "metadata": {},
+ "object": "invoiceitem",
+ "period": {
+ "end": 1706118995,
+ "start": 1706118995
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1706118995,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_1OcAghDEQaroqDjsuFiXYUS6",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_OvY3hKgN66WIeP",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": -22200,
+ "unit_amount_decimal": "-22200"
+ },
+ "proration": false,
+ "quantity": 1,
+ "subscription": null,
+ "tax_rates": [],
+ "test_clock": null,
+ "unit_amount": -22200,
+ "unit_amount_decimal": "-22200"
+}
diff --git a/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--InvoiceItem.create.2.json b/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--InvoiceItem.create.2.json
new file mode 100644
index 00000000000..bca5d0cfdf0
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--InvoiceItem.create.2.json
@@ -0,0 +1,47 @@
+{
+ "amount": 46200,
+ "currency": "usd",
+ "customer": "cus_PR2muOX6W0EsbJ",
+ "date": 1706118996,
+ "description": "Zulip Basic",
+ "discountable": false,
+ "discounts": [],
+ "id": "ii_1OcAgiDEQaroqDjsKQgcbmlu",
+ "invoice": null,
+ "livemode": false,
+ "metadata": {},
+ "object": "invoiceitem",
+ "period": {
+ "end": 1357095845,
+ "start": 1325473445
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1702998309,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_1OP4r3DEQaroqDjsEdwQ3p3N",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_PDUwJ9ZgTQzjad",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": 4200,
+ "unit_amount_decimal": "4200"
+ },
+ "proration": false,
+ "quantity": 11,
+ "subscription": null,
+ "tax_rates": [],
+ "test_clock": null,
+ "unit_amount": 4200,
+ "unit_amount_decimal": "4200"
+}
diff --git a/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--InvoiceItem.create.3.json b/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--InvoiceItem.create.3.json
new file mode 100644
index 00000000000..23dc6bbb3f6
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--InvoiceItem.create.3.json
@@ -0,0 +1,47 @@
+{
+ "amount": -24000,
+ "currency": "usd",
+ "customer": "cus_PR2muOX6W0EsbJ",
+ "date": 1706118996,
+ "description": "$20.00/month new customer discount",
+ "discountable": false,
+ "discounts": [],
+ "id": "ii_1OcAgiDEQaroqDjsY91P1pCM",
+ "invoice": null,
+ "livemode": false,
+ "metadata": {},
+ "object": "invoiceitem",
+ "period": {
+ "end": 1706118996,
+ "start": 1706118996
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1705038418,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_1OXda2DEQaroqDjsJIdzQXRS",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_PLhPbuhP0lDy6A",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": -24000,
+ "unit_amount_decimal": "-24000"
+ },
+ "proration": false,
+ "quantity": 1,
+ "subscription": null,
+ "tax_rates": [],
+ "test_clock": null,
+ "unit_amount": -24000,
+ "unit_amount_decimal": "-24000"
+}
diff --git a/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--InvoiceItem.create.4.json b/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--InvoiceItem.create.4.json
new file mode 100644
index 00000000000..1767445d0ee
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--InvoiceItem.create.4.json
@@ -0,0 +1,47 @@
+{
+ "amount": 120000,
+ "currency": "usd",
+ "customer": "cus_PR2muOX6W0EsbJ",
+ "date": 1706119000,
+ "description": "Zulip Business - renewal",
+ "discountable": false,
+ "discounts": [],
+ "id": "ii_1OcAgmDEQaroqDjsCp3pHp55",
+ "invoice": null,
+ "livemode": false,
+ "metadata": {},
+ "object": "invoiceitem",
+ "period": {
+ "end": 1362193445,
+ "start": 1330657445
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1706119000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_1OcAgmDEQaroqDjsmTlT6jjs",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_PQEU5cW8VfaPha",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": 120000,
+ "unit_amount_decimal": "120000"
+ },
+ "proration": false,
+ "quantity": 1,
+ "subscription": null,
+ "tax_rates": [],
+ "test_clock": null,
+ "unit_amount": 120000,
+ "unit_amount_decimal": "120000"
+}
diff --git a/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--PaymentIntent.create.1.json b/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--PaymentIntent.create.1.json
new file mode 100644
index 00000000000..a3b73a44f0d
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--PaymentIntent.create.1.json
@@ -0,0 +1,198 @@
+{
+ "amount": 22200,
+ "amount_capturable": 0,
+ "amount_details": {
+ "tip": {}
+ },
+ "amount_received": 22200,
+ "application": null,
+ "application_fee_amount": null,
+ "automatic_payment_methods": null,
+ "canceled_at": null,
+ "cancellation_reason": null,
+ "capture_method": "automatic",
+ "charges": {
+ "data": [
+ {
+ "amount": 22200,
+ "amount_captured": 22200,
+ "amount_refunded": 0,
+ "application": null,
+ "application_fee": null,
+ "application_fee_amount": null,
+ "balance_transaction": "txn_3OcAggDEQaroqDjs1LOWyUMd",
+ "billing_details": {
+ "address": {
+ "city": null,
+ "country": null,
+ "line1": null,
+ "line2": null,
+ "postal_code": null,
+ "state": null
+ },
+ "email": null,
+ "name": null,
+ "phone": null
+ },
+ "calculated_statement_descriptor": "ZULIP BASIC",
+ "captured": true,
+ "created": 1706118994,
+ "currency": "usd",
+ "customer": "cus_PR2muOX6W0EsbJ",
+ "description": "Upgrade to Zulip Basic, $42.0 x 11 - $20.0 x 12",
+ "destination": null,
+ "dispute": null,
+ "disputed": false,
+ "failure_balance_transaction": null,
+ "failure_code": null,
+ "failure_message": null,
+ "fraud_details": {},
+ "id": "ch_3OcAggDEQaroqDjs1wCYJDW4",
+ "invoice": null,
+ "livemode": false,
+ "metadata": {
+ "billing_modality": "charge_automatically",
+ "billing_schedule": "1",
+ "license_management": "automatic",
+ "licenses": "11",
+ "plan_tier": "103",
+ "price_per_license": "4200",
+ "remote_realm_host": "zulip.testserver",
+ "remote_realm_user_email": "[email protected]",
+ "remote_realm_user_id": "1",
+ "seat_count": "11",
+ "type": "upgrade"
+ },
+ "object": "charge",
+ "on_behalf_of": null,
+ "order": null,
+ "outcome": {
+ "network_status": "approved_by_network",
+ "reason": null,
+ "risk_level": "normal",
+ "risk_score": 41,
+ "seller_message": "Payment complete.",
+ "type": "authorized"
+ },
+ "paid": true,
+ "payment_intent": "pi_3OcAggDEQaroqDjs1wPFoB8X",
+ "payment_method": "pm_1OcAgaDEQaroqDjsnpLfvaAR",
+ "payment_method_details": {
+ "card": {
+ "amount_authorized": 22200,
+ "brand": "visa",
+ "checks": {
+ "address_line1_check": null,
+ "address_postal_code_check": null,
+ "cvc_check": "pass"
+ },
+ "country": "US",
+ "exp_month": 1,
+ "exp_year": 2025,
+ "extended_authorization": {
+ "status": "disabled"
+ },
+ "fingerprint": "9XKsMixKBi6kIIzd",
+ "funding": "credit",
+ "incremental_authorization": {
+ "status": "unavailable"
+ },
+ "installments": null,
+ "last4": "4242",
+ "mandate": null,
+ "multicapture": {
+ "status": "unavailable"
+ },
+ "network": "visa",
+ "network_token": {
+ "used": false
+ },
+ "overcapture": {
+ "maximum_amount_capturable": 22200,
+ "status": "unavailable"
+ },
+ "three_d_secure": null,
+ "wallet": null
+ },
+ "type": "card"
+ },
+ "radar_options": {},
+ "receipt_email": "[email protected]",
+ "receipt_number": null,
+ "receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xN3ZUa3dERVFhcm9xRGpzKNOexa0GMgaDwex5Vw46LBZwlwvEPwOzuiUtvAvLzkz4AkAyquht4Tngyt2mLFRDEVOO-Ldi4a9bFnG3",
+ "refunded": false,
+ "refunds": {
+ "data": [],
+ "has_more": false,
+ "object": "list",
+ "total_count": 0,
+ "url": "/v1/charges/ch_3OcAggDEQaroqDjs1wCYJDW4/refunds"
+ },
+ "review": null,
+ "shipping": null,
+ "source": null,
+ "source_transfer": null,
+ "statement_descriptor": "Zulip Basic",
+ "statement_descriptor_suffix": null,
+ "status": "succeeded",
+ "transfer_data": null,
+ "transfer_group": null
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "total_count": 1,
+ "url": "/v1/charges?payment_intent=pi_3OcAggDEQaroqDjs1wPFoB8X"
+ },
+ "client_secret": "pi_3OcAggDEQaroqDjs1wPFoB8X_secret_YT3YzqaVWlX0CSjx8mbG3te8B",
+ "confirmation_method": "automatic",
+ "created": 1706118994,
+ "currency": "usd",
+ "customer": "cus_PR2muOX6W0EsbJ",
+ "description": "Upgrade to Zulip Basic, $42.0 x 11 - $20.0 x 12",
+ "id": "pi_3OcAggDEQaroqDjs1wPFoB8X",
+ "invoice": null,
+ "last_payment_error": null,
+ "latest_charge": "ch_3OcAggDEQaroqDjs1wCYJDW4",
+ "livemode": false,
+ "metadata": {
+ "billing_modality": "charge_automatically",
+ "billing_schedule": "1",
+ "license_management": "automatic",
+ "licenses": "11",
+ "plan_tier": "103",
+ "price_per_license": "4200",
+ "remote_realm_host": "zulip.testserver",
+ "remote_realm_user_email": "[email protected]",
+ "remote_realm_user_id": "1",
+ "seat_count": "11",
+ "type": "upgrade"
+ },
+ "next_action": null,
+ "object": "payment_intent",
+ "on_behalf_of": null,
+ "payment_method": "pm_1OcAgaDEQaroqDjsnpLfvaAR",
+ "payment_method_configuration_details": null,
+ "payment_method_options": {
+ "card": {
+ "installments": null,
+ "mandate_options": null,
+ "network": null,
+ "request_three_d_secure": "automatic"
+ }
+ },
+ "payment_method_types": [
+ "card"
+ ],
+ "processing": null,
+ "receipt_email": "[email protected]",
+ "review": null,
+ "setup_future_usage": null,
+ "shipping": null,
+ "source": null,
+ "statement_descriptor": "Zulip Basic",
+ "statement_descriptor_suffix": null,
+ "status": "succeeded",
+ "transfer_data": null,
+ "transfer_group": null
+}
diff --git a/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--SetupIntent.create.1.json b/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--SetupIntent.create.1.json
new file mode 100644
index 00000000000..bb1f5334af3
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--SetupIntent.create.1.json
@@ -0,0 +1,34 @@
+{
+ "application": null,
+ "automatic_payment_methods": null,
+ "cancellation_reason": null,
+ "client_secret": "seti_1OcAgbDEQaroqDjsf45Or604_secret_PR2mQlfoBBP7QCynckZcMkQcJJ28Djv",
+ "created": 1706118989,
+ "customer": "cus_PR2muOX6W0EsbJ",
+ "description": null,
+ "flow_directions": null,
+ "id": "seti_1OcAgbDEQaroqDjsf45Or604",
+ "last_setup_error": null,
+ "latest_attempt": "setatt_1OcAgbDEQaroqDjs3OBVpqYn",
+ "livemode": false,
+ "mandate": null,
+ "metadata": {},
+ "next_action": null,
+ "object": "setup_intent",
+ "on_behalf_of": null,
+ "payment_method": "pm_1OcAgaDEQaroqDjsnpLfvaAR",
+ "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/schedule_upgrade_to_fixed_price_annual_business_plan--SetupIntent.list.1.json b/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--SetupIntent.list.1.json
new file mode 100644
index 00000000000..48459231b54
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--SetupIntent.list.1.json
@@ -0,0 +1,41 @@
+{
+ "data": [
+ {
+ "application": null,
+ "automatic_payment_methods": null,
+ "cancellation_reason": null,
+ "client_secret": "seti_1OcAgaDEQaroqDjs1vpEsLYW_secret_PR2mbhRUr083lLGmdoHl9orkodOYt50",
+ "created": 1706118988,
+ "customer": "cus_PR2muOX6W0EsbJ",
+ "description": null,
+ "flow_directions": null,
+ "id": "seti_1OcAgaDEQaroqDjs1vpEsLYW",
+ "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/schedule_upgrade_to_fixed_price_annual_business_plan--SetupIntent.retrieve.1.json b/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--SetupIntent.retrieve.1.json
new file mode 100644
index 00000000000..bb1f5334af3
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--SetupIntent.retrieve.1.json
@@ -0,0 +1,34 @@
+{
+ "application": null,
+ "automatic_payment_methods": null,
+ "cancellation_reason": null,
+ "client_secret": "seti_1OcAgbDEQaroqDjsf45Or604_secret_PR2mQlfoBBP7QCynckZcMkQcJJ28Djv",
+ "created": 1706118989,
+ "customer": "cus_PR2muOX6W0EsbJ",
+ "description": null,
+ "flow_directions": null,
+ "id": "seti_1OcAgbDEQaroqDjsf45Or604",
+ "last_setup_error": null,
+ "latest_attempt": "setatt_1OcAgbDEQaroqDjs3OBVpqYn",
+ "livemode": false,
+ "mandate": null,
+ "metadata": {},
+ "next_action": null,
+ "object": "setup_intent",
+ "on_behalf_of": null,
+ "payment_method": "pm_1OcAgaDEQaroqDjsnpLfvaAR",
+ "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/schedule_upgrade_to_fixed_price_annual_business_plan--checkout.Session.create.1.json b/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--checkout.Session.create.1.json
new file mode 100644
index 00000000000..0f5123de80f
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--checkout.Session.create.1.json
@@ -0,0 +1,75 @@
+{
+ "after_expiration": null,
+ "allow_promotion_codes": null,
+ "amount_subtotal": null,
+ "amount_total": null,
+ "automatic_tax": {
+ "enabled": false,
+ "liability": null,
+ "status": null
+ },
+ "billing_address_collection": null,
+ "cancel_url": "http://selfhosting.testserver/realm/9336fc3f-5b07-49e0-b0d6-5d48cc3e8d67/upgrade/?manual_license_management=false&tier=1",
+ "client_reference_id": null,
+ "client_secret": null,
+ "consent": null,
+ "consent_collection": null,
+ "created": 1706118988,
+ "currency": null,
+ "currency_conversion": null,
+ "custom_fields": [],
+ "custom_text": {
+ "after_submit": null,
+ "shipping_address": null,
+ "submit": null,
+ "terms_of_service_acceptance": null
+ },
+ "customer": "cus_PR2muOX6W0EsbJ",
+ "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": 1706205388,
+ "id": "cs_test_c195ime7ktWtQ3IPihAORf2yAZRfAXT2EKztWRclr3qegxNb4tmtIOdm9u",
+ "invoice": null,
+ "invoice_creation": null,
+ "livemode": false,
+ "locale": null,
+ "metadata": {
+ "remote_realm_user_id": "1",
+ "type": "card_update"
+ },
+ "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_1OcAgaDEQaroqDjs1vpEsLYW",
+ "shipping": null,
+ "shipping_address_collection": null,
+ "shipping_options": [],
+ "shipping_rate": null,
+ "status": "open",
+ "submit_type": null,
+ "subscription": null,
+ "success_url": "http://selfhosting.testserver/realm/9336fc3f-5b07-49e0-b0d6-5d48cc3e8d67/billing/event_status/?stripe_session_id={CHECKOUT_SESSION_ID}",
+ "total_details": null,
+ "ui_mode": "hosted",
+ "url": "https://checkout.stripe.com/c/pay/cs_test_c195ime7ktWtQ3IPihAORf2yAZRfAXT2EKztWRclr3qegxNb4tmtIOdm9u#fid1d2BpamRhQ2prcSc%2FJ1ZqcHdmYCVWZGt2JVV3aicpJ2R1bE5gfCc%2FJ3VuWnFgdnFaXVRmMU5zNkldQTY9SnNRY09XZml2UXNQJyknY3dqaFZgd3Ngdyc%2FcXdwYCknaWR8anBxUXx1YCc%2FJ3Zsa2JpYFpmamlwaGsnKSdga2RnaWBVaWRmYG1qaWFgd3YnP3F3cGB4JSUl"
+}
diff --git a/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--checkout.Session.list.1.json b/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--checkout.Session.list.1.json
new file mode 100644
index 00000000000..92770da9b56
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/schedule_upgrade_to_fixed_price_annual_business_plan--checkout.Session.list.1.json
@@ -0,0 +1,82 @@
+{
+ "data": [
+ {
+ "after_expiration": null,
+ "allow_promotion_codes": null,
+ "amount_subtotal": null,
+ "amount_total": null,
+ "automatic_tax": {
+ "enabled": false,
+ "liability": null,
+ "status": null
+ },
+ "billing_address_collection": null,
+ "cancel_url": "http://selfhosting.testserver/realm/9336fc3f-5b07-49e0-b0d6-5d48cc3e8d67/upgrade/?manual_license_management=false&tier=1",
+ "client_reference_id": null,
+ "client_secret": null,
+ "consent": null,
+ "consent_collection": null,
+ "created": 1706118988,
+ "currency": null,
+ "currency_conversion": null,
+ "custom_fields": [],
+ "custom_text": {
+ "after_submit": null,
+ "shipping_address": null,
+ "submit": null,
+ "terms_of_service_acceptance": null
+ },
+ "customer": "cus_PR2muOX6W0EsbJ",
+ "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": 1706205388,
+ "id": "cs_test_c195ime7ktWtQ3IPihAORf2yAZRfAXT2EKztWRclr3qegxNb4tmtIOdm9u",
+ "invoice": null,
+ "invoice_creation": null,
+ "livemode": false,
+ "locale": null,
+ "metadata": {
+ "remote_realm_user_id": "1",
+ "type": "card_update"
+ },
+ "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_1OcAgaDEQaroqDjs1vpEsLYW",
+ "shipping": null,
+ "shipping_address_collection": null,
+ "shipping_options": [],
+ "shipping_rate": null,
+ "status": "open",
+ "submit_type": null,
+ "subscription": null,
+ "success_url": "http://selfhosting.testserver/realm/9336fc3f-5b07-49e0-b0d6-5d48cc3e8d67/billing/event_status/?stripe_session_id={CHECKOUT_SESSION_ID}",
+ "total_details": null,
+ "ui_mode": "hosted",
+ "url": "https://checkout.stripe.com/c/pay/cs_test_c195ime7ktWtQ3IPihAORf2yAZRfAXT2EKztWRclr3qegxNb4tmtIOdm9u#fid1d2BpamRhQ2prcSc%2FJ1ZqcHdmYCVWZGt2JVV3aicpJ2R1bE5gfCc%2FJ3VuWnFgdnFaXVRmMU5zNkldQTY9SnNRY09XZml2UXNQJyknY3dqaFZgd3Ngdyc%2FcXdwYCknaWR8anBxUXx1YCc%2FJ3Zsa2JpYFpmamlwaGsnKSdga2RnaWBVaWRmYG1qaWFgd3YnP3F3cGB4JSUl"
+ }
+ ],
+ "has_more": true,
+ "object": "list",
+ "url": "/v1/checkout/sessions"
+}
diff --git a/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--Customer.create.1.json b/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--Customer.create.1.json
new file mode 100644
index 00000000000..3d6b9bc66c1
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--Customer.create.1.json
@@ -0,0 +1,33 @@
+{
+ "address": null,
+ "balance": 0,
+ "created": 1000000000,
+ "currency": null,
+ "default_currency": null,
+ "default_source": null,
+ "delinquent": false,
+ "description": "demo.example.com 6cde5f7a-1f7",
+ "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": {
+ "remote_server_str": "demo.example.com 6cde5f7a-1f7",
+ "remote_server_uuid": "6cde5f7a-1f7e-4978-9716-49f69ebfc9fe"
+ },
+ "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/upgrade_server_to_fixed_price_monthly_basic_plan--Customer.modify.1.json b/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--Customer.modify.1.json
new file mode 100644
index 00000000000..0e55ebbb849
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--Customer.modify.1.json
@@ -0,0 +1,33 @@
+{
+ "address": null,
+ "balance": 0,
+ "created": 1000000000,
+ "currency": null,
+ "default_currency": null,
+ "default_source": null,
+ "delinquent": false,
+ "description": "demo.example.com 6cde5f7a-1f7",
+ "discount": null,
+ "email": "[email protected]",
+ "id": "cus_NORMALIZED0001",
+ "invoice_prefix": "NORMA01",
+ "invoice_settings": {
+ "custom_fields": null,
+ "default_payment_method": "pm_1OcUDWDEQaroqDjsf8SuIhyY",
+ "footer": null,
+ "rendering_options": null
+ },
+ "livemode": false,
+ "metadata": {
+ "remote_server_str": "demo.example.com 6cde5f7a-1f7",
+ "remote_server_uuid": "6cde5f7a-1f7e-4978-9716-49f69ebfc9fe"
+ },
+ "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/upgrade_server_to_fixed_price_monthly_basic_plan--Customer.retrieve.1.json b/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--Customer.retrieve.1.json
new file mode 100644
index 00000000000..270abf5c338
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--Customer.retrieve.1.json
@@ -0,0 +1,79 @@
+{
+ "address": null,
+ "balance": 0,
+ "created": 1000000000,
+ "currency": null,
+ "default_currency": null,
+ "default_source": null,
+ "delinquent": false,
+ "description": "demo.example.com 6cde5f7a-1f7",
+ "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": 1,
+ "exp_year": 2025,
+ "fingerprint": "NORMALIZED000001",
+ "funding": "credit",
+ "generated_from": null,
+ "last4": "4242",
+ "networks": {
+ "available": [
+ "visa"
+ ],
+ "preferred": null
+ },
+ "three_d_secure_usage": {
+ "supported": true
+ },
+ "wallet": null
+ },
+ "created": 1000000000,
+ "customer": "cus_NORMALIZED0001",
+ "id": "pm_1OcUDWDEQaroqDjsf8SuIhyY",
+ "livemode": false,
+ "metadata": {},
+ "object": "payment_method",
+ "type": "card"
+ },
+ "footer": null,
+ "rendering_options": null
+ },
+ "livemode": false,
+ "metadata": {
+ "remote_server_str": "demo.example.com 6cde5f7a-1f7",
+ "remote_server_uuid": "6cde5f7a-1f7e-4978-9716-49f69ebfc9fe"
+ },
+ "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/upgrade_server_to_fixed_price_monthly_basic_plan--Customer.retrieve.2.json b/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--Customer.retrieve.2.json
new file mode 100644
index 00000000000..270abf5c338
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--Customer.retrieve.2.json
@@ -0,0 +1,79 @@
+{
+ "address": null,
+ "balance": 0,
+ "created": 1000000000,
+ "currency": null,
+ "default_currency": null,
+ "default_source": null,
+ "delinquent": false,
+ "description": "demo.example.com 6cde5f7a-1f7",
+ "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": 1,
+ "exp_year": 2025,
+ "fingerprint": "NORMALIZED000001",
+ "funding": "credit",
+ "generated_from": null,
+ "last4": "4242",
+ "networks": {
+ "available": [
+ "visa"
+ ],
+ "preferred": null
+ },
+ "three_d_secure_usage": {
+ "supported": true
+ },
+ "wallet": null
+ },
+ "created": 1000000000,
+ "customer": "cus_NORMALIZED0001",
+ "id": "pm_1OcUDWDEQaroqDjsf8SuIhyY",
+ "livemode": false,
+ "metadata": {},
+ "object": "payment_method",
+ "type": "card"
+ },
+ "footer": null,
+ "rendering_options": null
+ },
+ "livemode": false,
+ "metadata": {
+ "remote_server_str": "demo.example.com 6cde5f7a-1f7",
+ "remote_server_uuid": "6cde5f7a-1f7e-4978-9716-49f69ebfc9fe"
+ },
+ "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/upgrade_server_to_fixed_price_monthly_basic_plan--Customer.retrieve.3.json b/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--Customer.retrieve.3.json
new file mode 100644
index 00000000000..270abf5c338
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--Customer.retrieve.3.json
@@ -0,0 +1,79 @@
+{
+ "address": null,
+ "balance": 0,
+ "created": 1000000000,
+ "currency": null,
+ "default_currency": null,
+ "default_source": null,
+ "delinquent": false,
+ "description": "demo.example.com 6cde5f7a-1f7",
+ "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": 1,
+ "exp_year": 2025,
+ "fingerprint": "NORMALIZED000001",
+ "funding": "credit",
+ "generated_from": null,
+ "last4": "4242",
+ "networks": {
+ "available": [
+ "visa"
+ ],
+ "preferred": null
+ },
+ "three_d_secure_usage": {
+ "supported": true
+ },
+ "wallet": null
+ },
+ "created": 1000000000,
+ "customer": "cus_NORMALIZED0001",
+ "id": "pm_1OcUDWDEQaroqDjsf8SuIhyY",
+ "livemode": false,
+ "metadata": {},
+ "object": "payment_method",
+ "type": "card"
+ },
+ "footer": null,
+ "rendering_options": null
+ },
+ "livemode": false,
+ "metadata": {
+ "remote_server_str": "demo.example.com 6cde5f7a-1f7",
+ "remote_server_uuid": "6cde5f7a-1f7e-4978-9716-49f69ebfc9fe"
+ },
+ "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/upgrade_server_to_fixed_price_monthly_basic_plan--Customer.retrieve.4.json b/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--Customer.retrieve.4.json
new file mode 100644
index 00000000000..270abf5c338
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--Customer.retrieve.4.json
@@ -0,0 +1,79 @@
+{
+ "address": null,
+ "balance": 0,
+ "created": 1000000000,
+ "currency": null,
+ "default_currency": null,
+ "default_source": null,
+ "delinquent": false,
+ "description": "demo.example.com 6cde5f7a-1f7",
+ "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": 1,
+ "exp_year": 2025,
+ "fingerprint": "NORMALIZED000001",
+ "funding": "credit",
+ "generated_from": null,
+ "last4": "4242",
+ "networks": {
+ "available": [
+ "visa"
+ ],
+ "preferred": null
+ },
+ "three_d_secure_usage": {
+ "supported": true
+ },
+ "wallet": null
+ },
+ "created": 1000000000,
+ "customer": "cus_NORMALIZED0001",
+ "id": "pm_1OcUDWDEQaroqDjsf8SuIhyY",
+ "livemode": false,
+ "metadata": {},
+ "object": "payment_method",
+ "type": "card"
+ },
+ "footer": null,
+ "rendering_options": null
+ },
+ "livemode": false,
+ "metadata": {
+ "remote_server_str": "demo.example.com 6cde5f7a-1f7",
+ "remote_server_uuid": "6cde5f7a-1f7e-4978-9716-49f69ebfc9fe"
+ },
+ "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/upgrade_server_to_fixed_price_monthly_basic_plan--Customer.retrieve.5.json b/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--Customer.retrieve.5.json
new file mode 100644
index 00000000000..0812ff9aa13
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--Customer.retrieve.5.json
@@ -0,0 +1,79 @@
+{
+ "address": null,
+ "balance": 0,
+ "created": 1000000000,
+ "currency": "usd",
+ "default_currency": "usd",
+ "default_source": null,
+ "delinquent": false,
+ "description": "demo.example.com 6cde5f7a-1f7",
+ "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": 1,
+ "exp_year": 2025,
+ "fingerprint": "NORMALIZED000001",
+ "funding": "credit",
+ "generated_from": null,
+ "last4": "4242",
+ "networks": {
+ "available": [
+ "visa"
+ ],
+ "preferred": null
+ },
+ "three_d_secure_usage": {
+ "supported": true
+ },
+ "wallet": null
+ },
+ "created": 1000000000,
+ "customer": "cus_NORMALIZED0001",
+ "id": "pm_1OcUDWDEQaroqDjsf8SuIhyY",
+ "livemode": false,
+ "metadata": {},
+ "object": "payment_method",
+ "type": "card"
+ },
+ "footer": null,
+ "rendering_options": null
+ },
+ "livemode": false,
+ "metadata": {
+ "remote_server_str": "demo.example.com 6cde5f7a-1f7",
+ "remote_server_uuid": "6cde5f7a-1f7e-4978-9716-49f69ebfc9fe"
+ },
+ "name": null,
+ "next_invoice_sequence": 2,
+ "object": "customer",
+ "phone": null,
+ "preferred_locales": [],
+ "shipping": null,
+ "tax_exempt": "none",
+ "test_clock": null
+}
diff --git a/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--Event.list.1.json b/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--Event.list.1.json
new file mode 100644
index 00000000000..7ffbf48c8db
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--Event.list.1.json
@@ -0,0 +1,60 @@
+{
+ "data": [
+ {
+ "api_version": "2020-08-27",
+ "created": 1000000000,
+ "data": {
+ "object": {
+ "address": null,
+ "balance": 0,
+ "created": 1000000000,
+ "currency": null,
+ "default_currency": null,
+ "default_source": null,
+ "delinquent": false,
+ "description": "demo.example.com 6cde5f7a-1f7",
+ "discount": null,
+ "email": "[email protected]",
+ "id": "cus_NORMALIZED0001",
+ "invoice_prefix": "NORMA01",
+ "invoice_settings": {
+ "custom_fields": null,
+ "default_payment_method": "pm_1OcUDWDEQaroqDjsf8SuIhyY",
+ "footer": null,
+ "rendering_options": null
+ },
+ "livemode": false,
+ "metadata": {
+ "remote_server_str": "demo.example.com 6cde5f7a-1f7",
+ "remote_server_uuid": "6cde5f7a-1f7e-4978-9716-49f69ebfc9fe"
+ },
+ "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_1OcUDYDEQaroqDjsfo2iUU5E",
+ "livemode": false,
+ "object": "event",
+ "pending_webhooks": 0,
+ "request": {
+ "id": "req_NORMALIZED0001",
+ "idempotency_key": "46e2ebd4-ba13-470d-9c6b-733cab6dff18"
+ },
+ "type": "customer.updated"
+ }
+ ],
+ "has_more": true,
+ "object": "list",
+ "url": "/v1/events"
+}
diff --git a/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--Event.list.2.json b/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--Event.list.2.json
new file mode 100644
index 00000000000..e2804c896ae
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--Event.list.2.json
@@ -0,0 +1,360 @@
+{
+ "data": [
+ {
+ "api_version": "2020-08-27",
+ "created": 1000000000,
+ "data": {
+ "object": {
+ "amount": 10000,
+ "amount_capturable": 0,
+ "amount_details": {
+ "tip": {}
+ },
+ "amount_received": 10000,
+ "application": null,
+ "application_fee_amount": null,
+ "automatic_payment_methods": null,
+ "canceled_at": null,
+ "cancellation_reason": null,
+ "capture_method": "automatic",
+ "charges": {
+ "data": [
+ {
+ "amount": 10000,
+ "amount_captured": 10000,
+ "amount_refunded": 0,
+ "application": null,
+ "application_fee": null,
+ "application_fee_amount": null,
+ "balance_transaction": "txn_NORMALIZED00000000000001",
+ "billing_details": {
+ "address": {
+ "city": null,
+ "country": null,
+ "line1": null,
+ "line2": null,
+ "postal_code": null,
+ "state": null
+ },
+ "email": null,
+ "name": null,
+ "phone": null
+ },
+ "calculated_statement_descriptor": "ZULIP BASIC",
+ "captured": true,
+ "created": 1000000000,
+ "currency": "usd",
+ "customer": "cus_NORMALIZED0001",
+ "description": "Zulip Basic",
+ "destination": null,
+ "dispute": null,
+ "disputed": false,
+ "failure_balance_transaction": null,
+ "failure_code": null,
+ "failure_message": null,
+ "fraud_details": {},
+ "id": "ch_NORMALIZED00000000000001",
+ "invoice": null,
+ "livemode": false,
+ "metadata": {
+ "billing_modality": "charge_automatically",
+ "billing_schedule": "2",
+ "fixed_price": "120000",
+ "license_management": "automatic",
+ "licenses": "18",
+ "plan_tier": "103",
+ "remote_server_host": "demo.example.com",
+ "remote_server_user_email": "[email protected]",
+ "remote_server_user_id": "1",
+ "seat_count": "18",
+ "type": "upgrade"
+ },
+ "object": "charge",
+ "on_behalf_of": null,
+ "order": null,
+ "outcome": {
+ "network_status": "approved_by_network",
+ "reason": null,
+ "risk_level": "normal",
+ "risk_score": 0,
+ "seller_message": "Payment complete.",
+ "type": "authorized"
+ },
+ "paid": true,
+ "payment_intent": "pi_NORMALIZED00000000000001",
+ "payment_method": "pm_1OcUDWDEQaroqDjsf8SuIhyY",
+ "payment_method_details": {
+ "card": {
+ "amount_authorized": 10000,
+ "brand": "visa",
+ "checks": {
+ "address_line1_check": null,
+ "address_postal_code_check": null,
+ "cvc_check": "pass"
+ },
+ "country": "US",
+ "exp_month": 1,
+ "exp_year": 2025,
+ "extended_authorization": {
+ "status": "disabled"
+ },
+ "fingerprint": "NORMALIZED000001",
+ "funding": "credit",
+ "incremental_authorization": {
+ "status": "unavailable"
+ },
+ "installments": null,
+ "last4": "4242",
+ "mandate": null,
+ "multicapture": {
+ "status": "unavailable"
+ },
+ "network": "visa",
+ "network_token": {
+ "used": false
+ },
+ "overcapture": {
+ "maximum_amount_capturable": 10000,
+ "status": "unavailable"
+ },
+ "three_d_secure": null,
+ "wallet": null
+ },
+ "type": "card"
+ },
+ "radar_options": {},
+ "receipt_email": "[email protected]",
+ "receipt_number": null,
+ "receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xN3ZUa3dERVFhcm9xRGpzKJjpya0GMgZiHMbIYX06LBbLOwIt_STkejq4K_eFV7jJx0T-djlwH38CBNqiVVDJXTebIGuntshryeuA",
+ "refunded": false,
+ "refunds": {
+ "data": [],
+ "has_more": false,
+ "object": "list",
+ "total_count": 0,
+ "url": "/v1/charges/ch_NORMALIZED00000000000001/refunds"
+ },
+ "review": null,
+ "shipping": null,
+ "source": null,
+ "source_transfer": null,
+ "statement_descriptor": "Zulip Basic",
+ "statement_descriptor_suffix": null,
+ "status": "succeeded",
+ "transfer_data": null,
+ "transfer_group": null
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "total_count": 1,
+ "url": "/v1/charges?payment_intent=pi_NORMALIZED00000000000001"
+ },
+ "client_secret": "pi_NORMALIZED00000000000001_secret_P8FGMW0ROjICHmiPFmwUve9Yi",
+ "confirmation_method": "automatic",
+ "created": 1000000000,
+ "currency": "usd",
+ "customer": "cus_NORMALIZED0001",
+ "description": "Zulip Basic",
+ "id": "pi_NORMALIZED00000000000001",
+ "invoice": null,
+ "last_payment_error": null,
+ "latest_charge": "ch_NORMALIZED00000000000001",
+ "livemode": false,
+ "metadata": {
+ "billing_modality": "charge_automatically",
+ "billing_schedule": "2",
+ "fixed_price": "120000",
+ "license_management": "automatic",
+ "licenses": "18",
+ "plan_tier": "103",
+ "remote_server_host": "demo.example.com",
+ "remote_server_user_email": "[email protected]",
+ "remote_server_user_id": "1",
+ "seat_count": "18",
+ "type": "upgrade"
+ },
+ "next_action": null,
+ "object": "payment_intent",
+ "on_behalf_of": null,
+ "payment_method": "pm_1OcUDWDEQaroqDjsf8SuIhyY",
+ "payment_method_configuration_details": null,
+ "payment_method_options": {
+ "card": {
+ "installments": null,
+ "mandate_options": null,
+ "network": null,
+ "request_three_d_secure": "automatic"
+ }
+ },
+ "payment_method_types": [
+ "card"
+ ],
+ "processing": null,
+ "receipt_email": "[email protected]",
+ "review": null,
+ "setup_future_usage": null,
+ "shipping": null,
+ "source": null,
+ "statement_descriptor": "Zulip Basic",
+ "statement_descriptor_suffix": null,
+ "status": "succeeded",
+ "transfer_data": null,
+ "transfer_group": null
+ }
+ },
+ "id": "evt_3OcUDbDEQaroqDjs1bjl8v0W",
+ "livemode": false,
+ "object": "event",
+ "pending_webhooks": 2,
+ "request": {
+ "id": "req_NORMALIZED0002",
+ "idempotency_key": "01ae327b-88a7-4d3f-9775-29bf9caad793"
+ },
+ "type": "payment_intent.succeeded"
+ },
+ {
+ "api_version": "2020-08-27",
+ "created": 1000000000,
+ "data": {
+ "object": {
+ "amount": 10000,
+ "amount_captured": 10000,
+ "amount_refunded": 0,
+ "application": null,
+ "application_fee": null,
+ "application_fee_amount": null,
+ "balance_transaction": "txn_NORMALIZED00000000000001",
+ "billing_details": {
+ "address": {
+ "city": null,
+ "country": null,
+ "line1": null,
+ "line2": null,
+ "postal_code": null,
+ "state": null
+ },
+ "email": null,
+ "name": null,
+ "phone": null
+ },
+ "calculated_statement_descriptor": "ZULIP BASIC",
+ "captured": true,
+ "created": 1000000000,
+ "currency": "usd",
+ "customer": "cus_NORMALIZED0001",
+ "description": "Zulip Basic",
+ "destination": null,
+ "dispute": null,
+ "disputed": false,
+ "failure_balance_transaction": null,
+ "failure_code": null,
+ "failure_message": null,
+ "fraud_details": {},
+ "id": "ch_NORMALIZED00000000000001",
+ "invoice": null,
+ "livemode": false,
+ "metadata": {
+ "billing_modality": "charge_automatically",
+ "billing_schedule": "2",
+ "fixed_price": "120000",
+ "license_management": "automatic",
+ "licenses": "18",
+ "plan_tier": "103",
+ "remote_server_host": "demo.example.com",
+ "remote_server_user_email": "[email protected]",
+ "remote_server_user_id": "1",
+ "seat_count": "18",
+ "type": "upgrade"
+ },
+ "object": "charge",
+ "on_behalf_of": null,
+ "order": null,
+ "outcome": {
+ "network_status": "approved_by_network",
+ "reason": null,
+ "risk_level": "normal",
+ "risk_score": 0,
+ "seller_message": "Payment complete.",
+ "type": "authorized"
+ },
+ "paid": true,
+ "payment_intent": "pi_NORMALIZED00000000000001",
+ "payment_method": "pm_1OcUDWDEQaroqDjsf8SuIhyY",
+ "payment_method_details": {
+ "card": {
+ "amount_authorized": 10000,
+ "brand": "visa",
+ "checks": {
+ "address_line1_check": null,
+ "address_postal_code_check": null,
+ "cvc_check": "pass"
+ },
+ "country": "US",
+ "exp_month": 1,
+ "exp_year": 2025,
+ "extended_authorization": {
+ "status": "disabled"
+ },
+ "fingerprint": "NORMALIZED000001",
+ "funding": "credit",
+ "incremental_authorization": {
+ "status": "unavailable"
+ },
+ "installments": null,
+ "last4": "4242",
+ "mandate": null,
+ "multicapture": {
+ "status": "unavailable"
+ },
+ "network": "visa",
+ "network_token": {
+ "used": false
+ },
+ "overcapture": {
+ "maximum_amount_capturable": 10000,
+ "status": "unavailable"
+ },
+ "three_d_secure": null,
+ "wallet": null
+ },
+ "type": "card"
+ },
+ "radar_options": {},
+ "receipt_email": "[email protected]",
+ "receipt_number": null,
+ "receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xN3ZUa3dERVFhcm9xRGpzKJjpya0GMgaDDg-ZKGU6LBb1DWt86RGmRhP_KhWJ2qSACZaGUEB9sOQApIYbP8iA5lr82YWuSIQyzBzd",
+ "refunded": false,
+ "refunds": {
+ "data": [],
+ "has_more": false,
+ "object": "list",
+ "total_count": 0,
+ "url": "/v1/charges/ch_NORMALIZED00000000000001/refunds"
+ },
+ "review": null,
+ "shipping": null,
+ "source": null,
+ "source_transfer": null,
+ "statement_descriptor": "Zulip Basic",
+ "statement_descriptor_suffix": null,
+ "status": "succeeded",
+ "transfer_data": null,
+ "transfer_group": null
+ }
+ },
+ "id": "evt_3OcUDbDEQaroqDjs1cRkARch",
+ "livemode": false,
+ "object": "event",
+ "pending_webhooks": 0,
+ "request": {
+ "id": "req_NORMALIZED0002",
+ "idempotency_key": "01ae327b-88a7-4d3f-9775-29bf9caad793"
+ },
+ "type": "charge.succeeded"
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "url": "/v1/events"
+}
diff --git a/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--Event.list.3.json b/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--Event.list.3.json
new file mode 100644
index 00000000000..02dfd4f3684
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--Event.list.3.json
@@ -0,0 +1,658 @@
+{
+ "data": [
+ {
+ "api_version": "2020-08-27",
+ "created": 1000000000,
+ "data": {
+ "object": {
+ "account_country": "US",
+ "account_name": "Kandra Labs, Inc.",
+ "account_tax_ids": null,
+ "amount_due": 0,
+ "amount_paid": 0,
+ "amount_remaining": 0,
+ "amount_shipping": 0,
+ "application": null,
+ "application_fee_amount": null,
+ "attempt_count": 0,
+ "attempted": true,
+ "auto_advance": false,
+ "automatic_tax": {
+ "enabled": false,
+ "liability": null,
+ "status": null
+ },
+ "billing_reason": "manual",
+ "charge": null,
+ "collection_method": "charge_automatically",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_fields": null,
+ "customer": "cus_NORMALIZED0001",
+ "customer_address": null,
+ "customer_email": "[email protected]",
+ "customer_name": null,
+ "customer_phone": null,
+ "customer_shipping": null,
+ "customer_tax_exempt": "none",
+ "customer_tax_ids": [],
+ "default_payment_method": null,
+ "default_source": null,
+ "default_tax_rates": [],
+ "description": null,
+ "discount": null,
+ "discounts": [],
+ "due_date": null,
+ "effective_at": 1000000000,
+ "ending_balance": 0,
+ "footer": null,
+ "from_invoice": null,
+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QUk14Wmo4R2NUa2VyUzFBTm44YXk0cVFlSnNMWmlwLDk2NzM0ODc102007zniETjk?s=ap",
+ "id": "in_NORMALIZED00000000000001",
+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QUk14Wmo4R2NUa2VyUzFBTm44YXk0cVFlSnNMWmlwLDk2NzM0ODc102007zniETjk/pdf?s=ap",
+ "issuer": {
+ "type": "self"
+ },
+ "last_finalization_error": null,
+ "latest_revision": null,
+ "lines": {
+ "data": [
+ {
+ "amount": 10000,
+ "amount_excluding_tax": 10000,
+ "currency": "usd",
+ "description": "Zulip Basic",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_NORMALIZED00000000000001",
+ "invoice_item": "ii_NORMALIZED00000000000001",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1328151845,
+ "start": 1325473445
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_NORMALIZED00000000000001",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_NORMALIZED0001",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": 10000,
+ "unit_amount_decimal": "10000"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "10000"
+ },
+ {
+ "amount": -10000,
+ "amount_excluding_tax": -10000,
+ "currency": "usd",
+ "description": "Payment (Card ending in 4242)",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_NORMALIZED00000000000002",
+ "invoice_item": "ii_NORMALIZED00000000000002",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1000000000,
+ "start": 1000000000
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_NORMALIZED00000000000002",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_NORMALIZED0002",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": -10000,
+ "unit_amount_decimal": "-10000"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "-10000"
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "total_count": 2,
+ "url": "/v1/invoices/in_NORMALIZED00000000000001/lines"
+ },
+ "livemode": false,
+ "metadata": {},
+ "next_payment_attempt": null,
+ "number": "NORMALI-0001",
+ "object": "invoice",
+ "on_behalf_of": null,
+ "paid": true,
+ "paid_out_of_band": false,
+ "payment_intent": null,
+ "payment_settings": {
+ "default_mandate": null,
+ "payment_method_options": null,
+ "payment_method_types": null
+ },
+ "period_end": 1000000000,
+ "period_start": 1000000000,
+ "post_payment_credit_notes_amount": 0,
+ "pre_payment_credit_notes_amount": 0,
+ "quote": null,
+ "receipt_number": null,
+ "rendering": {
+ "amount_tax_display": null,
+ "pdf": {
+ "page_size": "letter"
+ }
+ },
+ "rendering_options": null,
+ "shipping_cost": null,
+ "shipping_details": null,
+ "starting_balance": 0,
+ "statement_descriptor": "Zulip Basic",
+ "status": "paid",
+ "status_transitions": {
+ "finalized_at": 1000000000,
+ "marked_uncollectible_at": null,
+ "paid_at": 1000000000,
+ "voided_at": null
+ },
+ "subscription": null,
+ "subscription_details": {
+ "metadata": null
+ },
+ "subtotal": 0,
+ "subtotal_excluding_tax": 0,
+ "tax": null,
+ "test_clock": null,
+ "total": 0,
+ "total_discount_amounts": [],
+ "total_excluding_tax": 0,
+ "total_tax_amounts": [],
+ "transfer_data": null,
+ "webhooks_delivered_at": 1000000000
+ },
+ "previous_attributes": {
+ "attempted": false,
+ "auto_advance": true,
+ "effective_at": null,
+ "ending_balance": null,
+ "hosted_invoice_url": null,
+ "invoice_pdf": null,
+ "next_payment_attempt": 1000000000,
+ "number": null,
+ "paid": false,
+ "rendering": {
+ "pdf": {
+ "page_size": "auto"
+ }
+ },
+ "status": "draft",
+ "status_transitions": {
+ "finalized_at": null,
+ "paid_at": null
+ }
+ }
+ },
+ "id": "evt_1OcUDfDEQaroqDjseSpfJKgb",
+ "livemode": false,
+ "object": "event",
+ "pending_webhooks": 2,
+ "request": {
+ "id": "req_NORMALIZED0003",
+ "idempotency_key": "302453f0-9876-4e9e-b99a-dac8cd95d3ff"
+ },
+ "type": "invoice.updated"
+ },
+ {
+ "api_version": "2020-08-27",
+ "created": 1000000000,
+ "data": {
+ "object": {
+ "account_country": "US",
+ "account_name": "Kandra Labs, Inc.",
+ "account_tax_ids": null,
+ "amount_due": 0,
+ "amount_paid": 0,
+ "amount_remaining": 0,
+ "amount_shipping": 0,
+ "application": null,
+ "application_fee_amount": null,
+ "attempt_count": 0,
+ "attempted": false,
+ "auto_advance": true,
+ "automatic_tax": {
+ "enabled": false,
+ "liability": null,
+ "status": null
+ },
+ "billing_reason": "manual",
+ "charge": null,
+ "collection_method": "charge_automatically",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_fields": null,
+ "customer": "cus_NORMALIZED0001",
+ "customer_address": null,
+ "customer_email": "[email protected]",
+ "customer_name": null,
+ "customer_phone": null,
+ "customer_shipping": null,
+ "customer_tax_exempt": "none",
+ "customer_tax_ids": [],
+ "default_payment_method": null,
+ "default_source": null,
+ "default_tax_rates": [],
+ "description": null,
+ "discount": null,
+ "discounts": [],
+ "due_date": null,
+ "effective_at": null,
+ "ending_balance": null,
+ "footer": null,
+ "from_invoice": null,
+ "hosted_invoice_url": null,
+ "id": "in_NORMALIZED00000000000001",
+ "invoice_pdf": null,
+ "issuer": {
+ "type": "self"
+ },
+ "last_finalization_error": null,
+ "latest_revision": null,
+ "lines": {
+ "data": [
+ {
+ "amount": 10000,
+ "amount_excluding_tax": 10000,
+ "currency": "usd",
+ "description": "Zulip Basic",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_NORMALIZED00000000000001",
+ "invoice_item": "ii_NORMALIZED00000000000001",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1328151845,
+ "start": 1325473445
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_NORMALIZED00000000000001",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_NORMALIZED0001",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": 10000,
+ "unit_amount_decimal": "10000"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "10000"
+ },
+ {
+ "amount": -10000,
+ "amount_excluding_tax": -10000,
+ "currency": "usd",
+ "description": "Payment (Card ending in 4242)",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_NORMALIZED00000000000002",
+ "invoice_item": "ii_NORMALIZED00000000000002",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1000000000,
+ "start": 1000000000
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_NORMALIZED00000000000002",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_NORMALIZED0002",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": -10000,
+ "unit_amount_decimal": "-10000"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "-10000"
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "total_count": 2,
+ "url": "/v1/invoices/in_NORMALIZED00000000000001/lines"
+ },
+ "livemode": false,
+ "metadata": {},
+ "next_payment_attempt": 1000000000,
+ "number": null,
+ "object": "invoice",
+ "on_behalf_of": null,
+ "paid": false,
+ "paid_out_of_band": false,
+ "payment_intent": null,
+ "payment_settings": {
+ "default_mandate": null,
+ "payment_method_options": null,
+ "payment_method_types": null
+ },
+ "period_end": 1000000000,
+ "period_start": 1000000000,
+ "post_payment_credit_notes_amount": 0,
+ "pre_payment_credit_notes_amount": 0,
+ "quote": null,
+ "receipt_number": null,
+ "rendering": {
+ "amount_tax_display": null,
+ "pdf": {
+ "page_size": "auto"
+ }
+ },
+ "rendering_options": null,
+ "shipping_cost": null,
+ "shipping_details": null,
+ "starting_balance": 0,
+ "statement_descriptor": "Zulip Basic",
+ "status": "draft",
+ "status_transitions": {
+ "finalized_at": null,
+ "marked_uncollectible_at": null,
+ "paid_at": null,
+ "voided_at": null
+ },
+ "subscription": null,
+ "subscription_details": {
+ "metadata": null
+ },
+ "subtotal": 0,
+ "subtotal_excluding_tax": 0,
+ "tax": null,
+ "test_clock": null,
+ "total": 0,
+ "total_discount_amounts": [],
+ "total_excluding_tax": 0,
+ "total_tax_amounts": [],
+ "transfer_data": null,
+ "webhooks_delivered_at": null
+ }
+ },
+ "id": "evt_1OcUDeDEQaroqDjsFqtgCxCk",
+ "livemode": false,
+ "object": "event",
+ "pending_webhooks": 0,
+ "request": {
+ "id": "req_NORMALIZED0004",
+ "idempotency_key": "b33278c6-64ca-48bc-bc5a-59da559cdae1"
+ },
+ "type": "invoice.created"
+ },
+ {
+ "api_version": "2020-08-27",
+ "created": 1000000000,
+ "data": {
+ "object": {
+ "amount": 10000,
+ "currency": "usd",
+ "customer": "cus_NORMALIZED0001",
+ "date": 1000000000,
+ "description": "Zulip Basic",
+ "discountable": false,
+ "discounts": [],
+ "id": "ii_NORMALIZED00000000000001",
+ "invoice": null,
+ "livemode": false,
+ "metadata": {},
+ "object": "invoiceitem",
+ "period": {
+ "end": 1328151845,
+ "start": 1325473445
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_NORMALIZED00000000000001",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_NORMALIZED0001",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": 10000,
+ "unit_amount_decimal": "10000"
+ },
+ "proration": false,
+ "quantity": 1,
+ "subscription": null,
+ "tax_rates": [],
+ "test_clock": null,
+ "unit_amount": 10000,
+ "unit_amount_decimal": "10000"
+ }
+ },
+ "id": "evt_1OcUDdDEQaroqDjsPHfeKalw",
+ "livemode": false,
+ "object": "event",
+ "pending_webhooks": 0,
+ "request": {
+ "id": "req_NORMALIZED0005",
+ "idempotency_key": "a52b0962-8604-451c-9fee-8e52da26e81a"
+ },
+ "type": "invoiceitem.created"
+ },
+ {
+ "api_version": "2020-08-27",
+ "created": 1000000000,
+ "data": {
+ "object": {
+ "amount": -10000,
+ "currency": "usd",
+ "customer": "cus_NORMALIZED0001",
+ "date": 1000000000,
+ "description": "Payment (Card ending in 4242)",
+ "discountable": false,
+ "discounts": [],
+ "id": "ii_NORMALIZED00000000000002",
+ "invoice": null,
+ "livemode": false,
+ "metadata": {},
+ "object": "invoiceitem",
+ "period": {
+ "end": 1000000000,
+ "start": 1000000000
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_NORMALIZED00000000000002",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_NORMALIZED0002",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": -10000,
+ "unit_amount_decimal": "-10000"
+ },
+ "proration": false,
+ "quantity": 1,
+ "subscription": null,
+ "tax_rates": [],
+ "test_clock": null,
+ "unit_amount": -10000,
+ "unit_amount_decimal": "-10000"
+ }
+ },
+ "id": "evt_1OcUDdDEQaroqDjsLAxiYzjm",
+ "livemode": false,
+ "object": "event",
+ "pending_webhooks": 0,
+ "request": {
+ "id": "req_NORMALIZED0006",
+ "idempotency_key": "d040f7f0-6021-46a7-bb07-719a13654f6b"
+ },
+ "type": "invoiceitem.created"
+ },
+ {
+ "api_version": "2020-08-27",
+ "created": 1000000000,
+ "data": {
+ "object": {
+ "address": null,
+ "balance": 0,
+ "created": 1000000000,
+ "currency": "usd",
+ "default_currency": "usd",
+ "default_source": null,
+ "delinquent": false,
+ "description": "demo.example.com 6cde5f7a-1f7",
+ "discount": null,
+ "email": "[email protected]",
+ "id": "cus_NORMALIZED0001",
+ "invoice_prefix": "NORMA01",
+ "invoice_settings": {
+ "custom_fields": null,
+ "default_payment_method": "pm_1OcUDWDEQaroqDjsf8SuIhyY",
+ "footer": null,
+ "rendering_options": null
+ },
+ "livemode": false,
+ "metadata": {
+ "remote_server_str": "demo.example.com 6cde5f7a-1f7",
+ "remote_server_uuid": "6cde5f7a-1f7e-4978-9716-49f69ebfc9fe"
+ },
+ "name": null,
+ "next_invoice_sequence": 1,
+ "object": "customer",
+ "phone": null,
+ "preferred_locales": [],
+ "shipping": null,
+ "tax_exempt": "none",
+ "test_clock": null
+ },
+ "previous_attributes": {
+ "currency": null,
+ "default_currency": null
+ }
+ },
+ "id": "evt_1OcUDdDEQaroqDjs7CcUgsZg",
+ "livemode": false,
+ "object": "event",
+ "pending_webhooks": 0,
+ "request": {
+ "id": "req_NORMALIZED0006",
+ "idempotency_key": "d040f7f0-6021-46a7-bb07-719a13654f6b"
+ },
+ "type": "customer.updated"
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "url": "/v1/events"
+}
diff --git a/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--Event.list.4.json b/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--Event.list.4.json
new file mode 100644
index 00000000000..a03458711c8
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--Event.list.4.json
@@ -0,0 +1,461 @@
+{
+ "data": [
+ {
+ "api_version": "2020-08-27",
+ "created": 1000000000,
+ "data": {
+ "object": {
+ "account_country": "US",
+ "account_name": "Kandra Labs, Inc.",
+ "account_tax_ids": null,
+ "amount_due": 0,
+ "amount_paid": 0,
+ "amount_remaining": 0,
+ "amount_shipping": 0,
+ "application": null,
+ "application_fee_amount": null,
+ "attempt_count": 0,
+ "attempted": true,
+ "auto_advance": false,
+ "automatic_tax": {
+ "enabled": false,
+ "liability": null,
+ "status": null
+ },
+ "billing_reason": "manual",
+ "charge": null,
+ "collection_method": "charge_automatically",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_fields": null,
+ "customer": "cus_NORMALIZED0001",
+ "customer_address": null,
+ "customer_email": "[email protected]",
+ "customer_name": null,
+ "customer_phone": null,
+ "customer_shipping": null,
+ "customer_tax_exempt": "none",
+ "customer_tax_ids": [],
+ "default_payment_method": null,
+ "default_source": null,
+ "default_tax_rates": [],
+ "description": null,
+ "discount": null,
+ "discounts": [],
+ "due_date": null,
+ "effective_at": 1000000000,
+ "ending_balance": 0,
+ "footer": null,
+ "from_invoice": null,
+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QUk14Wmo4R2NUa2VyUzFBTm44YXk0cVFlSnNMWmlwLDk2NzM0ODc102007zniETjk?s=ap",
+ "id": "in_NORMALIZED00000000000001",
+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QUk14Wmo4R2NUa2VyUzFBTm44YXk0cVFlSnNMWmlwLDk2NzM0ODc102007zniETjk/pdf?s=ap",
+ "issuer": {
+ "type": "self"
+ },
+ "last_finalization_error": null,
+ "latest_revision": null,
+ "lines": {
+ "data": [
+ {
+ "amount": 10000,
+ "amount_excluding_tax": 10000,
+ "currency": "usd",
+ "description": "Zulip Basic",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_NORMALIZED00000000000001",
+ "invoice_item": "ii_NORMALIZED00000000000001",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1328151845,
+ "start": 1325473445
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_NORMALIZED00000000000001",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_NORMALIZED0001",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": 10000,
+ "unit_amount_decimal": "10000"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "10000"
+ },
+ {
+ "amount": -10000,
+ "amount_excluding_tax": -10000,
+ "currency": "usd",
+ "description": "Payment (Card ending in 4242)",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_NORMALIZED00000000000002",
+ "invoice_item": "ii_NORMALIZED00000000000002",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1000000000,
+ "start": 1000000000
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_NORMALIZED00000000000002",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_NORMALIZED0002",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": -10000,
+ "unit_amount_decimal": "-10000"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "-10000"
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "total_count": 2,
+ "url": "/v1/invoices/in_NORMALIZED00000000000001/lines"
+ },
+ "livemode": false,
+ "metadata": {},
+ "next_payment_attempt": null,
+ "number": "NORMALI-0002",
+ "object": "invoice",
+ "on_behalf_of": null,
+ "paid": true,
+ "paid_out_of_band": false,
+ "payment_intent": null,
+ "payment_settings": {
+ "default_mandate": null,
+ "payment_method_options": null,
+ "payment_method_types": null
+ },
+ "period_end": 1000000000,
+ "period_start": 1000000000,
+ "post_payment_credit_notes_amount": 0,
+ "pre_payment_credit_notes_amount": 0,
+ "quote": null,
+ "receipt_number": null,
+ "rendering": {
+ "amount_tax_display": null,
+ "pdf": {
+ "page_size": "letter"
+ }
+ },
+ "rendering_options": null,
+ "shipping_cost": null,
+ "shipping_details": null,
+ "starting_balance": 0,
+ "statement_descriptor": "Zulip Basic",
+ "status": "paid",
+ "status_transitions": {
+ "finalized_at": 1000000000,
+ "marked_uncollectible_at": null,
+ "paid_at": 1000000000,
+ "voided_at": null
+ },
+ "subscription": null,
+ "subscription_details": {
+ "metadata": null
+ },
+ "subtotal": 0,
+ "subtotal_excluding_tax": 0,
+ "tax": null,
+ "test_clock": null,
+ "total": 0,
+ "total_discount_amounts": [],
+ "total_excluding_tax": 0,
+ "total_tax_amounts": [],
+ "transfer_data": null,
+ "webhooks_delivered_at": 1000000000
+ }
+ },
+ "id": "evt_1OcUDfDEQaroqDjsxek4FJUH",
+ "livemode": false,
+ "object": "event",
+ "pending_webhooks": 2,
+ "request": {
+ "id": "req_NORMALIZED0003",
+ "idempotency_key": "302453f0-9876-4e9e-b99a-dac8cd95d3ff"
+ },
+ "type": "invoice.paid"
+ },
+ {
+ "api_version": "2020-08-27",
+ "created": 1000000000,
+ "data": {
+ "object": {
+ "account_country": "US",
+ "account_name": "Kandra Labs, Inc.",
+ "account_tax_ids": null,
+ "amount_due": 0,
+ "amount_paid": 0,
+ "amount_remaining": 0,
+ "amount_shipping": 0,
+ "application": null,
+ "application_fee_amount": null,
+ "attempt_count": 0,
+ "attempted": true,
+ "auto_advance": false,
+ "automatic_tax": {
+ "enabled": false,
+ "liability": null,
+ "status": null
+ },
+ "billing_reason": "manual",
+ "charge": null,
+ "collection_method": "charge_automatically",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_fields": null,
+ "customer": "cus_NORMALIZED0001",
+ "customer_address": null,
+ "customer_email": "[email protected]",
+ "customer_name": null,
+ "customer_phone": null,
+ "customer_shipping": null,
+ "customer_tax_exempt": "none",
+ "customer_tax_ids": [],
+ "default_payment_method": null,
+ "default_source": null,
+ "default_tax_rates": [],
+ "description": null,
+ "discount": null,
+ "discounts": [],
+ "due_date": null,
+ "effective_at": 1000000000,
+ "ending_balance": 0,
+ "footer": null,
+ "from_invoice": null,
+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QUk14Wmo4R2NUa2VyUzFBTm44YXk0cVFlSnNMWmlwLDk2NzM0ODc102007zniETjk?s=ap",
+ "id": "in_NORMALIZED00000000000001",
+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QUk14Wmo4R2NUa2VyUzFBTm44YXk0cVFlSnNMWmlwLDk2NzM0ODc102007zniETjk/pdf?s=ap",
+ "issuer": {
+ "type": "self"
+ },
+ "last_finalization_error": null,
+ "latest_revision": null,
+ "lines": {
+ "data": [
+ {
+ "amount": 10000,
+ "amount_excluding_tax": 10000,
+ "currency": "usd",
+ "description": "Zulip Basic",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_NORMALIZED00000000000001",
+ "invoice_item": "ii_NORMALIZED00000000000001",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1328151845,
+ "start": 1325473445
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_NORMALIZED00000000000001",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_NORMALIZED0001",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": 10000,
+ "unit_amount_decimal": "10000"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "10000"
+ },
+ {
+ "amount": -10000,
+ "amount_excluding_tax": -10000,
+ "currency": "usd",
+ "description": "Payment (Card ending in 4242)",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_NORMALIZED00000000000002",
+ "invoice_item": "ii_NORMALIZED00000000000002",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1000000000,
+ "start": 1000000000
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_NORMALIZED00000000000002",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_NORMALIZED0002",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": -10000,
+ "unit_amount_decimal": "-10000"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "-10000"
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "total_count": 2,
+ "url": "/v1/invoices/in_NORMALIZED00000000000001/lines"
+ },
+ "livemode": false,
+ "metadata": {},
+ "next_payment_attempt": null,
+ "number": "NORMALI-0002",
+ "object": "invoice",
+ "on_behalf_of": null,
+ "paid": true,
+ "paid_out_of_band": false,
+ "payment_intent": null,
+ "payment_settings": {
+ "default_mandate": null,
+ "payment_method_options": null,
+ "payment_method_types": null
+ },
+ "period_end": 1000000000,
+ "period_start": 1000000000,
+ "post_payment_credit_notes_amount": 0,
+ "pre_payment_credit_notes_amount": 0,
+ "quote": null,
+ "receipt_number": null,
+ "rendering": {
+ "amount_tax_display": null,
+ "pdf": {
+ "page_size": "letter"
+ }
+ },
+ "rendering_options": null,
+ "shipping_cost": null,
+ "shipping_details": null,
+ "starting_balance": 0,
+ "statement_descriptor": "Zulip Basic",
+ "status": "paid",
+ "status_transitions": {
+ "finalized_at": 1000000000,
+ "marked_uncollectible_at": null,
+ "paid_at": 1000000000,
+ "voided_at": null
+ },
+ "subscription": null,
+ "subscription_details": {
+ "metadata": null
+ },
+ "subtotal": 0,
+ "subtotal_excluding_tax": 0,
+ "tax": null,
+ "test_clock": null,
+ "total": 0,
+ "total_discount_amounts": [],
+ "total_excluding_tax": 0,
+ "total_tax_amounts": [],
+ "transfer_data": null,
+ "webhooks_delivered_at": 1000000000
+ }
+ },
+ "id": "evt_1OcUDfDEQaroqDjsma8Z4vdI",
+ "livemode": false,
+ "object": "event",
+ "pending_webhooks": 0,
+ "request": {
+ "id": "req_NORMALIZED0003",
+ "idempotency_key": "302453f0-9876-4e9e-b99a-dac8cd95d3ff"
+ },
+ "type": "invoice.finalized"
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "url": "/v1/events"
+}
diff --git a/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--Event.list.5.json b/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--Event.list.5.json
new file mode 100644
index 00000000000..837f8fa82be
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--Event.list.5.json
@@ -0,0 +1,234 @@
+{
+ "data": [
+ {
+ "api_version": "2020-08-27",
+ "created": 1000000000,
+ "data": {
+ "object": {
+ "account_country": "US",
+ "account_name": "Kandra Labs, Inc.",
+ "account_tax_ids": null,
+ "amount_due": 0,
+ "amount_paid": 0,
+ "amount_remaining": 0,
+ "amount_shipping": 0,
+ "application": null,
+ "application_fee_amount": null,
+ "attempt_count": 0,
+ "attempted": true,
+ "auto_advance": false,
+ "automatic_tax": {
+ "enabled": false,
+ "liability": null,
+ "status": null
+ },
+ "billing_reason": "manual",
+ "charge": null,
+ "collection_method": "charge_automatically",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_fields": null,
+ "customer": "cus_NORMALIZED0001",
+ "customer_address": null,
+ "customer_email": "[email protected]",
+ "customer_name": null,
+ "customer_phone": null,
+ "customer_shipping": null,
+ "customer_tax_exempt": "none",
+ "customer_tax_ids": [],
+ "default_payment_method": null,
+ "default_source": null,
+ "default_tax_rates": [],
+ "description": null,
+ "discount": null,
+ "discounts": [],
+ "due_date": null,
+ "effective_at": 1000000000,
+ "ending_balance": 0,
+ "footer": null,
+ "from_invoice": null,
+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QUk14Wmo4R2NUa2VyUzFBTm44YXk0cVFlSnNMWmlwLDk2NzM0ODc20200AO3s2SvJ?s=ap",
+ "id": "in_NORMALIZED00000000000001",
+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QUk14Wmo4R2NUa2VyUzFBTm44YXk0cVFlSnNMWmlwLDk2NzM0ODc20200AO3s2SvJ/pdf?s=ap",
+ "issuer": {
+ "type": "self"
+ },
+ "last_finalization_error": null,
+ "latest_revision": null,
+ "lines": {
+ "data": [
+ {
+ "amount": 10000,
+ "amount_excluding_tax": 10000,
+ "currency": "usd",
+ "description": "Zulip Basic",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_NORMALIZED00000000000001",
+ "invoice_item": "ii_NORMALIZED00000000000001",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1328151845,
+ "start": 1325473445
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_NORMALIZED00000000000001",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_NORMALIZED0001",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": 10000,
+ "unit_amount_decimal": "10000"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "10000"
+ },
+ {
+ "amount": -10000,
+ "amount_excluding_tax": -10000,
+ "currency": "usd",
+ "description": "Payment (Card ending in 4242)",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_NORMALIZED00000000000002",
+ "invoice_item": "ii_NORMALIZED00000000000002",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1000000000,
+ "start": 1000000000
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_NORMALIZED00000000000002",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_NORMALIZED0002",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": -10000,
+ "unit_amount_decimal": "-10000"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "-10000"
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "total_count": 2,
+ "url": "/v1/invoices/in_NORMALIZED00000000000001/lines"
+ },
+ "livemode": false,
+ "metadata": {},
+ "next_payment_attempt": null,
+ "number": "NORMALI-0002",
+ "object": "invoice",
+ "on_behalf_of": null,
+ "paid": true,
+ "paid_out_of_band": false,
+ "payment_intent": null,
+ "payment_settings": {
+ "default_mandate": null,
+ "payment_method_options": null,
+ "payment_method_types": null
+ },
+ "period_end": 1000000000,
+ "period_start": 1000000000,
+ "post_payment_credit_notes_amount": 0,
+ "pre_payment_credit_notes_amount": 0,
+ "quote": null,
+ "receipt_number": null,
+ "rendering": {
+ "amount_tax_display": null,
+ "pdf": {
+ "page_size": "letter"
+ }
+ },
+ "rendering_options": null,
+ "shipping_cost": null,
+ "shipping_details": null,
+ "starting_balance": 0,
+ "statement_descriptor": "Zulip Basic",
+ "status": "paid",
+ "status_transitions": {
+ "finalized_at": 1000000000,
+ "marked_uncollectible_at": null,
+ "paid_at": 1000000000,
+ "voided_at": null
+ },
+ "subscription": null,
+ "subscription_details": {
+ "metadata": null
+ },
+ "subtotal": 0,
+ "subtotal_excluding_tax": 0,
+ "tax": null,
+ "test_clock": null,
+ "total": 0,
+ "total_discount_amounts": [],
+ "total_excluding_tax": 0,
+ "total_tax_amounts": [],
+ "transfer_data": null,
+ "webhooks_delivered_at": 1000000000
+ }
+ },
+ "id": "evt_1OcUDgDEQaroqDjspNqRht3H",
+ "livemode": false,
+ "object": "event",
+ "pending_webhooks": 0,
+ "request": {
+ "id": "req_NORMALIZED0003",
+ "idempotency_key": "302453f0-9876-4e9e-b99a-dac8cd95d3ff"
+ },
+ "type": "invoice.payment_succeeded"
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "url": "/v1/events"
+}
diff --git a/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--Event.list.6.json b/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--Event.list.6.json
new file mode 100644
index 00000000000..6d922067afe
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--Event.list.6.json
@@ -0,0 +1,6 @@
+{
+ "data": [],
+ "has_more": false,
+ "object": "list",
+ "url": "/v1/events"
+}
diff --git a/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--Invoice.create.1.json b/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--Invoice.create.1.json
new file mode 100644
index 00000000000..301ea5d1917
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--Invoice.create.1.json
@@ -0,0 +1,212 @@
+{
+ "account_country": "US",
+ "account_name": "Kandra Labs, Inc.",
+ "account_tax_ids": null,
+ "amount_due": 0,
+ "amount_paid": 0,
+ "amount_remaining": 0,
+ "amount_shipping": 0,
+ "application": null,
+ "application_fee_amount": null,
+ "attempt_count": 0,
+ "attempted": false,
+ "auto_advance": true,
+ "automatic_tax": {
+ "enabled": false,
+ "liability": null,
+ "status": null
+ },
+ "billing_reason": "manual",
+ "charge": null,
+ "collection_method": "charge_automatically",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_fields": null,
+ "customer": "cus_NORMALIZED0001",
+ "customer_address": null,
+ "customer_email": "[email protected]",
+ "customer_name": null,
+ "customer_phone": null,
+ "customer_shipping": null,
+ "customer_tax_exempt": "none",
+ "customer_tax_ids": [],
+ "default_payment_method": null,
+ "default_source": null,
+ "default_tax_rates": [],
+ "description": null,
+ "discount": null,
+ "discounts": [],
+ "due_date": null,
+ "effective_at": null,
+ "ending_balance": null,
+ "footer": null,
+ "from_invoice": null,
+ "hosted_invoice_url": null,
+ "id": "in_NORMALIZED00000000000001",
+ "invoice_pdf": null,
+ "issuer": {
+ "type": "self"
+ },
+ "last_finalization_error": null,
+ "latest_revision": null,
+ "lines": {
+ "data": [
+ {
+ "amount": 10000,
+ "amount_excluding_tax": 10000,
+ "currency": "usd",
+ "description": "Zulip Basic",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_NORMALIZED00000000000001",
+ "invoice_item": "ii_NORMALIZED00000000000001",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1328151845,
+ "start": 1325473445
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_NORMALIZED00000000000001",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_NORMALIZED0001",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": 10000,
+ "unit_amount_decimal": "10000"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "10000"
+ },
+ {
+ "amount": -10000,
+ "amount_excluding_tax": -10000,
+ "currency": "usd",
+ "description": "Payment (Card ending in 4242)",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_NORMALIZED00000000000002",
+ "invoice_item": "ii_NORMALIZED00000000000002",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1000000000,
+ "start": 1000000000
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_NORMALIZED00000000000002",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_NORMALIZED0002",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": -10000,
+ "unit_amount_decimal": "-10000"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "-10000"
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "total_count": 2,
+ "url": "/v1/invoices/in_NORMALIZED00000000000001/lines"
+ },
+ "livemode": false,
+ "metadata": {},
+ "next_payment_attempt": 1000000000,
+ "number": null,
+ "object": "invoice",
+ "on_behalf_of": null,
+ "paid": false,
+ "paid_out_of_band": false,
+ "payment_intent": null,
+ "payment_settings": {
+ "default_mandate": null,
+ "payment_method_options": null,
+ "payment_method_types": null
+ },
+ "period_end": 1000000000,
+ "period_start": 1000000000,
+ "post_payment_credit_notes_amount": 0,
+ "pre_payment_credit_notes_amount": 0,
+ "quote": null,
+ "receipt_number": null,
+ "rendering": {
+ "amount_tax_display": null,
+ "pdf": {
+ "page_size": "auto"
+ }
+ },
+ "rendering_options": null,
+ "shipping_cost": null,
+ "shipping_details": null,
+ "starting_balance": 0,
+ "statement_descriptor": "Zulip Basic",
+ "status": "draft",
+ "status_transitions": {
+ "finalized_at": null,
+ "marked_uncollectible_at": null,
+ "paid_at": null,
+ "voided_at": null
+ },
+ "subscription": null,
+ "subscription_details": {
+ "metadata": null
+ },
+ "subtotal": 0,
+ "subtotal_excluding_tax": 0,
+ "tax": null,
+ "test_clock": null,
+ "total": 0,
+ "total_discount_amounts": [],
+ "total_excluding_tax": 0,
+ "total_tax_amounts": [],
+ "transfer_data": null,
+ "webhooks_delivered_at": null
+}
diff --git a/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--Invoice.finalize_invoice.1.json b/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--Invoice.finalize_invoice.1.json
new file mode 100644
index 00000000000..5c00aa7654b
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--Invoice.finalize_invoice.1.json
@@ -0,0 +1,212 @@
+{
+ "account_country": "US",
+ "account_name": "Kandra Labs, Inc.",
+ "account_tax_ids": null,
+ "amount_due": 0,
+ "amount_paid": 0,
+ "amount_remaining": 0,
+ "amount_shipping": 0,
+ "application": null,
+ "application_fee_amount": null,
+ "attempt_count": 0,
+ "attempted": true,
+ "auto_advance": false,
+ "automatic_tax": {
+ "enabled": false,
+ "liability": null,
+ "status": null
+ },
+ "billing_reason": "manual",
+ "charge": null,
+ "collection_method": "charge_automatically",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_fields": null,
+ "customer": "cus_NORMALIZED0001",
+ "customer_address": null,
+ "customer_email": "[email protected]",
+ "customer_name": null,
+ "customer_phone": null,
+ "customer_shipping": null,
+ "customer_tax_exempt": "none",
+ "customer_tax_ids": [],
+ "default_payment_method": null,
+ "default_source": null,
+ "default_tax_rates": [],
+ "description": null,
+ "discount": null,
+ "discounts": [],
+ "due_date": null,
+ "effective_at": 1000000000,
+ "ending_balance": 0,
+ "footer": null,
+ "from_invoice": null,
+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QUk14Wmo4R2NUa2VyUzFBTm44YXk0cVFlSnNMWmlwLDk2NzM0ODc102007zniETjk?s=ap",
+ "id": "in_NORMALIZED00000000000001",
+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QUk14Wmo4R2NUa2VyUzFBTm44YXk0cVFlSnNMWmlwLDk2NzM0ODc102007zniETjk/pdf?s=ap",
+ "issuer": {
+ "type": "self"
+ },
+ "last_finalization_error": null,
+ "latest_revision": null,
+ "lines": {
+ "data": [
+ {
+ "amount": 10000,
+ "amount_excluding_tax": 10000,
+ "currency": "usd",
+ "description": "Zulip Basic",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_NORMALIZED00000000000001",
+ "invoice_item": "ii_NORMALIZED00000000000001",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1328151845,
+ "start": 1325473445
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_NORMALIZED00000000000001",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_NORMALIZED0001",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": 10000,
+ "unit_amount_decimal": "10000"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "10000"
+ },
+ {
+ "amount": -10000,
+ "amount_excluding_tax": -10000,
+ "currency": "usd",
+ "description": "Payment (Card ending in 4242)",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_NORMALIZED00000000000002",
+ "invoice_item": "ii_NORMALIZED00000000000002",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1000000000,
+ "start": 1000000000
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_NORMALIZED00000000000002",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_NORMALIZED0002",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": -10000,
+ "unit_amount_decimal": "-10000"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "-10000"
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "total_count": 2,
+ "url": "/v1/invoices/in_NORMALIZED00000000000001/lines"
+ },
+ "livemode": false,
+ "metadata": {},
+ "next_payment_attempt": null,
+ "number": "NORMALI-0002",
+ "object": "invoice",
+ "on_behalf_of": null,
+ "paid": true,
+ "paid_out_of_band": false,
+ "payment_intent": null,
+ "payment_settings": {
+ "default_mandate": null,
+ "payment_method_options": null,
+ "payment_method_types": null
+ },
+ "period_end": 1000000000,
+ "period_start": 1000000000,
+ "post_payment_credit_notes_amount": 0,
+ "pre_payment_credit_notes_amount": 0,
+ "quote": null,
+ "receipt_number": null,
+ "rendering": {
+ "amount_tax_display": null,
+ "pdf": {
+ "page_size": "letter"
+ }
+ },
+ "rendering_options": null,
+ "shipping_cost": null,
+ "shipping_details": null,
+ "starting_balance": 0,
+ "statement_descriptor": "Zulip Basic",
+ "status": "paid",
+ "status_transitions": {
+ "finalized_at": 1000000000,
+ "marked_uncollectible_at": null,
+ "paid_at": 1000000000,
+ "voided_at": null
+ },
+ "subscription": null,
+ "subscription_details": {
+ "metadata": null
+ },
+ "subtotal": 0,
+ "subtotal_excluding_tax": 0,
+ "tax": null,
+ "test_clock": null,
+ "total": 0,
+ "total_discount_amounts": [],
+ "total_excluding_tax": 0,
+ "total_tax_amounts": [],
+ "transfer_data": null,
+ "webhooks_delivered_at": 1000000000
+}
diff --git a/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--Invoice.list.1.json b/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--Invoice.list.1.json
new file mode 100644
index 00000000000..e39960ab725
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--Invoice.list.1.json
@@ -0,0 +1,6 @@
+{
+ "data": [],
+ "has_more": false,
+ "object": "list",
+ "url": "/v1/invoices"
+}
diff --git a/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--InvoiceItem.create.1.json b/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--InvoiceItem.create.1.json
new file mode 100644
index 00000000000..77d7a01b106
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--InvoiceItem.create.1.json
@@ -0,0 +1,47 @@
+{
+ "amount": -10000,
+ "currency": "usd",
+ "customer": "cus_NORMALIZED0001",
+ "date": 1000000000,
+ "description": "Payment (Card ending in 4242)",
+ "discountable": false,
+ "discounts": [],
+ "id": "ii_NORMALIZED00000000000002",
+ "invoice": null,
+ "livemode": false,
+ "metadata": {},
+ "object": "invoiceitem",
+ "period": {
+ "end": 1000000000,
+ "start": 1000000000
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_NORMALIZED00000000000002",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_NORMALIZED0002",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": -10000,
+ "unit_amount_decimal": "-10000"
+ },
+ "proration": false,
+ "quantity": 1,
+ "subscription": null,
+ "tax_rates": [],
+ "test_clock": null,
+ "unit_amount": -10000,
+ "unit_amount_decimal": "-10000"
+}
diff --git a/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--InvoiceItem.create.2.json b/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--InvoiceItem.create.2.json
new file mode 100644
index 00000000000..dfcce42da7d
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--InvoiceItem.create.2.json
@@ -0,0 +1,47 @@
+{
+ "amount": 10000,
+ "currency": "usd",
+ "customer": "cus_NORMALIZED0001",
+ "date": 1000000000,
+ "description": "Zulip Basic",
+ "discountable": false,
+ "discounts": [],
+ "id": "ii_NORMALIZED00000000000001",
+ "invoice": null,
+ "livemode": false,
+ "metadata": {},
+ "object": "invoiceitem",
+ "period": {
+ "end": 1328151845,
+ "start": 1325473445
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_NORMALIZED00000000000001",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_NORMALIZED0001",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": 10000,
+ "unit_amount_decimal": "10000"
+ },
+ "proration": false,
+ "quantity": 1,
+ "subscription": null,
+ "tax_rates": [],
+ "test_clock": null,
+ "unit_amount": 10000,
+ "unit_amount_decimal": "10000"
+}
diff --git a/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--PaymentIntent.create.1.json b/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--PaymentIntent.create.1.json
new file mode 100644
index 00000000000..d2b02d0ab86
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--PaymentIntent.create.1.json
@@ -0,0 +1,198 @@
+{
+ "amount": 10000,
+ "amount_capturable": 0,
+ "amount_details": {
+ "tip": {}
+ },
+ "amount_received": 10000,
+ "application": null,
+ "application_fee_amount": null,
+ "automatic_payment_methods": null,
+ "canceled_at": null,
+ "cancellation_reason": null,
+ "capture_method": "automatic",
+ "charges": {
+ "data": [
+ {
+ "amount": 10000,
+ "amount_captured": 10000,
+ "amount_refunded": 0,
+ "application": null,
+ "application_fee": null,
+ "application_fee_amount": null,
+ "balance_transaction": "txn_NORMALIZED00000000000001",
+ "billing_details": {
+ "address": {
+ "city": null,
+ "country": null,
+ "line1": null,
+ "line2": null,
+ "postal_code": null,
+ "state": null
+ },
+ "email": null,
+ "name": null,
+ "phone": null
+ },
+ "calculated_statement_descriptor": "ZULIP BASIC",
+ "captured": true,
+ "created": 1000000000,
+ "currency": "usd",
+ "customer": "cus_NORMALIZED0001",
+ "description": "Zulip Basic",
+ "destination": null,
+ "dispute": null,
+ "disputed": false,
+ "failure_balance_transaction": null,
+ "failure_code": null,
+ "failure_message": null,
+ "fraud_details": {},
+ "id": "ch_NORMALIZED00000000000001",
+ "invoice": null,
+ "livemode": false,
+ "metadata": {
+ "billing_modality": "charge_automatically",
+ "billing_schedule": "2",
+ "fixed_price": "120000",
+ "license_management": "automatic",
+ "licenses": "18",
+ "plan_tier": "103",
+ "remote_server_host": "demo.example.com",
+ "remote_server_user_email": "[email protected]",
+ "remote_server_user_id": "1",
+ "seat_count": "18",
+ "type": "upgrade"
+ },
+ "object": "charge",
+ "on_behalf_of": null,
+ "order": null,
+ "outcome": {
+ "network_status": "approved_by_network",
+ "reason": null,
+ "risk_level": "normal",
+ "risk_score": 0,
+ "seller_message": "Payment complete.",
+ "type": "authorized"
+ },
+ "paid": true,
+ "payment_intent": "pi_NORMALIZED00000000000001",
+ "payment_method": "pm_1OcUDWDEQaroqDjsf8SuIhyY",
+ "payment_method_details": {
+ "card": {
+ "amount_authorized": 10000,
+ "brand": "visa",
+ "checks": {
+ "address_line1_check": null,
+ "address_postal_code_check": null,
+ "cvc_check": "pass"
+ },
+ "country": "US",
+ "exp_month": 1,
+ "exp_year": 2025,
+ "extended_authorization": {
+ "status": "disabled"
+ },
+ "fingerprint": "NORMALIZED000001",
+ "funding": "credit",
+ "incremental_authorization": {
+ "status": "unavailable"
+ },
+ "installments": null,
+ "last4": "4242",
+ "mandate": null,
+ "multicapture": {
+ "status": "unavailable"
+ },
+ "network": "visa",
+ "network_token": {
+ "used": false
+ },
+ "overcapture": {
+ "maximum_amount_capturable": 10000,
+ "status": "unavailable"
+ },
+ "three_d_secure": null,
+ "wallet": null
+ },
+ "type": "card"
+ },
+ "radar_options": {},
+ "receipt_email": "[email protected]",
+ "receipt_number": null,
+ "receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xN3ZUa3dERVFhcm9xRGpzKJjpya0GMgZjONeNpiY6LBYj6FKcVzkqbFn854O3VxNnMrmCy6KQ8YJ-3wzN_odiGtYwWtGGYcjTFRJM",
+ "refunded": false,
+ "refunds": {
+ "data": [],
+ "has_more": false,
+ "object": "list",
+ "total_count": 0,
+ "url": "/v1/charges/ch_NORMALIZED00000000000001/refunds"
+ },
+ "review": null,
+ "shipping": null,
+ "source": null,
+ "source_transfer": null,
+ "statement_descriptor": "Zulip Basic",
+ "statement_descriptor_suffix": null,
+ "status": "succeeded",
+ "transfer_data": null,
+ "transfer_group": null
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "total_count": 1,
+ "url": "/v1/charges?payment_intent=pi_NORMALIZED00000000000001"
+ },
+ "client_secret": "pi_NORMALIZED00000000000001_secret_P8FGMW0ROjICHmiPFmwUve9Yi",
+ "confirmation_method": "automatic",
+ "created": 1000000000,
+ "currency": "usd",
+ "customer": "cus_NORMALIZED0001",
+ "description": "Zulip Basic",
+ "id": "pi_NORMALIZED00000000000001",
+ "invoice": null,
+ "last_payment_error": null,
+ "latest_charge": "ch_NORMALIZED00000000000001",
+ "livemode": false,
+ "metadata": {
+ "billing_modality": "charge_automatically",
+ "billing_schedule": "2",
+ "fixed_price": "120000",
+ "license_management": "automatic",
+ "licenses": "18",
+ "plan_tier": "103",
+ "remote_server_host": "demo.example.com",
+ "remote_server_user_email": "[email protected]",
+ "remote_server_user_id": "1",
+ "seat_count": "18",
+ "type": "upgrade"
+ },
+ "next_action": null,
+ "object": "payment_intent",
+ "on_behalf_of": null,
+ "payment_method": "pm_1OcUDWDEQaroqDjsf8SuIhyY",
+ "payment_method_configuration_details": null,
+ "payment_method_options": {
+ "card": {
+ "installments": null,
+ "mandate_options": null,
+ "network": null,
+ "request_three_d_secure": "automatic"
+ }
+ },
+ "payment_method_types": [
+ "card"
+ ],
+ "processing": null,
+ "receipt_email": "[email protected]",
+ "review": null,
+ "setup_future_usage": null,
+ "shipping": null,
+ "source": null,
+ "statement_descriptor": "Zulip Basic",
+ "statement_descriptor_suffix": null,
+ "status": "succeeded",
+ "transfer_data": null,
+ "transfer_group": null
+}
diff --git a/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--SetupIntent.create.1.json b/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--SetupIntent.create.1.json
new file mode 100644
index 00000000000..5bdf14e7193
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--SetupIntent.create.1.json
@@ -0,0 +1,34 @@
+{
+ "application": null,
+ "automatic_payment_methods": null,
+ "cancellation_reason": null,
+ "client_secret": "seti_1OcUDWDEQaroqDjsqQG0gDc1_secret_PRMxuI11RWgPNvVvhRuuqZrEmdJq9ph",
+ "created": 1000000000,
+ "customer": "cus_NORMALIZED0001",
+ "description": null,
+ "flow_directions": null,
+ "id": "seti_1OcUDWDEQaroqDjsqQG0gDc1",
+ "last_setup_error": null,
+ "latest_attempt": "setatt_1OcUDWDEQaroqDjshwjCCUKr",
+ "livemode": false,
+ "mandate": null,
+ "metadata": {},
+ "next_action": null,
+ "object": "setup_intent",
+ "on_behalf_of": null,
+ "payment_method": "pm_1OcUDWDEQaroqDjsf8SuIhyY",
+ "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/upgrade_server_to_fixed_price_monthly_basic_plan--SetupIntent.list.1.json b/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--SetupIntent.list.1.json
new file mode 100644
index 00000000000..c55126304a0
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--SetupIntent.list.1.json
@@ -0,0 +1,41 @@
+{
+ "data": [
+ {
+ "application": null,
+ "automatic_payment_methods": null,
+ "cancellation_reason": null,
+ "client_secret": "seti_1OcUDVDEQaroqDjsxJcjHIaq_secret_PRMxcXaZqtZGZYzIUcIbWnHwYMHQeEa",
+ "created": 1000000000,
+ "customer": "cus_NORMALIZED0001",
+ "description": null,
+ "flow_directions": null,
+ "id": "seti_1OcUDVDEQaroqDjsxJcjHIaq",
+ "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/upgrade_server_to_fixed_price_monthly_basic_plan--SetupIntent.retrieve.1.json b/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--SetupIntent.retrieve.1.json
new file mode 100644
index 00000000000..5bdf14e7193
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--SetupIntent.retrieve.1.json
@@ -0,0 +1,34 @@
+{
+ "application": null,
+ "automatic_payment_methods": null,
+ "cancellation_reason": null,
+ "client_secret": "seti_1OcUDWDEQaroqDjsqQG0gDc1_secret_PRMxuI11RWgPNvVvhRuuqZrEmdJq9ph",
+ "created": 1000000000,
+ "customer": "cus_NORMALIZED0001",
+ "description": null,
+ "flow_directions": null,
+ "id": "seti_1OcUDWDEQaroqDjsqQG0gDc1",
+ "last_setup_error": null,
+ "latest_attempt": "setatt_1OcUDWDEQaroqDjshwjCCUKr",
+ "livemode": false,
+ "mandate": null,
+ "metadata": {},
+ "next_action": null,
+ "object": "setup_intent",
+ "on_behalf_of": null,
+ "payment_method": "pm_1OcUDWDEQaroqDjsf8SuIhyY",
+ "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/upgrade_server_to_fixed_price_monthly_basic_plan--checkout.Session.create.1.json b/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--checkout.Session.create.1.json
new file mode 100644
index 00000000000..3d20f79e16f
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--checkout.Session.create.1.json
@@ -0,0 +1,75 @@
+{
+ "after_expiration": null,
+ "allow_promotion_codes": null,
+ "amount_subtotal": null,
+ "amount_total": null,
+ "automatic_tax": {
+ "enabled": false,
+ "liability": null,
+ "status": null
+ },
+ "billing_address_collection": null,
+ "cancel_url": "http://selfhosting.testserver/server/6cde5f7a-1f7e-4978-9716-49f69ebfc9fe/upgrade/?manual_license_management=false&tier=1",
+ "client_reference_id": null,
+ "client_secret": null,
+ "consent": null,
+ "consent_collection": null,
+ "created": 1000000000,
+ "currency": null,
+ "currency_conversion": null,
+ "custom_fields": [],
+ "custom_text": {
+ "after_submit": null,
+ "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_NORMALIZED0244NTIMpLZJq9TskmJyDaTGZFLkHOkYmFMORK7ezOdR7h9Y",
+ "invoice": null,
+ "invoice_creation": null,
+ "livemode": false,
+ "locale": null,
+ "metadata": {
+ "remote_server_user_id": "1",
+ "type": "card_update"
+ },
+ "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_1OcUDVDEQaroqDjsxJcjHIaq",
+ "shipping": null,
+ "shipping_address_collection": null,
+ "shipping_options": [],
+ "shipping_rate": null,
+ "status": "open",
+ "submit_type": null,
+ "subscription": null,
+ "success_url": "http://selfhosting.testserver/server/6cde5f7a-1f7e-4978-9716-49f69ebfc9fe/billing/event_status/?stripe_session_id={CHECKOUT_SESSION_ID}",
+ "total_details": null,
+ "ui_mode": "hosted",
+ "url": "https://checkout.stripe.com/c/pay/cs_test_NORMALIZED0244NTIMpLZJq9TskmJyDaTGZFLkHOkYmFMORK7ezOdR7h9Y#fid1d2BpamRhQ2prcSc%2FJ1ZqcHdmYCVWZGt2JVV3aicpJ2R1bE5gfCc%2FJ3VuWnFgdnFaXVRmMU5zNkldQTY9SnNRY09XZml2UXNQJyknY3dqaFZgd3Ngdyc%2FcXdwYCknaWR8anBxUXx1YCc%2FJ3Zsa2JpYFpmamlwaGsnKSdga2RnaWBVaWRmYG1qaWFgd3YnP3F3cGB4JSUl"
+}
diff --git a/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--checkout.Session.list.1.json b/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--checkout.Session.list.1.json
new file mode 100644
index 00000000000..9bc02a4ec46
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/upgrade_server_to_fixed_price_monthly_basic_plan--checkout.Session.list.1.json
@@ -0,0 +1,82 @@
+{
+ "data": [
+ {
+ "after_expiration": null,
+ "allow_promotion_codes": null,
+ "amount_subtotal": null,
+ "amount_total": null,
+ "automatic_tax": {
+ "enabled": false,
+ "liability": null,
+ "status": null
+ },
+ "billing_address_collection": null,
+ "cancel_url": "http://selfhosting.testserver/server/6cde5f7a-1f7e-4978-9716-49f69ebfc9fe/upgrade/?manual_license_management=false&tier=1",
+ "client_reference_id": null,
+ "client_secret": null,
+ "consent": null,
+ "consent_collection": null,
+ "created": 1000000000,
+ "currency": null,
+ "currency_conversion": null,
+ "custom_fields": [],
+ "custom_text": {
+ "after_submit": null,
+ "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_NORMALIZED0244NTIMpLZJq9TskmJyDaTGZFLkHOkYmFMORK7ezOdR7h9Y",
+ "invoice": null,
+ "invoice_creation": null,
+ "livemode": false,
+ "locale": null,
+ "metadata": {
+ "remote_server_user_id": "1",
+ "type": "card_update"
+ },
+ "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_1OcUDVDEQaroqDjsxJcjHIaq",
+ "shipping": null,
+ "shipping_address_collection": null,
+ "shipping_options": [],
+ "shipping_rate": null,
+ "status": "open",
+ "submit_type": null,
+ "subscription": null,
+ "success_url": "http://selfhosting.testserver/server/6cde5f7a-1f7e-4978-9716-49f69ebfc9fe/billing/event_status/?stripe_session_id={CHECKOUT_SESSION_ID}",
+ "total_details": null,
+ "ui_mode": "hosted",
+ "url": "https://checkout.stripe.com/c/pay/cs_test_NORMALIZED0244NTIMpLZJq9TskmJyDaTGZFLkHOkYmFMORK7ezOdR7h9Y#fid1d2BpamRhQ2prcSc%2FJ1ZqcHdmYCVWZGt2JVV3aicpJ2R1bE5gfCc%2FJ3VuWnFgdnFaXVRmMU5zNkldQTY9SnNRY09XZml2UXNQJyknY3dqaFZgd3Ngdyc%2FcXdwYCknaWR8anBxUXx1YCc%2FJ3Zsa2JpYFpmamlwaGsnKSdga2RnaWBVaWRmYG1qaWFgd3YnP3F3cGB4JSUl"
+ }
+ ],
+ "has_more": true,
+ "object": "list",
+ "url": "/v1/checkout/sessions"
+}
diff --git a/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--Customer.create.1.json b/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--Customer.create.1.json
new file mode 100644
index 00000000000..78fb2619a3b
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--Customer.create.1.json
@@ -0,0 +1,33 @@
+{
+ "address": null,
+ "balance": 0,
+ "created": 1706114454,
+ "currency": null,
+ "default_currency": null,
+ "default_source": null,
+ "delinquent": false,
+ "description": "zulip.testserver 9336fc3f-5b0",
+ "discount": null,
+ "email": "[email protected]",
+ "id": "cus_PR1YvTbJ32gEOi",
+ "invoice_prefix": "F7CDD9B5",
+ "invoice_settings": {
+ "custom_fields": null,
+ "default_payment_method": null,
+ "footer": null,
+ "rendering_options": null
+ },
+ "livemode": false,
+ "metadata": {
+ "remote_realm_host": "zulip.testserver",
+ "remote_realm_uuid": "9336fc3f-5b07-49e0-b0d6-5d48cc3e8d67"
+ },
+ "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/upgrade_user_to_fixed_price_monthly_basic_plan--Customer.modify.1.json b/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--Customer.modify.1.json
new file mode 100644
index 00000000000..48560f5c953
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--Customer.modify.1.json
@@ -0,0 +1,33 @@
+{
+ "address": null,
+ "balance": 0,
+ "created": 1706114454,
+ "currency": null,
+ "default_currency": null,
+ "default_source": null,
+ "delinquent": false,
+ "description": "zulip.testserver 9336fc3f-5b0",
+ "discount": null,
+ "email": "[email protected]",
+ "id": "cus_PR1YvTbJ32gEOi",
+ "invoice_prefix": "F7CDD9B5",
+ "invoice_settings": {
+ "custom_fields": null,
+ "default_payment_method": "pm_1Oc9VUDEQaroqDjsMvuKOumG",
+ "footer": null,
+ "rendering_options": null
+ },
+ "livemode": false,
+ "metadata": {
+ "remote_realm_host": "zulip.testserver",
+ "remote_realm_uuid": "9336fc3f-5b07-49e0-b0d6-5d48cc3e8d67"
+ },
+ "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/upgrade_user_to_fixed_price_monthly_basic_plan--Customer.retrieve.1.json b/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--Customer.retrieve.1.json
new file mode 100644
index 00000000000..8eefde43147
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--Customer.retrieve.1.json
@@ -0,0 +1,79 @@
+{
+ "address": null,
+ "balance": 0,
+ "created": 1706114454,
+ "currency": null,
+ "default_currency": null,
+ "default_source": null,
+ "delinquent": false,
+ "description": "zulip.testserver 9336fc3f-5b0",
+ "discount": null,
+ "email": "[email protected]",
+ "id": "cus_PR1YvTbJ32gEOi",
+ "invoice_prefix": "F7CDD9B5",
+ "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": 1,
+ "exp_year": 2025,
+ "fingerprint": "9XKsMixKBi6kIIzd",
+ "funding": "credit",
+ "generated_from": null,
+ "last4": "4242",
+ "networks": {
+ "available": [
+ "visa"
+ ],
+ "preferred": null
+ },
+ "three_d_secure_usage": {
+ "supported": true
+ },
+ "wallet": null
+ },
+ "created": 1706114456,
+ "customer": "cus_PR1YvTbJ32gEOi",
+ "id": "pm_1Oc9VUDEQaroqDjsMvuKOumG",
+ "livemode": false,
+ "metadata": {},
+ "object": "payment_method",
+ "type": "card"
+ },
+ "footer": null,
+ "rendering_options": null
+ },
+ "livemode": false,
+ "metadata": {
+ "remote_realm_host": "zulip.testserver",
+ "remote_realm_uuid": "9336fc3f-5b07-49e0-b0d6-5d48cc3e8d67"
+ },
+ "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/upgrade_user_to_fixed_price_monthly_basic_plan--Customer.retrieve.2.json b/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--Customer.retrieve.2.json
new file mode 100644
index 00000000000..8eefde43147
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--Customer.retrieve.2.json
@@ -0,0 +1,79 @@
+{
+ "address": null,
+ "balance": 0,
+ "created": 1706114454,
+ "currency": null,
+ "default_currency": null,
+ "default_source": null,
+ "delinquent": false,
+ "description": "zulip.testserver 9336fc3f-5b0",
+ "discount": null,
+ "email": "[email protected]",
+ "id": "cus_PR1YvTbJ32gEOi",
+ "invoice_prefix": "F7CDD9B5",
+ "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": 1,
+ "exp_year": 2025,
+ "fingerprint": "9XKsMixKBi6kIIzd",
+ "funding": "credit",
+ "generated_from": null,
+ "last4": "4242",
+ "networks": {
+ "available": [
+ "visa"
+ ],
+ "preferred": null
+ },
+ "three_d_secure_usage": {
+ "supported": true
+ },
+ "wallet": null
+ },
+ "created": 1706114456,
+ "customer": "cus_PR1YvTbJ32gEOi",
+ "id": "pm_1Oc9VUDEQaroqDjsMvuKOumG",
+ "livemode": false,
+ "metadata": {},
+ "object": "payment_method",
+ "type": "card"
+ },
+ "footer": null,
+ "rendering_options": null
+ },
+ "livemode": false,
+ "metadata": {
+ "remote_realm_host": "zulip.testserver",
+ "remote_realm_uuid": "9336fc3f-5b07-49e0-b0d6-5d48cc3e8d67"
+ },
+ "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/upgrade_user_to_fixed_price_monthly_basic_plan--Customer.retrieve.3.json b/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--Customer.retrieve.3.json
new file mode 100644
index 00000000000..8eefde43147
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--Customer.retrieve.3.json
@@ -0,0 +1,79 @@
+{
+ "address": null,
+ "balance": 0,
+ "created": 1706114454,
+ "currency": null,
+ "default_currency": null,
+ "default_source": null,
+ "delinquent": false,
+ "description": "zulip.testserver 9336fc3f-5b0",
+ "discount": null,
+ "email": "[email protected]",
+ "id": "cus_PR1YvTbJ32gEOi",
+ "invoice_prefix": "F7CDD9B5",
+ "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": 1,
+ "exp_year": 2025,
+ "fingerprint": "9XKsMixKBi6kIIzd",
+ "funding": "credit",
+ "generated_from": null,
+ "last4": "4242",
+ "networks": {
+ "available": [
+ "visa"
+ ],
+ "preferred": null
+ },
+ "three_d_secure_usage": {
+ "supported": true
+ },
+ "wallet": null
+ },
+ "created": 1706114456,
+ "customer": "cus_PR1YvTbJ32gEOi",
+ "id": "pm_1Oc9VUDEQaroqDjsMvuKOumG",
+ "livemode": false,
+ "metadata": {},
+ "object": "payment_method",
+ "type": "card"
+ },
+ "footer": null,
+ "rendering_options": null
+ },
+ "livemode": false,
+ "metadata": {
+ "remote_realm_host": "zulip.testserver",
+ "remote_realm_uuid": "9336fc3f-5b07-49e0-b0d6-5d48cc3e8d67"
+ },
+ "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/upgrade_user_to_fixed_price_monthly_basic_plan--Customer.retrieve.4.json b/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--Customer.retrieve.4.json
new file mode 100644
index 00000000000..8eefde43147
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--Customer.retrieve.4.json
@@ -0,0 +1,79 @@
+{
+ "address": null,
+ "balance": 0,
+ "created": 1706114454,
+ "currency": null,
+ "default_currency": null,
+ "default_source": null,
+ "delinquent": false,
+ "description": "zulip.testserver 9336fc3f-5b0",
+ "discount": null,
+ "email": "[email protected]",
+ "id": "cus_PR1YvTbJ32gEOi",
+ "invoice_prefix": "F7CDD9B5",
+ "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": 1,
+ "exp_year": 2025,
+ "fingerprint": "9XKsMixKBi6kIIzd",
+ "funding": "credit",
+ "generated_from": null,
+ "last4": "4242",
+ "networks": {
+ "available": [
+ "visa"
+ ],
+ "preferred": null
+ },
+ "three_d_secure_usage": {
+ "supported": true
+ },
+ "wallet": null
+ },
+ "created": 1706114456,
+ "customer": "cus_PR1YvTbJ32gEOi",
+ "id": "pm_1Oc9VUDEQaroqDjsMvuKOumG",
+ "livemode": false,
+ "metadata": {},
+ "object": "payment_method",
+ "type": "card"
+ },
+ "footer": null,
+ "rendering_options": null
+ },
+ "livemode": false,
+ "metadata": {
+ "remote_realm_host": "zulip.testserver",
+ "remote_realm_uuid": "9336fc3f-5b07-49e0-b0d6-5d48cc3e8d67"
+ },
+ "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/upgrade_user_to_fixed_price_monthly_basic_plan--Customer.retrieve.5.json b/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--Customer.retrieve.5.json
new file mode 100644
index 00000000000..dff44c604ba
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--Customer.retrieve.5.json
@@ -0,0 +1,79 @@
+{
+ "address": null,
+ "balance": 0,
+ "created": 1706114454,
+ "currency": "usd",
+ "default_currency": "usd",
+ "default_source": null,
+ "delinquent": false,
+ "description": "zulip.testserver 9336fc3f-5b0",
+ "discount": null,
+ "email": "[email protected]",
+ "id": "cus_PR1YvTbJ32gEOi",
+ "invoice_prefix": "F7CDD9B5",
+ "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": 1,
+ "exp_year": 2025,
+ "fingerprint": "9XKsMixKBi6kIIzd",
+ "funding": "credit",
+ "generated_from": null,
+ "last4": "4242",
+ "networks": {
+ "available": [
+ "visa"
+ ],
+ "preferred": null
+ },
+ "three_d_secure_usage": {
+ "supported": true
+ },
+ "wallet": null
+ },
+ "created": 1706114456,
+ "customer": "cus_PR1YvTbJ32gEOi",
+ "id": "pm_1Oc9VUDEQaroqDjsMvuKOumG",
+ "livemode": false,
+ "metadata": {},
+ "object": "payment_method",
+ "type": "card"
+ },
+ "footer": null,
+ "rendering_options": null
+ },
+ "livemode": false,
+ "metadata": {
+ "remote_realm_host": "zulip.testserver",
+ "remote_realm_uuid": "9336fc3f-5b07-49e0-b0d6-5d48cc3e8d67"
+ },
+ "name": null,
+ "next_invoice_sequence": 2,
+ "object": "customer",
+ "phone": null,
+ "preferred_locales": [],
+ "shipping": null,
+ "tax_exempt": "none",
+ "test_clock": null
+}
diff --git a/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--Event.list.1.json b/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--Event.list.1.json
new file mode 100644
index 00000000000..a48ade20fec
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--Event.list.1.json
@@ -0,0 +1,60 @@
+{
+ "data": [
+ {
+ "api_version": "2020-08-27",
+ "created": 1706114458,
+ "data": {
+ "object": {
+ "address": null,
+ "balance": 0,
+ "created": 1706114454,
+ "currency": null,
+ "default_currency": null,
+ "default_source": null,
+ "delinquent": false,
+ "description": "zulip.testserver 9336fc3f-5b0",
+ "discount": null,
+ "email": "[email protected]",
+ "id": "cus_PR1YvTbJ32gEOi",
+ "invoice_prefix": "F7CDD9B5",
+ "invoice_settings": {
+ "custom_fields": null,
+ "default_payment_method": "pm_1Oc9VUDEQaroqDjsMvuKOumG",
+ "footer": null,
+ "rendering_options": null
+ },
+ "livemode": false,
+ "metadata": {
+ "remote_realm_host": "zulip.testserver",
+ "remote_realm_uuid": "9336fc3f-5b07-49e0-b0d6-5d48cc3e8d67"
+ },
+ "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_1Oc9VWDEQaroqDjs7SBNLNNf",
+ "livemode": false,
+ "object": "event",
+ "pending_webhooks": 0,
+ "request": {
+ "id": "req_XkjWZiJ686kWkg",
+ "idempotency_key": "bcbdbccc-989d-4cf6-b5c7-6480782a75a9"
+ },
+ "type": "customer.updated"
+ }
+ ],
+ "has_more": true,
+ "object": "list",
+ "url": "/v1/events"
+}
diff --git a/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--Event.list.2.json b/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--Event.list.2.json
new file mode 100644
index 00000000000..43173dcefc7
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--Event.list.2.json
@@ -0,0 +1,447 @@
+{
+ "data": [
+ {
+ "api_version": "2020-08-27",
+ "created": 1706114462,
+ "data": {
+ "object": {
+ "amount": 10000,
+ "amount_capturable": 0,
+ "amount_details": {
+ "tip": {}
+ },
+ "amount_received": 10000,
+ "application": null,
+ "application_fee_amount": null,
+ "automatic_payment_methods": null,
+ "canceled_at": null,
+ "cancellation_reason": null,
+ "capture_method": "automatic",
+ "charges": {
+ "data": [
+ {
+ "amount": 10000,
+ "amount_captured": 10000,
+ "amount_refunded": 0,
+ "application": null,
+ "application_fee": null,
+ "application_fee_amount": null,
+ "balance_transaction": "txn_3Oc9VZDEQaroqDjs0obbNta0",
+ "billing_details": {
+ "address": {
+ "city": null,
+ "country": null,
+ "line1": null,
+ "line2": null,
+ "postal_code": null,
+ "state": null
+ },
+ "email": null,
+ "name": null,
+ "phone": null
+ },
+ "calculated_statement_descriptor": "ZULIP BASIC",
+ "captured": true,
+ "created": 1706114462,
+ "currency": "usd",
+ "customer": "cus_PR1YvTbJ32gEOi",
+ "description": "Zulip Basic",
+ "destination": null,
+ "dispute": null,
+ "disputed": false,
+ "failure_balance_transaction": null,
+ "failure_code": null,
+ "failure_message": null,
+ "fraud_details": {},
+ "id": "ch_3Oc9VZDEQaroqDjs0z9dD5Dk",
+ "invoice": null,
+ "livemode": false,
+ "metadata": {
+ "billing_modality": "charge_automatically",
+ "billing_schedule": "2",
+ "fixed_price": "120000",
+ "license_management": "automatic",
+ "licenses": "11",
+ "plan_tier": "103",
+ "remote_realm_host": "zulip.testserver",
+ "remote_realm_user_email": "[email protected]",
+ "remote_realm_user_id": "1",
+ "seat_count": "11",
+ "type": "upgrade"
+ },
+ "object": "charge",
+ "on_behalf_of": null,
+ "order": null,
+ "outcome": {
+ "network_status": "approved_by_network",
+ "reason": null,
+ "risk_level": "normal",
+ "risk_score": 19,
+ "seller_message": "Payment complete.",
+ "type": "authorized"
+ },
+ "paid": true,
+ "payment_intent": "pi_3Oc9VZDEQaroqDjs07YctQyT",
+ "payment_method": "pm_1Oc9VUDEQaroqDjsMvuKOumG",
+ "payment_method_details": {
+ "card": {
+ "amount_authorized": 10000,
+ "brand": "visa",
+ "checks": {
+ "address_line1_check": null,
+ "address_postal_code_check": null,
+ "cvc_check": "pass"
+ },
+ "country": "US",
+ "exp_month": 1,
+ "exp_year": 2025,
+ "extended_authorization": {
+ "status": "disabled"
+ },
+ "fingerprint": "9XKsMixKBi6kIIzd",
+ "funding": "credit",
+ "incremental_authorization": {
+ "status": "unavailable"
+ },
+ "installments": null,
+ "last4": "4242",
+ "mandate": null,
+ "multicapture": {
+ "status": "unavailable"
+ },
+ "network": "visa",
+ "network_token": {
+ "used": false
+ },
+ "overcapture": {
+ "maximum_amount_capturable": 10000,
+ "status": "unavailable"
+ },
+ "three_d_secure": null,
+ "wallet": null
+ },
+ "type": "card"
+ },
+ "radar_options": {},
+ "receipt_email": "[email protected]",
+ "receipt_number": null,
+ "receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xN3ZUa3dERVFhcm9xRGpzKJ_7xK0GMgYUO1lYJis6LBbKM7t6838xlGlvwvUAAYtlP2Lgb-9gOXxKiaTI8A_wMHqGmkPZwd7E9sg4",
+ "refunded": false,
+ "refunds": {
+ "data": [],
+ "has_more": false,
+ "object": "list",
+ "total_count": 0,
+ "url": "/v1/charges/ch_3Oc9VZDEQaroqDjs0z9dD5Dk/refunds"
+ },
+ "review": null,
+ "shipping": null,
+ "source": null,
+ "source_transfer": null,
+ "statement_descriptor": "Zulip Basic",
+ "statement_descriptor_suffix": null,
+ "status": "succeeded",
+ "transfer_data": null,
+ "transfer_group": null
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "total_count": 1,
+ "url": "/v1/charges?payment_intent=pi_3Oc9VZDEQaroqDjs07YctQyT"
+ },
+ "client_secret": "pi_3Oc9VZDEQaroqDjs07YctQyT_secret_qj3BMcQJM1AayAtgV3tZVlNmS",
+ "confirmation_method": "automatic",
+ "created": 1706114461,
+ "currency": "usd",
+ "customer": "cus_PR1YvTbJ32gEOi",
+ "description": "Zulip Basic",
+ "id": "pi_3Oc9VZDEQaroqDjs07YctQyT",
+ "invoice": null,
+ "last_payment_error": null,
+ "latest_charge": "ch_3Oc9VZDEQaroqDjs0z9dD5Dk",
+ "livemode": false,
+ "metadata": {
+ "billing_modality": "charge_automatically",
+ "billing_schedule": "2",
+ "fixed_price": "120000",
+ "license_management": "automatic",
+ "licenses": "11",
+ "plan_tier": "103",
+ "remote_realm_host": "zulip.testserver",
+ "remote_realm_user_email": "[email protected]",
+ "remote_realm_user_id": "1",
+ "seat_count": "11",
+ "type": "upgrade"
+ },
+ "next_action": null,
+ "object": "payment_intent",
+ "on_behalf_of": null,
+ "payment_method": "pm_1Oc9VUDEQaroqDjsMvuKOumG",
+ "payment_method_configuration_details": null,
+ "payment_method_options": {
+ "card": {
+ "installments": null,
+ "mandate_options": null,
+ "network": null,
+ "request_three_d_secure": "automatic"
+ }
+ },
+ "payment_method_types": [
+ "card"
+ ],
+ "processing": null,
+ "receipt_email": "[email protected]",
+ "review": null,
+ "setup_future_usage": null,
+ "shipping": null,
+ "source": null,
+ "statement_descriptor": "Zulip Basic",
+ "statement_descriptor_suffix": null,
+ "status": "succeeded",
+ "transfer_data": null,
+ "transfer_group": null
+ }
+ },
+ "id": "evt_3Oc9VZDEQaroqDjs0kf0GCFf",
+ "livemode": false,
+ "object": "event",
+ "pending_webhooks": 0,
+ "request": {
+ "id": "req_zQcPxkvWeD5hJ8",
+ "idempotency_key": "39ae9d9a-ebf4-455e-9e73-3efef0bf4c48"
+ },
+ "type": "payment_intent.succeeded"
+ },
+ {
+ "api_version": "2020-08-27",
+ "created": 1706114462,
+ "data": {
+ "object": {
+ "amount": 10000,
+ "amount_captured": 10000,
+ "amount_refunded": 0,
+ "application": null,
+ "application_fee": null,
+ "application_fee_amount": null,
+ "balance_transaction": "txn_3Oc9VZDEQaroqDjs0obbNta0",
+ "billing_details": {
+ "address": {
+ "city": null,
+ "country": null,
+ "line1": null,
+ "line2": null,
+ "postal_code": null,
+ "state": null
+ },
+ "email": null,
+ "name": null,
+ "phone": null
+ },
+ "calculated_statement_descriptor": "ZULIP BASIC",
+ "captured": true,
+ "created": 1706114462,
+ "currency": "usd",
+ "customer": "cus_PR1YvTbJ32gEOi",
+ "description": "Zulip Basic",
+ "destination": null,
+ "dispute": null,
+ "disputed": false,
+ "failure_balance_transaction": null,
+ "failure_code": null,
+ "failure_message": null,
+ "fraud_details": {},
+ "id": "ch_3Oc9VZDEQaroqDjs0z9dD5Dk",
+ "invoice": null,
+ "livemode": false,
+ "metadata": {
+ "billing_modality": "charge_automatically",
+ "billing_schedule": "2",
+ "fixed_price": "120000",
+ "license_management": "automatic",
+ "licenses": "11",
+ "plan_tier": "103",
+ "remote_realm_host": "zulip.testserver",
+ "remote_realm_user_email": "[email protected]",
+ "remote_realm_user_id": "1",
+ "seat_count": "11",
+ "type": "upgrade"
+ },
+ "object": "charge",
+ "on_behalf_of": null,
+ "order": null,
+ "outcome": {
+ "network_status": "approved_by_network",
+ "reason": null,
+ "risk_level": "normal",
+ "risk_score": 19,
+ "seller_message": "Payment complete.",
+ "type": "authorized"
+ },
+ "paid": true,
+ "payment_intent": "pi_3Oc9VZDEQaroqDjs07YctQyT",
+ "payment_method": "pm_1Oc9VUDEQaroqDjsMvuKOumG",
+ "payment_method_details": {
+ "card": {
+ "amount_authorized": 10000,
+ "brand": "visa",
+ "checks": {
+ "address_line1_check": null,
+ "address_postal_code_check": null,
+ "cvc_check": "pass"
+ },
+ "country": "US",
+ "exp_month": 1,
+ "exp_year": 2025,
+ "extended_authorization": {
+ "status": "disabled"
+ },
+ "fingerprint": "9XKsMixKBi6kIIzd",
+ "funding": "credit",
+ "incremental_authorization": {
+ "status": "unavailable"
+ },
+ "installments": null,
+ "last4": "4242",
+ "mandate": null,
+ "multicapture": {
+ "status": "unavailable"
+ },
+ "network": "visa",
+ "network_token": {
+ "used": false
+ },
+ "overcapture": {
+ "maximum_amount_capturable": 10000,
+ "status": "unavailable"
+ },
+ "three_d_secure": null,
+ "wallet": null
+ },
+ "type": "card"
+ },
+ "radar_options": {},
+ "receipt_email": "[email protected]",
+ "receipt_number": null,
+ "receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xN3ZUa3dERVFhcm9xRGpzKJ77xK0GMgZxoOfivY06LBaX7Qy-rz2DqlYlCo2C7yCxbMO1TC9FXE4VXuLUav11E_9hknudDYrdcqpS",
+ "refunded": false,
+ "refunds": {
+ "data": [],
+ "has_more": false,
+ "object": "list",
+ "total_count": 0,
+ "url": "/v1/charges/ch_3Oc9VZDEQaroqDjs0z9dD5Dk/refunds"
+ },
+ "review": null,
+ "shipping": null,
+ "source": null,
+ "source_transfer": null,
+ "statement_descriptor": "Zulip Basic",
+ "statement_descriptor_suffix": null,
+ "status": "succeeded",
+ "transfer_data": null,
+ "transfer_group": null
+ }
+ },
+ "id": "evt_3Oc9VZDEQaroqDjs0Rlu6R7B",
+ "livemode": false,
+ "object": "event",
+ "pending_webhooks": 0,
+ "request": {
+ "id": "req_zQcPxkvWeD5hJ8",
+ "idempotency_key": "39ae9d9a-ebf4-455e-9e73-3efef0bf4c48"
+ },
+ "type": "charge.succeeded"
+ },
+ {
+ "api_version": "2020-08-27",
+ "created": 1706114461,
+ "data": {
+ "object": {
+ "amount": 10000,
+ "amount_capturable": 0,
+ "amount_details": {
+ "tip": {}
+ },
+ "amount_received": 0,
+ "application": null,
+ "application_fee_amount": null,
+ "automatic_payment_methods": null,
+ "canceled_at": null,
+ "cancellation_reason": null,
+ "capture_method": "automatic",
+ "charges": {
+ "data": [],
+ "has_more": false,
+ "object": "list",
+ "total_count": 0,
+ "url": "/v1/charges?payment_intent=pi_3Oc9VZDEQaroqDjs07YctQyT"
+ },
+ "client_secret": "pi_3Oc9VZDEQaroqDjs07YctQyT_secret_qj3BMcQJM1AayAtgV3tZVlNmS",
+ "confirmation_method": "automatic",
+ "created": 1706114461,
+ "currency": "usd",
+ "customer": "cus_PR1YvTbJ32gEOi",
+ "description": "Zulip Basic",
+ "id": "pi_3Oc9VZDEQaroqDjs07YctQyT",
+ "invoice": null,
+ "last_payment_error": null,
+ "latest_charge": null,
+ "livemode": false,
+ "metadata": {
+ "billing_modality": "charge_automatically",
+ "billing_schedule": "2",
+ "fixed_price": "120000",
+ "license_management": "automatic",
+ "licenses": "11",
+ "plan_tier": "103",
+ "remote_realm_host": "zulip.testserver",
+ "remote_realm_user_email": "[email protected]",
+ "remote_realm_user_id": "1",
+ "seat_count": "11",
+ "type": "upgrade"
+ },
+ "next_action": null,
+ "object": "payment_intent",
+ "on_behalf_of": null,
+ "payment_method": null,
+ "payment_method_configuration_details": null,
+ "payment_method_options": {
+ "card": {
+ "installments": null,
+ "mandate_options": null,
+ "network": null,
+ "request_three_d_secure": "automatic"
+ }
+ },
+ "payment_method_types": [
+ "card"
+ ],
+ "processing": null,
+ "receipt_email": "[email protected]",
+ "review": null,
+ "setup_future_usage": null,
+ "shipping": null,
+ "source": null,
+ "statement_descriptor": "Zulip Basic",
+ "statement_descriptor_suffix": null,
+ "status": "requires_payment_method",
+ "transfer_data": null,
+ "transfer_group": null
+ }
+ },
+ "id": "evt_3Oc9VZDEQaroqDjs0FBLFsww",
+ "livemode": false,
+ "object": "event",
+ "pending_webhooks": 2,
+ "request": {
+ "id": "req_zQcPxkvWeD5hJ8",
+ "idempotency_key": "39ae9d9a-ebf4-455e-9e73-3efef0bf4c48"
+ },
+ "type": "payment_intent.created"
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "url": "/v1/events"
+}
diff --git a/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--Event.list.3.json b/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--Event.list.3.json
new file mode 100644
index 00000000000..c73839ce49b
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--Event.list.3.json
@@ -0,0 +1,885 @@
+{
+ "data": [
+ {
+ "api_version": "2020-08-27",
+ "created": 1706114465,
+ "data": {
+ "object": {
+ "account_country": "US",
+ "account_name": "Kandra Labs, Inc.",
+ "account_tax_ids": null,
+ "amount_due": 0,
+ "amount_paid": 0,
+ "amount_remaining": 0,
+ "amount_shipping": 0,
+ "application": null,
+ "application_fee_amount": null,
+ "attempt_count": 0,
+ "attempted": true,
+ "auto_advance": false,
+ "automatic_tax": {
+ "enabled": false,
+ "liability": null,
+ "status": null
+ },
+ "billing_reason": "manual",
+ "charge": null,
+ "collection_method": "charge_automatically",
+ "created": 1706114464,
+ "currency": "usd",
+ "custom_fields": null,
+ "customer": "cus_PR1YvTbJ32gEOi",
+ "customer_address": null,
+ "customer_email": "[email protected]",
+ "customer_name": null,
+ "customer_phone": null,
+ "customer_shipping": null,
+ "customer_tax_exempt": "none",
+ "customer_tax_ids": [],
+ "default_payment_method": null,
+ "default_source": null,
+ "default_tax_rates": [],
+ "description": null,
+ "discount": null,
+ "discounts": [],
+ "due_date": null,
+ "effective_at": 1706114465,
+ "ending_balance": 0,
+ "footer": null,
+ "from_invoice": null,
+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_17vTkwDEQaroqDjs/test_YWNjdF8xN3ZUa3dERVFhcm9xRGpzLF9QUjFZNkNLTHJvWEVMR1dxZHh6UFU0T3Q5OXY3TGpILDk2NjU1MjY20200C7P3rMz4?s=ap",
+ "id": "in_1Oc9VcDEQaroqDjs3NCcYxTC",
+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_17vTkwDEQaroqDjs/test_YWNjdF8xN3ZUa3dERVFhcm9xRGpzLF9QUjFZNkNLTHJvWEVMR1dxZHh6UFU0T3Q5OXY3TGpILDk2NjU1MjY20200C7P3rMz4/pdf?s=ap",
+ "issuer": {
+ "type": "self"
+ },
+ "last_finalization_error": null,
+ "latest_revision": null,
+ "lines": {
+ "data": [
+ {
+ "amount": 10000,
+ "amount_excluding_tax": 10000,
+ "currency": "usd",
+ "description": "Zulip Basic",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_1Oc9VcDEQaroqDjsbJMw41Pu",
+ "invoice_item": "ii_1Oc9VcDEQaroqDjsiABCX4PQ",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1328151845,
+ "start": 1325473445
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1706114464,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_1Oc9VcDEQaroqDjs9z5VJret",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_PDUwJ9ZgTQzjad",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": 10000,
+ "unit_amount_decimal": "10000"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "10000"
+ },
+ {
+ "amount": -10000,
+ "amount_excluding_tax": -10000,
+ "currency": "usd",
+ "description": "Payment (Card ending in 4242)",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_1Oc9VcDEQaroqDjsYDRz85xS",
+ "invoice_item": "ii_1Oc9VbDEQaroqDjsoDWMlbXX",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1706114463,
+ "start": 1706114463
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1706114463,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_1Oc9VbDEQaroqDjsoEqVbHwG",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_OvY3hKgN66WIeP",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": -10000,
+ "unit_amount_decimal": "-10000"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "-10000"
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "total_count": 2,
+ "url": "/v1/invoices/in_1Oc9VcDEQaroqDjs3NCcYxTC/lines"
+ },
+ "livemode": false,
+ "metadata": {},
+ "next_payment_attempt": null,
+ "number": "F7CDD9B5-0001",
+ "object": "invoice",
+ "on_behalf_of": null,
+ "paid": true,
+ "paid_out_of_band": false,
+ "payment_intent": null,
+ "payment_settings": {
+ "default_mandate": null,
+ "payment_method_options": null,
+ "payment_method_types": null
+ },
+ "period_end": 1706114464,
+ "period_start": 1706114464,
+ "post_payment_credit_notes_amount": 0,
+ "pre_payment_credit_notes_amount": 0,
+ "quote": null,
+ "receipt_number": null,
+ "rendering": {
+ "amount_tax_display": null,
+ "pdf": {
+ "page_size": "letter"
+ }
+ },
+ "rendering_options": null,
+ "shipping_cost": null,
+ "shipping_details": null,
+ "starting_balance": 0,
+ "statement_descriptor": "Zulip Basic",
+ "status": "paid",
+ "status_transitions": {
+ "finalized_at": 1706114465,
+ "marked_uncollectible_at": null,
+ "paid_at": 1706114465,
+ "voided_at": null
+ },
+ "subscription": null,
+ "subscription_details": {
+ "metadata": null
+ },
+ "subtotal": 0,
+ "subtotal_excluding_tax": 0,
+ "tax": null,
+ "test_clock": null,
+ "total": 0,
+ "total_discount_amounts": [],
+ "total_excluding_tax": 0,
+ "total_tax_amounts": [],
+ "transfer_data": null,
+ "webhooks_delivered_at": 1706114465
+ }
+ },
+ "id": "evt_1Oc9VeDEQaroqDjs2eHRb5yt",
+ "livemode": false,
+ "object": "event",
+ "pending_webhooks": 2,
+ "request": {
+ "id": "req_fy01tkkieoxDzT",
+ "idempotency_key": "00324996-27bc-44e7-bd09-b79741611b92"
+ },
+ "type": "invoice.finalized"
+ },
+ {
+ "api_version": "2020-08-27",
+ "created": 1706114465,
+ "data": {
+ "object": {
+ "account_country": "US",
+ "account_name": "Kandra Labs, Inc.",
+ "account_tax_ids": null,
+ "amount_due": 0,
+ "amount_paid": 0,
+ "amount_remaining": 0,
+ "amount_shipping": 0,
+ "application": null,
+ "application_fee_amount": null,
+ "attempt_count": 0,
+ "attempted": true,
+ "auto_advance": false,
+ "automatic_tax": {
+ "enabled": false,
+ "liability": null,
+ "status": null
+ },
+ "billing_reason": "manual",
+ "charge": null,
+ "collection_method": "charge_automatically",
+ "created": 1706114464,
+ "currency": "usd",
+ "custom_fields": null,
+ "customer": "cus_PR1YvTbJ32gEOi",
+ "customer_address": null,
+ "customer_email": "[email protected]",
+ "customer_name": null,
+ "customer_phone": null,
+ "customer_shipping": null,
+ "customer_tax_exempt": "none",
+ "customer_tax_ids": [],
+ "default_payment_method": null,
+ "default_source": null,
+ "default_tax_rates": [],
+ "description": null,
+ "discount": null,
+ "discounts": [],
+ "due_date": null,
+ "effective_at": 1706114465,
+ "ending_balance": 0,
+ "footer": null,
+ "from_invoice": null,
+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_17vTkwDEQaroqDjs/test_YWNjdF8xN3ZUa3dERVFhcm9xRGpzLF9QUjFZNkNLTHJvWEVMR1dxZHh6UFU0T3Q5OXY3TGpILDk2NjU1MjY20200C7P3rMz4?s=ap",
+ "id": "in_1Oc9VcDEQaroqDjs3NCcYxTC",
+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_17vTkwDEQaroqDjs/test_YWNjdF8xN3ZUa3dERVFhcm9xRGpzLF9QUjFZNkNLTHJvWEVMR1dxZHh6UFU0T3Q5OXY3TGpILDk2NjU1MjY20200C7P3rMz4/pdf?s=ap",
+ "issuer": {
+ "type": "self"
+ },
+ "last_finalization_error": null,
+ "latest_revision": null,
+ "lines": {
+ "data": [
+ {
+ "amount": 10000,
+ "amount_excluding_tax": 10000,
+ "currency": "usd",
+ "description": "Zulip Basic",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_1Oc9VcDEQaroqDjsbJMw41Pu",
+ "invoice_item": "ii_1Oc9VcDEQaroqDjsiABCX4PQ",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1328151845,
+ "start": 1325473445
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1706114464,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_1Oc9VcDEQaroqDjs9z5VJret",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_PDUwJ9ZgTQzjad",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": 10000,
+ "unit_amount_decimal": "10000"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "10000"
+ },
+ {
+ "amount": -10000,
+ "amount_excluding_tax": -10000,
+ "currency": "usd",
+ "description": "Payment (Card ending in 4242)",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_1Oc9VcDEQaroqDjsYDRz85xS",
+ "invoice_item": "ii_1Oc9VbDEQaroqDjsoDWMlbXX",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1706114463,
+ "start": 1706114463
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1706114463,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_1Oc9VbDEQaroqDjsoEqVbHwG",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_OvY3hKgN66WIeP",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": -10000,
+ "unit_amount_decimal": "-10000"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "-10000"
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "total_count": 2,
+ "url": "/v1/invoices/in_1Oc9VcDEQaroqDjs3NCcYxTC/lines"
+ },
+ "livemode": false,
+ "metadata": {},
+ "next_payment_attempt": null,
+ "number": "F7CDD9B5-0001",
+ "object": "invoice",
+ "on_behalf_of": null,
+ "paid": true,
+ "paid_out_of_band": false,
+ "payment_intent": null,
+ "payment_settings": {
+ "default_mandate": null,
+ "payment_method_options": null,
+ "payment_method_types": null
+ },
+ "period_end": 1706114464,
+ "period_start": 1706114464,
+ "post_payment_credit_notes_amount": 0,
+ "pre_payment_credit_notes_amount": 0,
+ "quote": null,
+ "receipt_number": null,
+ "rendering": {
+ "amount_tax_display": null,
+ "pdf": {
+ "page_size": "letter"
+ }
+ },
+ "rendering_options": null,
+ "shipping_cost": null,
+ "shipping_details": null,
+ "starting_balance": 0,
+ "statement_descriptor": "Zulip Basic",
+ "status": "paid",
+ "status_transitions": {
+ "finalized_at": 1706114465,
+ "marked_uncollectible_at": null,
+ "paid_at": 1706114465,
+ "voided_at": null
+ },
+ "subscription": null,
+ "subscription_details": {
+ "metadata": null
+ },
+ "subtotal": 0,
+ "subtotal_excluding_tax": 0,
+ "tax": null,
+ "test_clock": null,
+ "total": 0,
+ "total_discount_amounts": [],
+ "total_excluding_tax": 0,
+ "total_tax_amounts": [],
+ "transfer_data": null,
+ "webhooks_delivered_at": 1706114465
+ },
+ "previous_attributes": {
+ "attempted": false,
+ "auto_advance": true,
+ "effective_at": null,
+ "ending_balance": null,
+ "hosted_invoice_url": null,
+ "invoice_pdf": null,
+ "next_payment_attempt": 1706118064,
+ "number": null,
+ "paid": false,
+ "rendering": {
+ "pdf": {
+ "page_size": "auto"
+ }
+ },
+ "status": "draft",
+ "status_transitions": {
+ "finalized_at": null,
+ "paid_at": null
+ }
+ }
+ },
+ "id": "evt_1Oc9VeDEQaroqDjsUJ4PxyT8",
+ "livemode": false,
+ "object": "event",
+ "pending_webhooks": 0,
+ "request": {
+ "id": "req_fy01tkkieoxDzT",
+ "idempotency_key": "00324996-27bc-44e7-bd09-b79741611b92"
+ },
+ "type": "invoice.updated"
+ },
+ {
+ "api_version": "2020-08-27",
+ "created": 1706114464,
+ "data": {
+ "object": {
+ "account_country": "US",
+ "account_name": "Kandra Labs, Inc.",
+ "account_tax_ids": null,
+ "amount_due": 0,
+ "amount_paid": 0,
+ "amount_remaining": 0,
+ "amount_shipping": 0,
+ "application": null,
+ "application_fee_amount": null,
+ "attempt_count": 0,
+ "attempted": false,
+ "auto_advance": true,
+ "automatic_tax": {
+ "enabled": false,
+ "liability": null,
+ "status": null
+ },
+ "billing_reason": "manual",
+ "charge": null,
+ "collection_method": "charge_automatically",
+ "created": 1706114464,
+ "currency": "usd",
+ "custom_fields": null,
+ "customer": "cus_PR1YvTbJ32gEOi",
+ "customer_address": null,
+ "customer_email": "[email protected]",
+ "customer_name": null,
+ "customer_phone": null,
+ "customer_shipping": null,
+ "customer_tax_exempt": "none",
+ "customer_tax_ids": [],
+ "default_payment_method": null,
+ "default_source": null,
+ "default_tax_rates": [],
+ "description": null,
+ "discount": null,
+ "discounts": [],
+ "due_date": null,
+ "effective_at": null,
+ "ending_balance": null,
+ "footer": null,
+ "from_invoice": null,
+ "hosted_invoice_url": null,
+ "id": "in_1Oc9VcDEQaroqDjs3NCcYxTC",
+ "invoice_pdf": null,
+ "issuer": {
+ "type": "self"
+ },
+ "last_finalization_error": null,
+ "latest_revision": null,
+ "lines": {
+ "data": [
+ {
+ "amount": 10000,
+ "amount_excluding_tax": 10000,
+ "currency": "usd",
+ "description": "Zulip Basic",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_1Oc9VcDEQaroqDjsbJMw41Pu",
+ "invoice_item": "ii_1Oc9VcDEQaroqDjsiABCX4PQ",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1328151845,
+ "start": 1325473445
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1706114464,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_1Oc9VcDEQaroqDjs9z5VJret",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_PDUwJ9ZgTQzjad",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": 10000,
+ "unit_amount_decimal": "10000"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "10000"
+ },
+ {
+ "amount": -10000,
+ "amount_excluding_tax": -10000,
+ "currency": "usd",
+ "description": "Payment (Card ending in 4242)",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_1Oc9VcDEQaroqDjsYDRz85xS",
+ "invoice_item": "ii_1Oc9VbDEQaroqDjsoDWMlbXX",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1706114463,
+ "start": 1706114463
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1706114463,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_1Oc9VbDEQaroqDjsoEqVbHwG",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_OvY3hKgN66WIeP",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": -10000,
+ "unit_amount_decimal": "-10000"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "-10000"
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "total_count": 2,
+ "url": "/v1/invoices/in_1Oc9VcDEQaroqDjs3NCcYxTC/lines"
+ },
+ "livemode": false,
+ "metadata": {},
+ "next_payment_attempt": 1706118064,
+ "number": null,
+ "object": "invoice",
+ "on_behalf_of": null,
+ "paid": false,
+ "paid_out_of_band": false,
+ "payment_intent": null,
+ "payment_settings": {
+ "default_mandate": null,
+ "payment_method_options": null,
+ "payment_method_types": null
+ },
+ "period_end": 1706114464,
+ "period_start": 1706114464,
+ "post_payment_credit_notes_amount": 0,
+ "pre_payment_credit_notes_amount": 0,
+ "quote": null,
+ "receipt_number": null,
+ "rendering": {
+ "amount_tax_display": null,
+ "pdf": {
+ "page_size": "auto"
+ }
+ },
+ "rendering_options": null,
+ "shipping_cost": null,
+ "shipping_details": null,
+ "starting_balance": 0,
+ "statement_descriptor": "Zulip Basic",
+ "status": "draft",
+ "status_transitions": {
+ "finalized_at": null,
+ "marked_uncollectible_at": null,
+ "paid_at": null,
+ "voided_at": null
+ },
+ "subscription": null,
+ "subscription_details": {
+ "metadata": null
+ },
+ "subtotal": 0,
+ "subtotal_excluding_tax": 0,
+ "tax": null,
+ "test_clock": null,
+ "total": 0,
+ "total_discount_amounts": [],
+ "total_excluding_tax": 0,
+ "total_tax_amounts": [],
+ "transfer_data": null,
+ "webhooks_delivered_at": null
+ }
+ },
+ "id": "evt_1Oc9VdDEQaroqDjsoHu7eP8h",
+ "livemode": false,
+ "object": "event",
+ "pending_webhooks": 0,
+ "request": {
+ "id": "req_vk9spDkPoAbf9G",
+ "idempotency_key": "63989158-272e-4ee8-8709-d525844594a6"
+ },
+ "type": "invoice.created"
+ },
+ {
+ "api_version": "2020-08-27",
+ "created": 1706114464,
+ "data": {
+ "object": {
+ "amount": 10000,
+ "currency": "usd",
+ "customer": "cus_PR1YvTbJ32gEOi",
+ "date": 1706114464,
+ "description": "Zulip Basic",
+ "discountable": false,
+ "discounts": [],
+ "id": "ii_1Oc9VcDEQaroqDjsiABCX4PQ",
+ "invoice": null,
+ "livemode": false,
+ "metadata": {},
+ "object": "invoiceitem",
+ "period": {
+ "end": 1328151845,
+ "start": 1325473445
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1706114464,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_1Oc9VcDEQaroqDjs9z5VJret",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_PDUwJ9ZgTQzjad",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": 10000,
+ "unit_amount_decimal": "10000"
+ },
+ "proration": false,
+ "quantity": 1,
+ "subscription": null,
+ "tax_rates": [],
+ "test_clock": null,
+ "unit_amount": 10000,
+ "unit_amount_decimal": "10000"
+ }
+ },
+ "id": "evt_1Oc9VcDEQaroqDjsiRPGERW9",
+ "livemode": false,
+ "object": "event",
+ "pending_webhooks": 0,
+ "request": {
+ "id": "req_y62EK3tVwy8A2u",
+ "idempotency_key": "57912576-64f4-4048-8af2-c0d0f98b2c13"
+ },
+ "type": "invoiceitem.created"
+ },
+ {
+ "api_version": "2020-08-27",
+ "created": 1706114463,
+ "data": {
+ "object": {
+ "amount": -10000,
+ "currency": "usd",
+ "customer": "cus_PR1YvTbJ32gEOi",
+ "date": 1706114463,
+ "description": "Payment (Card ending in 4242)",
+ "discountable": false,
+ "discounts": [],
+ "id": "ii_1Oc9VbDEQaroqDjsoDWMlbXX",
+ "invoice": null,
+ "livemode": false,
+ "metadata": {},
+ "object": "invoiceitem",
+ "period": {
+ "end": 1706114463,
+ "start": 1706114463
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1706114463,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_1Oc9VbDEQaroqDjsoEqVbHwG",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_OvY3hKgN66WIeP",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": -10000,
+ "unit_amount_decimal": "-10000"
+ },
+ "proration": false,
+ "quantity": 1,
+ "subscription": null,
+ "tax_rates": [],
+ "test_clock": null,
+ "unit_amount": -10000,
+ "unit_amount_decimal": "-10000"
+ }
+ },
+ "id": "evt_1Oc9VcDEQaroqDjsLEpfCZlg",
+ "livemode": false,
+ "object": "event",
+ "pending_webhooks": 0,
+ "request": {
+ "id": "req_C1POIuA0kOOk0n",
+ "idempotency_key": "268fd6f8-451b-4016-80e6-b0acbcf7b010"
+ },
+ "type": "invoiceitem.created"
+ },
+ {
+ "api_version": "2020-08-27",
+ "created": 1706114463,
+ "data": {
+ "object": {
+ "address": null,
+ "balance": 0,
+ "created": 1706114454,
+ "currency": "usd",
+ "default_currency": "usd",
+ "default_source": null,
+ "delinquent": false,
+ "description": "zulip.testserver 9336fc3f-5b0",
+ "discount": null,
+ "email": "[email protected]",
+ "id": "cus_PR1YvTbJ32gEOi",
+ "invoice_prefix": "F7CDD9B5",
+ "invoice_settings": {
+ "custom_fields": null,
+ "default_payment_method": "pm_1Oc9VUDEQaroqDjsMvuKOumG",
+ "footer": null,
+ "rendering_options": null
+ },
+ "livemode": false,
+ "metadata": {
+ "remote_realm_host": "zulip.testserver",
+ "remote_realm_uuid": "9336fc3f-5b07-49e0-b0d6-5d48cc3e8d67"
+ },
+ "name": null,
+ "next_invoice_sequence": 1,
+ "object": "customer",
+ "phone": null,
+ "preferred_locales": [],
+ "shipping": null,
+ "tax_exempt": "none",
+ "test_clock": null
+ },
+ "previous_attributes": {
+ "currency": null,
+ "default_currency": null
+ }
+ },
+ "id": "evt_1Oc9VbDEQaroqDjsYvqLFNbv",
+ "livemode": false,
+ "object": "event",
+ "pending_webhooks": 0,
+ "request": {
+ "id": "req_C1POIuA0kOOk0n",
+ "idempotency_key": "268fd6f8-451b-4016-80e6-b0acbcf7b010"
+ },
+ "type": "customer.updated"
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "url": "/v1/events"
+}
diff --git a/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--Event.list.4.json b/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--Event.list.4.json
new file mode 100644
index 00000000000..38ffc0b3fc6
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--Event.list.4.json
@@ -0,0 +1,461 @@
+{
+ "data": [
+ {
+ "api_version": "2020-08-27",
+ "created": 1706114465,
+ "data": {
+ "object": {
+ "account_country": "US",
+ "account_name": "Kandra Labs, Inc.",
+ "account_tax_ids": null,
+ "amount_due": 0,
+ "amount_paid": 0,
+ "amount_remaining": 0,
+ "amount_shipping": 0,
+ "application": null,
+ "application_fee_amount": null,
+ "attempt_count": 0,
+ "attempted": true,
+ "auto_advance": false,
+ "automatic_tax": {
+ "enabled": false,
+ "liability": null,
+ "status": null
+ },
+ "billing_reason": "manual",
+ "charge": null,
+ "collection_method": "charge_automatically",
+ "created": 1706114464,
+ "currency": "usd",
+ "custom_fields": null,
+ "customer": "cus_PR1YvTbJ32gEOi",
+ "customer_address": null,
+ "customer_email": "[email protected]",
+ "customer_name": null,
+ "customer_phone": null,
+ "customer_shipping": null,
+ "customer_tax_exempt": "none",
+ "customer_tax_ids": [],
+ "default_payment_method": null,
+ "default_source": null,
+ "default_tax_rates": [],
+ "description": null,
+ "discount": null,
+ "discounts": [],
+ "due_date": null,
+ "effective_at": 1706114465,
+ "ending_balance": 0,
+ "footer": null,
+ "from_invoice": null,
+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_17vTkwDEQaroqDjs/test_YWNjdF8xN3ZUa3dERVFhcm9xRGpzLF9QUjFZNkNLTHJvWEVMR1dxZHh6UFU0T3Q5OXY3TGpILDk2NjU1MjY20200C7P3rMz4?s=ap",
+ "id": "in_1Oc9VcDEQaroqDjs3NCcYxTC",
+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_17vTkwDEQaroqDjs/test_YWNjdF8xN3ZUa3dERVFhcm9xRGpzLF9QUjFZNkNLTHJvWEVMR1dxZHh6UFU0T3Q5OXY3TGpILDk2NjU1MjY20200C7P3rMz4/pdf?s=ap",
+ "issuer": {
+ "type": "self"
+ },
+ "last_finalization_error": null,
+ "latest_revision": null,
+ "lines": {
+ "data": [
+ {
+ "amount": 10000,
+ "amount_excluding_tax": 10000,
+ "currency": "usd",
+ "description": "Zulip Basic",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_1Oc9VcDEQaroqDjsbJMw41Pu",
+ "invoice_item": "ii_1Oc9VcDEQaroqDjsiABCX4PQ",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1328151845,
+ "start": 1325473445
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1706114464,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_1Oc9VcDEQaroqDjs9z5VJret",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_PDUwJ9ZgTQzjad",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": 10000,
+ "unit_amount_decimal": "10000"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "10000"
+ },
+ {
+ "amount": -10000,
+ "amount_excluding_tax": -10000,
+ "currency": "usd",
+ "description": "Payment (Card ending in 4242)",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_1Oc9VcDEQaroqDjsYDRz85xS",
+ "invoice_item": "ii_1Oc9VbDEQaroqDjsoDWMlbXX",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1706114463,
+ "start": 1706114463
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1706114463,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_1Oc9VbDEQaroqDjsoEqVbHwG",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_OvY3hKgN66WIeP",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": -10000,
+ "unit_amount_decimal": "-10000"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "-10000"
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "total_count": 2,
+ "url": "/v1/invoices/in_1Oc9VcDEQaroqDjs3NCcYxTC/lines"
+ },
+ "livemode": false,
+ "metadata": {},
+ "next_payment_attempt": null,
+ "number": "F7CDD9B5-0001",
+ "object": "invoice",
+ "on_behalf_of": null,
+ "paid": true,
+ "paid_out_of_band": false,
+ "payment_intent": null,
+ "payment_settings": {
+ "default_mandate": null,
+ "payment_method_options": null,
+ "payment_method_types": null
+ },
+ "period_end": 1706114464,
+ "period_start": 1706114464,
+ "post_payment_credit_notes_amount": 0,
+ "pre_payment_credit_notes_amount": 0,
+ "quote": null,
+ "receipt_number": null,
+ "rendering": {
+ "amount_tax_display": null,
+ "pdf": {
+ "page_size": "letter"
+ }
+ },
+ "rendering_options": null,
+ "shipping_cost": null,
+ "shipping_details": null,
+ "starting_balance": 0,
+ "statement_descriptor": "Zulip Basic",
+ "status": "paid",
+ "status_transitions": {
+ "finalized_at": 1706114465,
+ "marked_uncollectible_at": null,
+ "paid_at": 1706114465,
+ "voided_at": null
+ },
+ "subscription": null,
+ "subscription_details": {
+ "metadata": null
+ },
+ "subtotal": 0,
+ "subtotal_excluding_tax": 0,
+ "tax": null,
+ "test_clock": null,
+ "total": 0,
+ "total_discount_amounts": [],
+ "total_excluding_tax": 0,
+ "total_tax_amounts": [],
+ "transfer_data": null,
+ "webhooks_delivered_at": 1706114465
+ }
+ },
+ "id": "evt_1Oc9VeDEQaroqDjs6rWkamBJ",
+ "livemode": false,
+ "object": "event",
+ "pending_webhooks": 2,
+ "request": {
+ "id": "req_fy01tkkieoxDzT",
+ "idempotency_key": "00324996-27bc-44e7-bd09-b79741611b92"
+ },
+ "type": "invoice.payment_succeeded"
+ },
+ {
+ "api_version": "2020-08-27",
+ "created": 1706114465,
+ "data": {
+ "object": {
+ "account_country": "US",
+ "account_name": "Kandra Labs, Inc.",
+ "account_tax_ids": null,
+ "amount_due": 0,
+ "amount_paid": 0,
+ "amount_remaining": 0,
+ "amount_shipping": 0,
+ "application": null,
+ "application_fee_amount": null,
+ "attempt_count": 0,
+ "attempted": true,
+ "auto_advance": false,
+ "automatic_tax": {
+ "enabled": false,
+ "liability": null,
+ "status": null
+ },
+ "billing_reason": "manual",
+ "charge": null,
+ "collection_method": "charge_automatically",
+ "created": 1706114464,
+ "currency": "usd",
+ "custom_fields": null,
+ "customer": "cus_PR1YvTbJ32gEOi",
+ "customer_address": null,
+ "customer_email": "[email protected]",
+ "customer_name": null,
+ "customer_phone": null,
+ "customer_shipping": null,
+ "customer_tax_exempt": "none",
+ "customer_tax_ids": [],
+ "default_payment_method": null,
+ "default_source": null,
+ "default_tax_rates": [],
+ "description": null,
+ "discount": null,
+ "discounts": [],
+ "due_date": null,
+ "effective_at": 1706114465,
+ "ending_balance": 0,
+ "footer": null,
+ "from_invoice": null,
+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_17vTkwDEQaroqDjs/test_YWNjdF8xN3ZUa3dERVFhcm9xRGpzLF9QUjFZNkNLTHJvWEVMR1dxZHh6UFU0T3Q5OXY3TGpILDk2NjU1MjY20200C7P3rMz4?s=ap",
+ "id": "in_1Oc9VcDEQaroqDjs3NCcYxTC",
+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_17vTkwDEQaroqDjs/test_YWNjdF8xN3ZUa3dERVFhcm9xRGpzLF9QUjFZNkNLTHJvWEVMR1dxZHh6UFU0T3Q5OXY3TGpILDk2NjU1MjY20200C7P3rMz4/pdf?s=ap",
+ "issuer": {
+ "type": "self"
+ },
+ "last_finalization_error": null,
+ "latest_revision": null,
+ "lines": {
+ "data": [
+ {
+ "amount": 10000,
+ "amount_excluding_tax": 10000,
+ "currency": "usd",
+ "description": "Zulip Basic",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_1Oc9VcDEQaroqDjsbJMw41Pu",
+ "invoice_item": "ii_1Oc9VcDEQaroqDjsiABCX4PQ",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1328151845,
+ "start": 1325473445
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1706114464,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_1Oc9VcDEQaroqDjs9z5VJret",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_PDUwJ9ZgTQzjad",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": 10000,
+ "unit_amount_decimal": "10000"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "10000"
+ },
+ {
+ "amount": -10000,
+ "amount_excluding_tax": -10000,
+ "currency": "usd",
+ "description": "Payment (Card ending in 4242)",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_1Oc9VcDEQaroqDjsYDRz85xS",
+ "invoice_item": "ii_1Oc9VbDEQaroqDjsoDWMlbXX",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1706114463,
+ "start": 1706114463
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1706114463,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_1Oc9VbDEQaroqDjsoEqVbHwG",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_OvY3hKgN66WIeP",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": -10000,
+ "unit_amount_decimal": "-10000"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "-10000"
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "total_count": 2,
+ "url": "/v1/invoices/in_1Oc9VcDEQaroqDjs3NCcYxTC/lines"
+ },
+ "livemode": false,
+ "metadata": {},
+ "next_payment_attempt": null,
+ "number": "F7CDD9B5-0001",
+ "object": "invoice",
+ "on_behalf_of": null,
+ "paid": true,
+ "paid_out_of_band": false,
+ "payment_intent": null,
+ "payment_settings": {
+ "default_mandate": null,
+ "payment_method_options": null,
+ "payment_method_types": null
+ },
+ "period_end": 1706114464,
+ "period_start": 1706114464,
+ "post_payment_credit_notes_amount": 0,
+ "pre_payment_credit_notes_amount": 0,
+ "quote": null,
+ "receipt_number": null,
+ "rendering": {
+ "amount_tax_display": null,
+ "pdf": {
+ "page_size": "letter"
+ }
+ },
+ "rendering_options": null,
+ "shipping_cost": null,
+ "shipping_details": null,
+ "starting_balance": 0,
+ "statement_descriptor": "Zulip Basic",
+ "status": "paid",
+ "status_transitions": {
+ "finalized_at": 1706114465,
+ "marked_uncollectible_at": null,
+ "paid_at": 1706114465,
+ "voided_at": null
+ },
+ "subscription": null,
+ "subscription_details": {
+ "metadata": null
+ },
+ "subtotal": 0,
+ "subtotal_excluding_tax": 0,
+ "tax": null,
+ "test_clock": null,
+ "total": 0,
+ "total_discount_amounts": [],
+ "total_excluding_tax": 0,
+ "total_tax_amounts": [],
+ "transfer_data": null,
+ "webhooks_delivered_at": 1706114465
+ }
+ },
+ "id": "evt_1Oc9VeDEQaroqDjsv7782npd",
+ "livemode": false,
+ "object": "event",
+ "pending_webhooks": 0,
+ "request": {
+ "id": "req_fy01tkkieoxDzT",
+ "idempotency_key": "00324996-27bc-44e7-bd09-b79741611b92"
+ },
+ "type": "invoice.paid"
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "url": "/v1/events"
+}
diff --git a/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--Event.list.5.json b/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--Event.list.5.json
new file mode 100644
index 00000000000..6d922067afe
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--Event.list.5.json
@@ -0,0 +1,6 @@
+{
+ "data": [],
+ "has_more": false,
+ "object": "list",
+ "url": "/v1/events"
+}
diff --git a/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--Invoice.create.1.json b/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--Invoice.create.1.json
new file mode 100644
index 00000000000..fcfc52784f1
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--Invoice.create.1.json
@@ -0,0 +1,212 @@
+{
+ "account_country": "US",
+ "account_name": "Kandra Labs, Inc.",
+ "account_tax_ids": null,
+ "amount_due": 0,
+ "amount_paid": 0,
+ "amount_remaining": 0,
+ "amount_shipping": 0,
+ "application": null,
+ "application_fee_amount": null,
+ "attempt_count": 0,
+ "attempted": false,
+ "auto_advance": true,
+ "automatic_tax": {
+ "enabled": false,
+ "liability": null,
+ "status": null
+ },
+ "billing_reason": "manual",
+ "charge": null,
+ "collection_method": "charge_automatically",
+ "created": 1706114464,
+ "currency": "usd",
+ "custom_fields": null,
+ "customer": "cus_PR1YvTbJ32gEOi",
+ "customer_address": null,
+ "customer_email": "[email protected]",
+ "customer_name": null,
+ "customer_phone": null,
+ "customer_shipping": null,
+ "customer_tax_exempt": "none",
+ "customer_tax_ids": [],
+ "default_payment_method": null,
+ "default_source": null,
+ "default_tax_rates": [],
+ "description": null,
+ "discount": null,
+ "discounts": [],
+ "due_date": null,
+ "effective_at": null,
+ "ending_balance": null,
+ "footer": null,
+ "from_invoice": null,
+ "hosted_invoice_url": null,
+ "id": "in_1Oc9VcDEQaroqDjs3NCcYxTC",
+ "invoice_pdf": null,
+ "issuer": {
+ "type": "self"
+ },
+ "last_finalization_error": null,
+ "latest_revision": null,
+ "lines": {
+ "data": [
+ {
+ "amount": 10000,
+ "amount_excluding_tax": 10000,
+ "currency": "usd",
+ "description": "Zulip Basic",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_1Oc9VcDEQaroqDjsbJMw41Pu",
+ "invoice_item": "ii_1Oc9VcDEQaroqDjsiABCX4PQ",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1328151845,
+ "start": 1325473445
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1706114464,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_1Oc9VcDEQaroqDjs9z5VJret",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_PDUwJ9ZgTQzjad",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": 10000,
+ "unit_amount_decimal": "10000"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "10000"
+ },
+ {
+ "amount": -10000,
+ "amount_excluding_tax": -10000,
+ "currency": "usd",
+ "description": "Payment (Card ending in 4242)",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_1Oc9VcDEQaroqDjsYDRz85xS",
+ "invoice_item": "ii_1Oc9VbDEQaroqDjsoDWMlbXX",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1706114463,
+ "start": 1706114463
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1706114463,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_1Oc9VbDEQaroqDjsoEqVbHwG",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_OvY3hKgN66WIeP",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": -10000,
+ "unit_amount_decimal": "-10000"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "-10000"
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "total_count": 2,
+ "url": "/v1/invoices/in_1Oc9VcDEQaroqDjs3NCcYxTC/lines"
+ },
+ "livemode": false,
+ "metadata": {},
+ "next_payment_attempt": 1706118064,
+ "number": null,
+ "object": "invoice",
+ "on_behalf_of": null,
+ "paid": false,
+ "paid_out_of_band": false,
+ "payment_intent": null,
+ "payment_settings": {
+ "default_mandate": null,
+ "payment_method_options": null,
+ "payment_method_types": null
+ },
+ "period_end": 1706114464,
+ "period_start": 1706114464,
+ "post_payment_credit_notes_amount": 0,
+ "pre_payment_credit_notes_amount": 0,
+ "quote": null,
+ "receipt_number": null,
+ "rendering": {
+ "amount_tax_display": null,
+ "pdf": {
+ "page_size": "auto"
+ }
+ },
+ "rendering_options": null,
+ "shipping_cost": null,
+ "shipping_details": null,
+ "starting_balance": 0,
+ "statement_descriptor": "Zulip Basic",
+ "status": "draft",
+ "status_transitions": {
+ "finalized_at": null,
+ "marked_uncollectible_at": null,
+ "paid_at": null,
+ "voided_at": null
+ },
+ "subscription": null,
+ "subscription_details": {
+ "metadata": null
+ },
+ "subtotal": 0,
+ "subtotal_excluding_tax": 0,
+ "tax": null,
+ "test_clock": null,
+ "total": 0,
+ "total_discount_amounts": [],
+ "total_excluding_tax": 0,
+ "total_tax_amounts": [],
+ "transfer_data": null,
+ "webhooks_delivered_at": null
+}
diff --git a/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--Invoice.finalize_invoice.1.json b/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--Invoice.finalize_invoice.1.json
new file mode 100644
index 00000000000..116b1e150ba
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--Invoice.finalize_invoice.1.json
@@ -0,0 +1,212 @@
+{
+ "account_country": "US",
+ "account_name": "Kandra Labs, Inc.",
+ "account_tax_ids": null,
+ "amount_due": 0,
+ "amount_paid": 0,
+ "amount_remaining": 0,
+ "amount_shipping": 0,
+ "application": null,
+ "application_fee_amount": null,
+ "attempt_count": 0,
+ "attempted": true,
+ "auto_advance": false,
+ "automatic_tax": {
+ "enabled": false,
+ "liability": null,
+ "status": null
+ },
+ "billing_reason": "manual",
+ "charge": null,
+ "collection_method": "charge_automatically",
+ "created": 1706114464,
+ "currency": "usd",
+ "custom_fields": null,
+ "customer": "cus_PR1YvTbJ32gEOi",
+ "customer_address": null,
+ "customer_email": "[email protected]",
+ "customer_name": null,
+ "customer_phone": null,
+ "customer_shipping": null,
+ "customer_tax_exempt": "none",
+ "customer_tax_ids": [],
+ "default_payment_method": null,
+ "default_source": null,
+ "default_tax_rates": [],
+ "description": null,
+ "discount": null,
+ "discounts": [],
+ "due_date": null,
+ "effective_at": 1706114465,
+ "ending_balance": 0,
+ "footer": null,
+ "from_invoice": null,
+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_17vTkwDEQaroqDjs/test_YWNjdF8xN3ZUa3dERVFhcm9xRGpzLF9QUjFZNkNLTHJvWEVMR1dxZHh6UFU0T3Q5OXY3TGpILDk2NjU1MjY102007qSGtg1Y?s=ap",
+ "id": "in_1Oc9VcDEQaroqDjs3NCcYxTC",
+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_17vTkwDEQaroqDjs/test_YWNjdF8xN3ZUa3dERVFhcm9xRGpzLF9QUjFZNkNLTHJvWEVMR1dxZHh6UFU0T3Q5OXY3TGpILDk2NjU1MjY102007qSGtg1Y/pdf?s=ap",
+ "issuer": {
+ "type": "self"
+ },
+ "last_finalization_error": null,
+ "latest_revision": null,
+ "lines": {
+ "data": [
+ {
+ "amount": 10000,
+ "amount_excluding_tax": 10000,
+ "currency": "usd",
+ "description": "Zulip Basic",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_1Oc9VcDEQaroqDjsbJMw41Pu",
+ "invoice_item": "ii_1Oc9VcDEQaroqDjsiABCX4PQ",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1328151845,
+ "start": 1325473445
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1706114464,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_1Oc9VcDEQaroqDjs9z5VJret",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_PDUwJ9ZgTQzjad",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": 10000,
+ "unit_amount_decimal": "10000"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "10000"
+ },
+ {
+ "amount": -10000,
+ "amount_excluding_tax": -10000,
+ "currency": "usd",
+ "description": "Payment (Card ending in 4242)",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_1Oc9VcDEQaroqDjsYDRz85xS",
+ "invoice_item": "ii_1Oc9VbDEQaroqDjsoDWMlbXX",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1706114463,
+ "start": 1706114463
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1706114463,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_1Oc9VbDEQaroqDjsoEqVbHwG",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_OvY3hKgN66WIeP",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": -10000,
+ "unit_amount_decimal": "-10000"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "-10000"
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "total_count": 2,
+ "url": "/v1/invoices/in_1Oc9VcDEQaroqDjs3NCcYxTC/lines"
+ },
+ "livemode": false,
+ "metadata": {},
+ "next_payment_attempt": null,
+ "number": "F7CDD9B5-0001",
+ "object": "invoice",
+ "on_behalf_of": null,
+ "paid": true,
+ "paid_out_of_band": false,
+ "payment_intent": null,
+ "payment_settings": {
+ "default_mandate": null,
+ "payment_method_options": null,
+ "payment_method_types": null
+ },
+ "period_end": 1706114464,
+ "period_start": 1706114464,
+ "post_payment_credit_notes_amount": 0,
+ "pre_payment_credit_notes_amount": 0,
+ "quote": null,
+ "receipt_number": null,
+ "rendering": {
+ "amount_tax_display": null,
+ "pdf": {
+ "page_size": "letter"
+ }
+ },
+ "rendering_options": null,
+ "shipping_cost": null,
+ "shipping_details": null,
+ "starting_balance": 0,
+ "statement_descriptor": "Zulip Basic",
+ "status": "paid",
+ "status_transitions": {
+ "finalized_at": 1706114465,
+ "marked_uncollectible_at": null,
+ "paid_at": 1706114465,
+ "voided_at": null
+ },
+ "subscription": null,
+ "subscription_details": {
+ "metadata": null
+ },
+ "subtotal": 0,
+ "subtotal_excluding_tax": 0,
+ "tax": null,
+ "test_clock": null,
+ "total": 0,
+ "total_discount_amounts": [],
+ "total_excluding_tax": 0,
+ "total_tax_amounts": [],
+ "transfer_data": null,
+ "webhooks_delivered_at": 1706114465
+}
diff --git a/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--Invoice.list.1.json b/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--Invoice.list.1.json
new file mode 100644
index 00000000000..e39960ab725
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--Invoice.list.1.json
@@ -0,0 +1,6 @@
+{
+ "data": [],
+ "has_more": false,
+ "object": "list",
+ "url": "/v1/invoices"
+}
diff --git a/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--InvoiceItem.create.1.json b/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--InvoiceItem.create.1.json
new file mode 100644
index 00000000000..dad6b2fed43
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--InvoiceItem.create.1.json
@@ -0,0 +1,47 @@
+{
+ "amount": -10000,
+ "currency": "usd",
+ "customer": "cus_PR1YvTbJ32gEOi",
+ "date": 1706114463,
+ "description": "Payment (Card ending in 4242)",
+ "discountable": false,
+ "discounts": [],
+ "id": "ii_1Oc9VbDEQaroqDjsoDWMlbXX",
+ "invoice": null,
+ "livemode": false,
+ "metadata": {},
+ "object": "invoiceitem",
+ "period": {
+ "end": 1706114463,
+ "start": 1706114463
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1706114463,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_1Oc9VbDEQaroqDjsoEqVbHwG",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_OvY3hKgN66WIeP",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": -10000,
+ "unit_amount_decimal": "-10000"
+ },
+ "proration": false,
+ "quantity": 1,
+ "subscription": null,
+ "tax_rates": [],
+ "test_clock": null,
+ "unit_amount": -10000,
+ "unit_amount_decimal": "-10000"
+}
diff --git a/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--InvoiceItem.create.2.json b/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--InvoiceItem.create.2.json
new file mode 100644
index 00000000000..3b2daca5197
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--InvoiceItem.create.2.json
@@ -0,0 +1,47 @@
+{
+ "amount": 10000,
+ "currency": "usd",
+ "customer": "cus_PR1YvTbJ32gEOi",
+ "date": 1706114464,
+ "description": "Zulip Basic",
+ "discountable": false,
+ "discounts": [],
+ "id": "ii_1Oc9VcDEQaroqDjsiABCX4PQ",
+ "invoice": null,
+ "livemode": false,
+ "metadata": {},
+ "object": "invoiceitem",
+ "period": {
+ "end": 1328151845,
+ "start": 1325473445
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1706114464,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_1Oc9VcDEQaroqDjs9z5VJret",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_PDUwJ9ZgTQzjad",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": 10000,
+ "unit_amount_decimal": "10000"
+ },
+ "proration": false,
+ "quantity": 1,
+ "subscription": null,
+ "tax_rates": [],
+ "test_clock": null,
+ "unit_amount": 10000,
+ "unit_amount_decimal": "10000"
+}
diff --git a/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--PaymentIntent.create.1.json b/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--PaymentIntent.create.1.json
new file mode 100644
index 00000000000..b726dd7a23e
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--PaymentIntent.create.1.json
@@ -0,0 +1,198 @@
+{
+ "amount": 10000,
+ "amount_capturable": 0,
+ "amount_details": {
+ "tip": {}
+ },
+ "amount_received": 10000,
+ "application": null,
+ "application_fee_amount": null,
+ "automatic_payment_methods": null,
+ "canceled_at": null,
+ "cancellation_reason": null,
+ "capture_method": "automatic",
+ "charges": {
+ "data": [
+ {
+ "amount": 10000,
+ "amount_captured": 10000,
+ "amount_refunded": 0,
+ "application": null,
+ "application_fee": null,
+ "application_fee_amount": null,
+ "balance_transaction": "txn_3Oc9VZDEQaroqDjs0obbNta0",
+ "billing_details": {
+ "address": {
+ "city": null,
+ "country": null,
+ "line1": null,
+ "line2": null,
+ "postal_code": null,
+ "state": null
+ },
+ "email": null,
+ "name": null,
+ "phone": null
+ },
+ "calculated_statement_descriptor": "ZULIP BASIC",
+ "captured": true,
+ "created": 1706114462,
+ "currency": "usd",
+ "customer": "cus_PR1YvTbJ32gEOi",
+ "description": "Zulip Basic",
+ "destination": null,
+ "dispute": null,
+ "disputed": false,
+ "failure_balance_transaction": null,
+ "failure_code": null,
+ "failure_message": null,
+ "fraud_details": {},
+ "id": "ch_3Oc9VZDEQaroqDjs0z9dD5Dk",
+ "invoice": null,
+ "livemode": false,
+ "metadata": {
+ "billing_modality": "charge_automatically",
+ "billing_schedule": "2",
+ "fixed_price": "120000",
+ "license_management": "automatic",
+ "licenses": "11",
+ "plan_tier": "103",
+ "remote_realm_host": "zulip.testserver",
+ "remote_realm_user_email": "[email protected]",
+ "remote_realm_user_id": "1",
+ "seat_count": "11",
+ "type": "upgrade"
+ },
+ "object": "charge",
+ "on_behalf_of": null,
+ "order": null,
+ "outcome": {
+ "network_status": "approved_by_network",
+ "reason": null,
+ "risk_level": "normal",
+ "risk_score": 19,
+ "seller_message": "Payment complete.",
+ "type": "authorized"
+ },
+ "paid": true,
+ "payment_intent": "pi_3Oc9VZDEQaroqDjs07YctQyT",
+ "payment_method": "pm_1Oc9VUDEQaroqDjsMvuKOumG",
+ "payment_method_details": {
+ "card": {
+ "amount_authorized": 10000,
+ "brand": "visa",
+ "checks": {
+ "address_line1_check": null,
+ "address_postal_code_check": null,
+ "cvc_check": "pass"
+ },
+ "country": "US",
+ "exp_month": 1,
+ "exp_year": 2025,
+ "extended_authorization": {
+ "status": "disabled"
+ },
+ "fingerprint": "9XKsMixKBi6kIIzd",
+ "funding": "credit",
+ "incremental_authorization": {
+ "status": "unavailable"
+ },
+ "installments": null,
+ "last4": "4242",
+ "mandate": null,
+ "multicapture": {
+ "status": "unavailable"
+ },
+ "network": "visa",
+ "network_token": {
+ "used": false
+ },
+ "overcapture": {
+ "maximum_amount_capturable": 10000,
+ "status": "unavailable"
+ },
+ "three_d_secure": null,
+ "wallet": null
+ },
+ "type": "card"
+ },
+ "radar_options": {},
+ "receipt_email": "[email protected]",
+ "receipt_number": null,
+ "receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xN3ZUa3dERVFhcm9xRGpzKJ77xK0GMgaImJupuMo6LBY_R4B1IE9Hkau8cvPK0DUbZM27wUb4yo-dfO43Goi7z9-kkG9EEUupn1K9",
+ "refunded": false,
+ "refunds": {
+ "data": [],
+ "has_more": false,
+ "object": "list",
+ "total_count": 0,
+ "url": "/v1/charges/ch_3Oc9VZDEQaroqDjs0z9dD5Dk/refunds"
+ },
+ "review": null,
+ "shipping": null,
+ "source": null,
+ "source_transfer": null,
+ "statement_descriptor": "Zulip Basic",
+ "statement_descriptor_suffix": null,
+ "status": "succeeded",
+ "transfer_data": null,
+ "transfer_group": null
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "total_count": 1,
+ "url": "/v1/charges?payment_intent=pi_3Oc9VZDEQaroqDjs07YctQyT"
+ },
+ "client_secret": "pi_3Oc9VZDEQaroqDjs07YctQyT_secret_qj3BMcQJM1AayAtgV3tZVlNmS",
+ "confirmation_method": "automatic",
+ "created": 1706114461,
+ "currency": "usd",
+ "customer": "cus_PR1YvTbJ32gEOi",
+ "description": "Zulip Basic",
+ "id": "pi_3Oc9VZDEQaroqDjs07YctQyT",
+ "invoice": null,
+ "last_payment_error": null,
+ "latest_charge": "ch_3Oc9VZDEQaroqDjs0z9dD5Dk",
+ "livemode": false,
+ "metadata": {
+ "billing_modality": "charge_automatically",
+ "billing_schedule": "2",
+ "fixed_price": "120000",
+ "license_management": "automatic",
+ "licenses": "11",
+ "plan_tier": "103",
+ "remote_realm_host": "zulip.testserver",
+ "remote_realm_user_email": "[email protected]",
+ "remote_realm_user_id": "1",
+ "seat_count": "11",
+ "type": "upgrade"
+ },
+ "next_action": null,
+ "object": "payment_intent",
+ "on_behalf_of": null,
+ "payment_method": "pm_1Oc9VUDEQaroqDjsMvuKOumG",
+ "payment_method_configuration_details": null,
+ "payment_method_options": {
+ "card": {
+ "installments": null,
+ "mandate_options": null,
+ "network": null,
+ "request_three_d_secure": "automatic"
+ }
+ },
+ "payment_method_types": [
+ "card"
+ ],
+ "processing": null,
+ "receipt_email": "[email protected]",
+ "review": null,
+ "setup_future_usage": null,
+ "shipping": null,
+ "source": null,
+ "statement_descriptor": "Zulip Basic",
+ "statement_descriptor_suffix": null,
+ "status": "succeeded",
+ "transfer_data": null,
+ "transfer_group": null
+}
diff --git a/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--SetupIntent.create.1.json b/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--SetupIntent.create.1.json
new file mode 100644
index 00000000000..dbdef947e88
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--SetupIntent.create.1.json
@@ -0,0 +1,34 @@
+{
+ "application": null,
+ "automatic_payment_methods": null,
+ "cancellation_reason": null,
+ "client_secret": "seti_1Oc9VUDEQaroqDjsNBbyZEoB_secret_PR1YsIl9hSYpd6FDQq9T2nPS5mR3cMQ",
+ "created": 1706114456,
+ "customer": "cus_PR1YvTbJ32gEOi",
+ "description": null,
+ "flow_directions": null,
+ "id": "seti_1Oc9VUDEQaroqDjsNBbyZEoB",
+ "last_setup_error": null,
+ "latest_attempt": "setatt_1Oc9VUDEQaroqDjsJeMjWEIe",
+ "livemode": false,
+ "mandate": null,
+ "metadata": {},
+ "next_action": null,
+ "object": "setup_intent",
+ "on_behalf_of": null,
+ "payment_method": "pm_1Oc9VUDEQaroqDjsMvuKOumG",
+ "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/upgrade_user_to_fixed_price_monthly_basic_plan--SetupIntent.list.1.json b/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--SetupIntent.list.1.json
new file mode 100644
index 00000000000..5126ede35fc
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--SetupIntent.list.1.json
@@ -0,0 +1,41 @@
+{
+ "data": [
+ {
+ "application": null,
+ "automatic_payment_methods": null,
+ "cancellation_reason": null,
+ "client_secret": "seti_1Oc9VTDEQaroqDjsjLOR19wT_secret_PR1Y2JW7FUB4oHdq3ajb2mNWdqMAKE6",
+ "created": 1706114455,
+ "customer": "cus_PR1YvTbJ32gEOi",
+ "description": null,
+ "flow_directions": null,
+ "id": "seti_1Oc9VTDEQaroqDjsjLOR19wT",
+ "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/upgrade_user_to_fixed_price_monthly_basic_plan--SetupIntent.retrieve.1.json b/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--SetupIntent.retrieve.1.json
new file mode 100644
index 00000000000..dbdef947e88
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--SetupIntent.retrieve.1.json
@@ -0,0 +1,34 @@
+{
+ "application": null,
+ "automatic_payment_methods": null,
+ "cancellation_reason": null,
+ "client_secret": "seti_1Oc9VUDEQaroqDjsNBbyZEoB_secret_PR1YsIl9hSYpd6FDQq9T2nPS5mR3cMQ",
+ "created": 1706114456,
+ "customer": "cus_PR1YvTbJ32gEOi",
+ "description": null,
+ "flow_directions": null,
+ "id": "seti_1Oc9VUDEQaroqDjsNBbyZEoB",
+ "last_setup_error": null,
+ "latest_attempt": "setatt_1Oc9VUDEQaroqDjsJeMjWEIe",
+ "livemode": false,
+ "mandate": null,
+ "metadata": {},
+ "next_action": null,
+ "object": "setup_intent",
+ "on_behalf_of": null,
+ "payment_method": "pm_1Oc9VUDEQaroqDjsMvuKOumG",
+ "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/upgrade_user_to_fixed_price_monthly_basic_plan--checkout.Session.create.1.json b/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--checkout.Session.create.1.json
new file mode 100644
index 00000000000..aa6cb68fd40
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--checkout.Session.create.1.json
@@ -0,0 +1,75 @@
+{
+ "after_expiration": null,
+ "allow_promotion_codes": null,
+ "amount_subtotal": null,
+ "amount_total": null,
+ "automatic_tax": {
+ "enabled": false,
+ "liability": null,
+ "status": null
+ },
+ "billing_address_collection": null,
+ "cancel_url": "http://selfhosting.testserver/realm/9336fc3f-5b07-49e0-b0d6-5d48cc3e8d67/upgrade/?manual_license_management=false&tier=1",
+ "client_reference_id": null,
+ "client_secret": null,
+ "consent": null,
+ "consent_collection": null,
+ "created": 1706114455,
+ "currency": null,
+ "currency_conversion": null,
+ "custom_fields": [],
+ "custom_text": {
+ "after_submit": null,
+ "shipping_address": null,
+ "submit": null,
+ "terms_of_service_acceptance": null
+ },
+ "customer": "cus_PR1YvTbJ32gEOi",
+ "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": 1706200855,
+ "id": "cs_test_c1XvbAw3i4zZqlLqg70SRTjFr7IVOYCnv6x4IrWF1XTe71qDWXJ5HusLRM",
+ "invoice": null,
+ "invoice_creation": null,
+ "livemode": false,
+ "locale": null,
+ "metadata": {
+ "remote_realm_user_id": "1",
+ "type": "card_update"
+ },
+ "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_1Oc9VTDEQaroqDjsjLOR19wT",
+ "shipping": null,
+ "shipping_address_collection": null,
+ "shipping_options": [],
+ "shipping_rate": null,
+ "status": "open",
+ "submit_type": null,
+ "subscription": null,
+ "success_url": "http://selfhosting.testserver/realm/9336fc3f-5b07-49e0-b0d6-5d48cc3e8d67/billing/event_status/?stripe_session_id={CHECKOUT_SESSION_ID}",
+ "total_details": null,
+ "ui_mode": "hosted",
+ "url": "https://checkout.stripe.com/c/pay/cs_test_c1XvbAw3i4zZqlLqg70SRTjFr7IVOYCnv6x4IrWF1XTe71qDWXJ5HusLRM#fid1d2BpamRhQ2prcSc%2FJ1ZqcHdmYCVWZGt2JVV3aicpJ2R1bE5gfCc%2FJ3VuWnFgdnFaXVRmMU5zNkldQTY9SnNRY09XZml2UXNQJyknY3dqaFZgd3Ngdyc%2FcXdwYCknaWR8anBxUXx1YCc%2FJ3Zsa2JpYFpmamlwaGsnKSdga2RnaWBVaWRmYG1qaWFgd3YnP3F3cGB4JSUl"
+}
diff --git a/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--checkout.Session.list.1.json b/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--checkout.Session.list.1.json
new file mode 100644
index 00000000000..cc6902a5004
--- /dev/null
+++ b/corporate/tests/stripe_fixtures/upgrade_user_to_fixed_price_monthly_basic_plan--checkout.Session.list.1.json
@@ -0,0 +1,82 @@
+{
+ "data": [
+ {
+ "after_expiration": null,
+ "allow_promotion_codes": null,
+ "amount_subtotal": null,
+ "amount_total": null,
+ "automatic_tax": {
+ "enabled": false,
+ "liability": null,
+ "status": null
+ },
+ "billing_address_collection": null,
+ "cancel_url": "http://selfhosting.testserver/realm/9336fc3f-5b07-49e0-b0d6-5d48cc3e8d67/upgrade/?manual_license_management=false&tier=1",
+ "client_reference_id": null,
+ "client_secret": null,
+ "consent": null,
+ "consent_collection": null,
+ "created": 1706114455,
+ "currency": null,
+ "currency_conversion": null,
+ "custom_fields": [],
+ "custom_text": {
+ "after_submit": null,
+ "shipping_address": null,
+ "submit": null,
+ "terms_of_service_acceptance": null
+ },
+ "customer": "cus_PR1YvTbJ32gEOi",
+ "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": 1706200855,
+ "id": "cs_test_c1XvbAw3i4zZqlLqg70SRTjFr7IVOYCnv6x4IrWF1XTe71qDWXJ5HusLRM",
+ "invoice": null,
+ "invoice_creation": null,
+ "livemode": false,
+ "locale": null,
+ "metadata": {
+ "remote_realm_user_id": "1",
+ "type": "card_update"
+ },
+ "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_1Oc9VTDEQaroqDjsjLOR19wT",
+ "shipping": null,
+ "shipping_address_collection": null,
+ "shipping_options": [],
+ "shipping_rate": null,
+ "status": "open",
+ "submit_type": null,
+ "subscription": null,
+ "success_url": "http://selfhosting.testserver/realm/9336fc3f-5b07-49e0-b0d6-5d48cc3e8d67/billing/event_status/?stripe_session_id={CHECKOUT_SESSION_ID}",
+ "total_details": null,
+ "ui_mode": "hosted",
+ "url": "https://checkout.stripe.com/c/pay/cs_test_c1XvbAw3i4zZqlLqg70SRTjFr7IVOYCnv6x4IrWF1XTe71qDWXJ5HusLRM#fid1d2BpamRhQ2prcSc%2FJ1ZqcHdmYCVWZGt2JVV3aicpJ2R1bE5gfCc%2FJ3VuWnFgdnFaXVRmMU5zNkldQTY9SnNRY09XZml2UXNQJyknY3dqaFZgd3Ngdyc%2FcXdwYCknaWR8anBxUXx1YCc%2FJ3Zsa2JpYFpmamlwaGsnKSdga2RnaWBVaWRmYG1qaWFgd3YnP3F3cGB4JSUl"
+ }
+ ],
+ "has_more": true,
+ "object": "list",
+ "url": "/v1/checkout/sessions"
+}
diff --git a/corporate/tests/test_stripe.py b/corporate/tests/test_stripe.py
index 2855ac8c763..b1bb2cfc9cf 100644
--- a/corporate/tests/test_stripe.py
+++ b/corporate/tests/test_stripe.py
@@ -82,6 +82,7 @@ from corporate.lib.stripe import (
from corporate.models import (
Customer,
CustomerPlan,
+ CustomerPlanOffer,
Event,
LicenseLedger,
PaymentIntent,
@@ -5773,8 +5774,8 @@ class TestRemoteRealmBillingFlow(StripeTestCase, RemoteRealmBillingTestCase):
acting_user=None,
)
- remote_realm = RemoteRealm.objects.get(uuid=zulip_realm.uuid)
- self.billing_session = RemoteRealmBillingSession(remote_realm=remote_realm)
+ self.remote_realm = RemoteRealm.objects.get(uuid=zulip_realm.uuid)
+ self.billing_session = RemoteRealmBillingSession(remote_realm=self.remote_realm)
@responses.activate
@mock_stripe()
@@ -6176,6 +6177,306 @@ class TestRemoteRealmBillingFlow(StripeTestCase, RemoteRealmBillingTestCase):
self.billing_session.min_licenses_for_plan(CustomerPlan.TIER_SELF_HOSTED_BASIC), 1
)
+ @responses.activate
+ @mock_stripe()
+ def test_upgrade_user_to_fixed_price_monthly_basic_plan(self, *mocks: Mock) -> None:
+ self.login("iago")
+
+ self.add_mock_response()
+ with time_machine.travel(self.now, tick=False):
+ send_server_data_to_push_bouncer(consider_usage_statistics=False)
+
+ self.assertFalse(CustomerPlanOffer.objects.exists())
+
+ # Set fixed_price without configuring required_plan_tier.
+ annual_fixed_price = 1200
+ result = self.client_post(
+ "/activity/remote/support",
+ {"remote_realm_id": f"{self.remote_realm.id}", "fixed_price": annual_fixed_price},
+ )
+ self.assert_in_success_response(["Required plan tier should not be set to None"], result)
+
+ # Configure required_plan_tier and fixed_price.
+ result = self.client_post(
+ "/activity/remote/support",
+ {
+ "remote_realm_id": f"{self.remote_realm.id}",
+ "required_plan_tier": CustomerPlan.TIER_SELF_HOSTED_BASIC,
+ },
+ )
+ self.assert_in_success_response(
+ ["Required plan tier for Zulip Dev set to Zulip Basic."], result
+ )
+
+ result = self.client_post(
+ "/activity/remote/support",
+ {"remote_realm_id": f"{self.remote_realm.id}", "fixed_price": annual_fixed_price},
+ )
+ self.assert_in_success_response(
+ ["Customer can now buy a fixed price Zulip Basic plan."], result
+ )
+ fixed_price_plan_offer = CustomerPlanOffer.objects.filter(
+ status=CustomerPlanOffer.CONFIGURED
+ ).first()
+ assert fixed_price_plan_offer is not None
+ self.assertEqual(fixed_price_plan_offer.tier, CustomerPlanOffer.TIER_SELF_HOSTED_BASIC)
+ self.assertEqual(fixed_price_plan_offer.fixed_price, annual_fixed_price * 100)
+ self.assertEqual(fixed_price_plan_offer.get_plan_status_as_text(), "Configured")
+
+ self.logout()
+ self.login("hamlet")
+ hamlet = self.example_user("hamlet")
+
+ # Visit /upgrade
+ self.execute_remote_billing_authentication_flow(hamlet)
+ with time_machine.travel(self.now, tick=False):
+ result = self.client_get(
+ f"{self.billing_session.billing_base_url}/upgrade/?tier={CustomerPlan.TIER_SELF_HOSTED_BASIC}",
+ subdomain="selfhosting",
+ )
+ self.assertEqual(result.status_code, 200)
+ self.assert_in_success_response(
+ ["Add card", "Purchase Zulip Basic", "This is a fixed-price plan."], result
+ )
+
+ self.assertFalse(CustomerPlan.objects.filter(status=CustomerPlan.ACTIVE).exists())
+
+ # Upgrade to fixed-price Zulip Basic plan.
+ with time_machine.travel(self.now, tick=False):
+ stripe_customer = self.add_card_and_upgrade(
+ tier=CustomerPlan.TIER_SELF_HOSTED_BASIC, schedule="monthly"
+ )
+
+ customer = Customer.objects.get(stripe_customer_id=stripe_customer.id)
+ current_plan = CustomerPlan.objects.get(customer=customer, status=CustomerPlan.ACTIVE)
+ self.assertIsNotNone(current_plan.fixed_price)
+ self.assertIsNone(current_plan.price_per_license)
+ fixed_price_plan_offer.refresh_from_db()
+ self.assertEqual(fixed_price_plan_offer.status, CustomerPlanOffer.PROCESSED)
+
+ # Visit /billing
+ with time_machine.travel(self.now + timedelta(days=1), tick=False):
+ response = self.client_get(
+ f"{self.billing_session.billing_base_url}/billing/", subdomain="selfhosting"
+ )
+ for substring in [
+ "Zulip Basic",
+ "Monthly",
+ "February 2, 2012",
+ "This is a fixed-price plan",
+ "Your plan will automatically renew on",
+ f"${int(annual_fixed_price / 12)}",
+ "Visa ending in 4242",
+ "Update card",
+ ]:
+ self.assert_in_response(substring, response)
+
+ @responses.activate
+ @mock_stripe()
+ def test_schedule_upgrade_to_fixed_price_annual_business_plan(self, *mocks: Mock) -> None:
+ self.login("hamlet")
+ hamlet = self.example_user("hamlet")
+
+ self.add_mock_response()
+ with time_machine.travel(self.now, tick=False):
+ send_server_data_to_push_bouncer(consider_usage_statistics=False)
+
+ # Upgrade to fixed-price Zulip Basic plan.
+ self.execute_remote_billing_authentication_flow(hamlet)
+ with time_machine.travel(self.now, tick=False):
+ stripe_customer = self.add_card_and_upgrade(
+ tier=CustomerPlan.TIER_SELF_HOSTED_BASIC,
+ )
+
+ customer = Customer.objects.get(stripe_customer_id=stripe_customer.id)
+ current_plan = CustomerPlan.objects.get(customer=customer, status=CustomerPlan.ACTIVE)
+ self.assertEqual(current_plan.tier, CustomerPlan.TIER_SELF_HOSTED_BASIC)
+ self.assertIsNone(current_plan.fixed_price)
+ self.assertIsNotNone(current_plan.price_per_license)
+
+ self.logout()
+ self.login("iago")
+
+ # Schedule a fixed-price business plan at current plan end_date.
+ result = self.client_post(
+ "/activity/remote/support",
+ {
+ "remote_realm_id": f"{self.remote_realm.id}",
+ "required_plan_tier": CustomerPlan.TIER_SELF_HOSTED_BUSINESS,
+ },
+ )
+ self.assert_in_success_response(
+ ["Required plan tier for Zulip Dev set to Zulip Business."], result
+ )
+
+ annual_fixed_price = 1200
+ result = self.client_post(
+ "/activity/remote/support",
+ {"remote_realm_id": f"{self.remote_realm.id}", "fixed_price": annual_fixed_price},
+ )
+ self.assert_in_success_response(
+ [
+ f"Configure {self.billing_session.billing_entity_display_name} current plan end-date, before scheduling a new plan."
+ ],
+ result,
+ )
+
+ current_plan_end_date = add_months(self.now, 2)
+ current_plan.end_date = current_plan_end_date
+ current_plan.save(update_fields=["end_date"])
+
+ self.assertFalse(CustomerPlan.objects.filter(fixed_price__isnull=False).exists())
+
+ result = self.client_post(
+ "/activity/remote/support",
+ {"remote_realm_id": f"{self.remote_realm.id}", "fixed_price": annual_fixed_price},
+ )
+ self.assert_in_success_response(
+ [
+ f"Fixed price Zulip Business plan scheduled to start on {current_plan_end_date.date()}."
+ ],
+ result,
+ )
+ current_plan.refresh_from_db()
+ self.assertEqual(current_plan.status, CustomerPlan.SWITCH_PLAN_TIER_AT_PLAN_END)
+ self.assertEqual(current_plan.next_invoice_date, current_plan_end_date)
+ new_plan = CustomerPlan.objects.filter(fixed_price__isnull=False).first()
+ assert new_plan is not None
+ self.assertEqual(new_plan.next_invoice_date, current_plan_end_date)
+ self.assertEqual(
+ new_plan.invoicing_status, CustomerPlan.INVOICING_STATUS_INITIAL_INVOICE_TO_BE_SENT
+ )
+
+ # Invoice cron runs and switches plan to BUSINESS
+ with time_machine.travel(current_plan_end_date, tick=False):
+ send_server_data_to_push_bouncer(consider_usage_statistics=False)
+ invoice_plans_as_needed()
+
+ current_plan.refresh_from_db()
+ self.assertEqual(current_plan.status, CustomerPlan.ENDED)
+ self.assertEqual(current_plan.next_invoice_date, None)
+
+ new_plan.refresh_from_db()
+ self.assertEqual(new_plan.tier, CustomerPlan.TIER_SELF_HOSTED_BUSINESS)
+ self.assertIsNotNone(new_plan.fixed_price)
+ self.assertIsNone(new_plan.price_per_license)
+
+ self.logout()
+ self.login("hamlet")
+ hamlet = self.example_user("hamlet")
+
+ # Visit /billing
+ self.execute_remote_billing_authentication_flow(
+ hamlet, expect_tos=False, first_time_login=False
+ )
+ with time_machine.travel(current_plan_end_date + timedelta(days=1), tick=False):
+ response = self.client_get(
+ f"{self.billing_session.billing_base_url}/billing/", subdomain="selfhosting"
+ )
+ for substring in [
+ "Zulip Business",
+ "Annual",
+ "March 2, 2013",
+ "This is a fixed-price plan",
+ "Your plan will automatically renew on",
+ f"${annual_fixed_price:,.2f}",
+ "Visa ending in 4242",
+ "Update card",
+ ]:
+ self.assert_in_response(substring, response)
+
+ @responses.activate
+ @mock_stripe()
+ def test_schedule_legacy_plan_upgrade_to_fixed_price_plan(self, *mocks: Mock) -> None:
+ self.login("hamlet")
+ hamlet = self.example_user("hamlet")
+
+ remote_server = RemoteZulipServer.objects.get(hostname="demo.example.com")
+ server_billing_session = RemoteServerBillingSession(remote_server=remote_server)
+
+ # Migrate server to legacy plan.
+ with time_machine.travel(self.now, tick=False):
+ start_date = timezone_now()
+ end_date = add_months(start_date, months=3)
+ server_billing_session.migrate_customer_to_legacy_plan(start_date, end_date)
+
+ self.add_mock_response()
+ with time_machine.travel(self.now, tick=False):
+ send_server_data_to_push_bouncer(consider_usage_statistics=False)
+
+ # Login. Performs customer migration from server to realms.
+ self.execute_remote_billing_authentication_flow(hamlet)
+ self.remote_realm.refresh_from_db()
+
+ customer = Customer.objects.get(remote_realm=self.remote_realm)
+ legacy_plan = get_current_plan_by_customer(customer)
+ assert legacy_plan is not None
+ self.assertEqual(legacy_plan.tier, CustomerPlan.TIER_SELF_HOSTED_LEGACY)
+ self.assertEqual(legacy_plan.next_invoice_date, end_date)
+
+ self.logout()
+ self.login("iago")
+
+ # Schedule a fixed-price business plan at current plan end_date.
+ self.assertFalse(CustomerPlanOffer.objects.exists())
+
+ # Configure required_plan_tier and fixed_price.
+ annual_fixed_price = 1200
+ result = self.client_post(
+ "/activity/remote/support",
+ {
+ "remote_realm_id": f"{self.remote_realm.id}",
+ "required_plan_tier": CustomerPlan.TIER_SELF_HOSTED_BUSINESS,
+ },
+ )
+ self.assert_in_success_response(
+ ["Required plan tier for Zulip Dev set to Zulip Business."], result
+ )
+
+ result = self.client_post(
+ "/activity/remote/support",
+ {"remote_realm_id": f"{self.remote_realm.id}", "fixed_price": annual_fixed_price},
+ )
+ self.assert_in_success_response(
+ ["Customer can now buy a fixed price Zulip Business plan."],
+ result,
+ )
+ fixed_price_plan_offer = CustomerPlanOffer.objects.get(customer=customer)
+ self.assertEqual(fixed_price_plan_offer.status, CustomerPlanOffer.CONFIGURED)
+ self.assertEqual(fixed_price_plan_offer.tier, CustomerPlanOffer.TIER_SELF_HOSTED_BUSINESS)
+
+ self.logout()
+ self.login("hamlet")
+ self.execute_remote_billing_authentication_flow(
+ hamlet, expect_tos=False, confirm_tos=False, first_time_login=False
+ )
+
+ # Schedule upgrade to business plan
+ with time_machine.travel(self.now, tick=False):
+ self.add_card_and_upgrade(
+ remote_server_plan_start_date="billing_cycle_end_date", talk_to_stripe=False
+ )
+
+ legacy_plan.refresh_from_db()
+ self.assertEqual(legacy_plan.status, CustomerPlan.SWITCH_PLAN_TIER_AT_PLAN_END)
+ fixed_price_plan_offer.refresh_from_db()
+ self.assertEqual(fixed_price_plan_offer.status, CustomerPlanOffer.PROCESSED)
+
+ # Invoice cron runs and switches plan to BUSINESS
+ with time_machine.travel(end_date, tick=False):
+ send_server_data_to_push_bouncer(consider_usage_statistics=False)
+ invoice_plans_as_needed()
+
+ legacy_plan.refresh_from_db()
+ current_plan = get_current_plan_by_customer(customer)
+ assert current_plan is not None
+ self.assertEqual(current_plan.tier, CustomerPlan.TIER_SELF_HOSTED_BUSINESS)
+ self.assertIsNotNone(current_plan.fixed_price)
+ self.assertIsNone(current_plan.price_per_license)
+ self.assertEqual(current_plan.next_invoice_date, add_months(end_date, 1))
+ self.assertEqual(legacy_plan.status, CustomerPlan.ENDED)
+ self.assertEqual(legacy_plan.next_invoice_date, None)
+
@responses.activate
def test_request_sponsorship(self) -> None:
self.login("hamlet")
@@ -6585,6 +6886,7 @@ class TestRemoteRealmBillingFlow(StripeTestCase, RemoteRealmBillingTestCase):
new_plan = self.billing_session.get_next_plan(realm_legacy_plan)
assert new_plan is not None
+ assert type(new_plan) is CustomerPlan
self.assertEqual(new_plan.tier, CustomerPlan.TIER_SELF_HOSTED_BUSINESS)
self.assertEqual(new_plan.status, CustomerPlan.NEVER_STARTED)
self.assertEqual(
@@ -6945,6 +7247,7 @@ class TestRemoteServerBillingFlow(StripeTestCase, RemoteServerTestCase):
self.assertEqual(customer_plan.end_date, end_date)
new_customer_plan = self.billing_session.get_next_plan(customer_plan)
assert new_customer_plan is not None
+ assert type(new_customer_plan) is CustomerPlan
self.assertEqual(new_customer_plan.tier, CustomerPlan.TIER_SELF_HOSTED_BUSINESS)
self.assertEqual(new_customer_plan.status, CustomerPlan.NEVER_STARTED)
self.assertEqual(new_customer_plan.billing_cycle_anchor, end_date)
@@ -7237,6 +7540,278 @@ class TestRemoteServerBillingFlow(StripeTestCase, RemoteServerTestCase):
self.billing_session.min_licenses_for_plan(CustomerPlan.TIER_SELF_HOSTED_BASIC), 1
)
+ @responses.activate
+ @mock_stripe()
+ def test_upgrade_server_to_fixed_price_monthly_basic_plan(self, *mocks: Mock) -> None:
+ self.login("iago")
+
+ self.add_mock_response()
+ with time_machine.travel(self.now, tick=False):
+ send_server_data_to_push_bouncer(consider_usage_statistics=False)
+
+ self.assertFalse(CustomerPlanOffer.objects.exists())
+
+ # Configure required_plan_tier and fixed_price.
+ annual_fixed_price = 1200
+ result = self.client_post(
+ "/activity/remote/support",
+ {
+ "remote_server_id": f"{self.remote_server.id}",
+ "required_plan_tier": CustomerPlan.TIER_SELF_HOSTED_BASIC,
+ },
+ )
+ self.assert_in_success_response(
+ ["Required plan tier for demo.example.com set to Zulip Basic."], result
+ )
+
+ result = self.client_post(
+ "/activity/remote/support",
+ {"remote_server_id": f"{self.remote_server.id}", "fixed_price": annual_fixed_price},
+ )
+ self.assert_in_success_response(
+ ["Customer can now buy a fixed price Zulip Basic plan."], result
+ )
+ fixed_price_plan_offer = CustomerPlanOffer.objects.filter(
+ status=CustomerPlanOffer.CONFIGURED
+ ).first()
+ assert fixed_price_plan_offer is not None
+ self.assertEqual(fixed_price_plan_offer.tier, CustomerPlanOffer.TIER_SELF_HOSTED_BASIC)
+ self.assertEqual(fixed_price_plan_offer.fixed_price, annual_fixed_price * 100)
+
+ self.logout()
+ self.login("hamlet")
+ hamlet = self.example_user("hamlet")
+
+ # Visit /upgrade
+ self.execute_remote_billing_authentication_flow(hamlet.delivery_email, hamlet.full_name)
+ with time_machine.travel(self.now, tick=False):
+ result = self.client_get(
+ f"{self.billing_session.billing_base_url}/upgrade/?tier={CustomerPlan.TIER_SELF_HOSTED_BASIC}",
+ subdomain="selfhosting",
+ )
+ self.assertEqual(result.status_code, 200)
+ self.assert_in_success_response(
+ ["Add card", "Purchase Zulip Basic", "This is a fixed-price plan."], result
+ )
+
+ self.assertFalse(CustomerPlan.objects.filter(status=CustomerPlan.ACTIVE).exists())
+
+ # Upgrade to fixed-price Zulip Basic plan.
+ with time_machine.travel(self.now, tick=False):
+ stripe_customer = self.add_card_and_upgrade(
+ tier=CustomerPlan.TIER_SELF_HOSTED_BASIC, schedule="monthly"
+ )
+
+ customer = Customer.objects.get(stripe_customer_id=stripe_customer.id)
+ current_plan = CustomerPlan.objects.get(customer=customer, status=CustomerPlan.ACTIVE)
+ self.assertIsNotNone(current_plan.fixed_price)
+ self.assertIsNone(current_plan.price_per_license)
+ fixed_price_plan_offer.refresh_from_db()
+ self.assertEqual(fixed_price_plan_offer.status, CustomerPlanOffer.PROCESSED)
+
+ # Visit /billing
+ with time_machine.travel(self.now + timedelta(days=1), tick=False):
+ response = self.client_get(
+ f"{self.billing_session.billing_base_url}/billing/", subdomain="selfhosting"
+ )
+ for substring in [
+ "Zulip Basic",
+ "Monthly",
+ "February 2, 2012",
+ "This is a fixed-price plan",
+ "Your plan will automatically renew on",
+ f"${int(annual_fixed_price / 12)}",
+ "Visa ending in 4242",
+ "Update card",
+ ]:
+ self.assert_in_response(substring, response)
+
+ @responses.activate
+ @mock_stripe()
+ def test_schedule_server_upgrade_to_fixed_price_business_plan(self, *mocks: Mock) -> None:
+ self.login("hamlet")
+ hamlet = self.example_user("hamlet")
+
+ self.add_mock_response()
+ with time_machine.travel(self.now, tick=False):
+ send_server_data_to_push_bouncer(consider_usage_statistics=False)
+
+ # Upgrade to fixed-price Zulip Basic plan.
+ self.execute_remote_billing_authentication_flow(hamlet.delivery_email, hamlet.full_name)
+ with time_machine.travel(self.now, tick=False):
+ stripe_customer = self.add_card_and_upgrade(
+ tier=CustomerPlan.TIER_SELF_HOSTED_BASIC,
+ )
+
+ customer = Customer.objects.get(stripe_customer_id=stripe_customer.id)
+ current_plan = CustomerPlan.objects.get(customer=customer, status=CustomerPlan.ACTIVE)
+ self.assertEqual(current_plan.tier, CustomerPlan.TIER_SELF_HOSTED_BASIC)
+ self.assertIsNone(current_plan.fixed_price)
+ self.assertIsNotNone(current_plan.price_per_license)
+
+ self.logout()
+ self.login("iago")
+
+ # Schedule a fixed-price business plan at current plan end_date.
+ current_plan_end_date = add_months(self.now, 2)
+ current_plan.end_date = current_plan_end_date
+ current_plan.save(update_fields=["end_date"])
+
+ self.assertFalse(CustomerPlan.objects.filter(fixed_price__isnull=False).exists())
+
+ # Configure required_plan_tier and fixed_price.
+ annual_fixed_price = 1200
+ result = self.client_post(
+ "/activity/remote/support",
+ {
+ "remote_server_id": f"{self.remote_server.id}",
+ "required_plan_tier": CustomerPlan.TIER_SELF_HOSTED_BUSINESS,
+ },
+ )
+ self.assert_in_success_response(
+ ["Required plan tier for demo.example.com set to Zulip Business."], result
+ )
+
+ result = self.client_post(
+ "/activity/remote/support",
+ {"remote_server_id": f"{self.remote_server.id}", "fixed_price": annual_fixed_price},
+ )
+ self.assert_in_success_response(
+ [
+ f"Fixed price Zulip Business plan scheduled to start on {current_plan_end_date.date()}."
+ ],
+ result,
+ )
+ current_plan.refresh_from_db()
+ self.assertEqual(current_plan.status, CustomerPlan.SWITCH_PLAN_TIER_AT_PLAN_END)
+ self.assertEqual(current_plan.next_invoice_date, current_plan_end_date)
+ new_plan = CustomerPlan.objects.filter(fixed_price__isnull=False).first()
+ assert new_plan is not None
+ self.assertEqual(new_plan.next_invoice_date, current_plan_end_date)
+ self.assertEqual(
+ new_plan.invoicing_status, CustomerPlan.INVOICING_STATUS_INITIAL_INVOICE_TO_BE_SENT
+ )
+
+ # Invoice cron runs and switches plan to BUSINESS
+ with time_machine.travel(current_plan_end_date, tick=False):
+ send_server_data_to_push_bouncer(consider_usage_statistics=False)
+ invoice_plans_as_needed()
+
+ current_plan.refresh_from_db()
+ self.assertEqual(current_plan.status, CustomerPlan.ENDED)
+ self.assertEqual(current_plan.next_invoice_date, None)
+
+ new_plan.refresh_from_db()
+ self.assertEqual(new_plan.tier, CustomerPlan.TIER_SELF_HOSTED_BUSINESS)
+ self.assertIsNotNone(new_plan.fixed_price)
+ self.assertIsNone(new_plan.price_per_license)
+
+ self.logout()
+ self.login("hamlet")
+ hamlet = self.example_user("hamlet")
+
+ # Visit /billing
+ self.execute_remote_billing_authentication_flow(
+ hamlet.delivery_email, hamlet.full_name, expect_tos=False, confirm_tos=False
+ )
+ with time_machine.travel(current_plan_end_date + timedelta(days=1), tick=False):
+ response = self.client_get(
+ f"{self.billing_session.billing_base_url}/billing/", subdomain="selfhosting"
+ )
+ for substring in [
+ "Zulip Business",
+ "Annual",
+ "March 2, 2013",
+ "This is a fixed-price plan",
+ "Your plan will automatically renew on",
+ f"${annual_fixed_price:,.2f}",
+ "Visa ending in 4242",
+ "Update card",
+ ]:
+ self.assert_in_response(substring, response)
+
+ @responses.activate
+ @mock_stripe()
+ def test_schedule_server_legacy_plan_upgrade_to_fixed_price_plan(self, *mocks: Mock) -> None:
+ self.login("hamlet")
+ hamlet = self.example_user("hamlet")
+
+ # Migrate server to legacy plan.
+ end_date = add_months(self.now, months=3)
+ self.billing_session.migrate_customer_to_legacy_plan(self.now, end_date)
+
+ self.add_mock_response()
+ with time_machine.travel(self.now, tick=False):
+ send_server_data_to_push_bouncer(consider_usage_statistics=False)
+
+ customer = self.billing_session.get_customer()
+ assert customer is not None
+ legacy_plan = get_current_plan_by_customer(customer)
+ assert legacy_plan is not None
+ self.assertEqual(legacy_plan.tier, CustomerPlan.TIER_SELF_HOSTED_LEGACY)
+ self.assertEqual(legacy_plan.next_invoice_date, end_date)
+
+ self.logout()
+ self.login("iago")
+
+ # Schedule a fixed-price business plan at current plan end_date.
+ self.assertFalse(CustomerPlanOffer.objects.exists())
+
+ # Configure required_plan_tier and fixed_price.
+ annual_fixed_price = 1200
+ result = self.client_post(
+ "/activity/remote/support",
+ {
+ "remote_server_id": f"{self.remote_server.id}",
+ "required_plan_tier": CustomerPlan.TIER_SELF_HOSTED_BUSINESS,
+ },
+ )
+ self.assert_in_success_response(
+ ["Required plan tier for demo.example.com set to Zulip Business."], result
+ )
+
+ result = self.client_post(
+ "/activity/remote/support",
+ {"remote_server_id": f"{self.remote_server.id}", "fixed_price": annual_fixed_price},
+ )
+ self.assert_in_success_response(
+ ["Customer can now buy a fixed price Zulip Business plan."],
+ result,
+ )
+ fixed_price_plan_offer = CustomerPlanOffer.objects.get(customer=customer)
+ self.assertEqual(fixed_price_plan_offer.status, CustomerPlanOffer.CONFIGURED)
+ self.assertEqual(fixed_price_plan_offer.tier, CustomerPlanOffer.TIER_SELF_HOSTED_BUSINESS)
+
+ self.logout()
+ self.login("hamlet")
+ self.execute_remote_billing_authentication_flow(hamlet.delivery_email, hamlet.full_name)
+
+ # Schedule upgrade to business plan
+ with time_machine.travel(self.now, tick=False):
+ self.add_card_and_upgrade(
+ remote_server_plan_start_date="billing_cycle_end_date", talk_to_stripe=False
+ )
+
+ legacy_plan.refresh_from_db()
+ self.assertEqual(legacy_plan.status, CustomerPlan.SWITCH_PLAN_TIER_AT_PLAN_END)
+ fixed_price_plan_offer.refresh_from_db()
+ self.assertEqual(fixed_price_plan_offer.status, CustomerPlanOffer.PROCESSED)
+
+ # Invoice cron runs and switches plan to BUSINESS
+ with time_machine.travel(end_date, tick=False):
+ send_server_data_to_push_bouncer(consider_usage_statistics=False)
+ invoice_plans_as_needed()
+
+ legacy_plan.refresh_from_db()
+ current_plan = get_current_plan_by_customer(customer)
+ assert current_plan is not None
+ self.assertEqual(current_plan.tier, CustomerPlan.TIER_SELF_HOSTED_BUSINESS)
+ self.assertIsNotNone(current_plan.fixed_price)
+ self.assertIsNone(current_plan.price_per_license)
+ self.assertEqual(current_plan.next_invoice_date, add_months(end_date, 1))
+ self.assertEqual(legacy_plan.status, CustomerPlan.ENDED)
+ self.assertEqual(legacy_plan.next_invoice_date, None)
+
def test_deactivate_registration_with_push_notification_service(self) -> None:
self.login("hamlet")
hamlet = self.example_user("hamlet")
@@ -7507,6 +8082,7 @@ class TestRemoteServerBillingFlow(StripeTestCase, RemoteServerTestCase):
self.assertEqual(legacy_plan.status, CustomerPlan.SWITCH_PLAN_TIER_AT_PLAN_END)
new_plan = self.billing_session.get_next_plan(legacy_plan)
assert new_plan is not None
+ assert type(new_plan) is CustomerPlan
self.assertEqual(new_plan.tier, CustomerPlan.TIER_SELF_HOSTED_BUSINESS)
self.assertEqual(new_plan.status, CustomerPlan.NEVER_STARTED)
self.assertEqual(
diff --git a/templates/analytics/current_plan_details.html b/templates/analytics/current_plan_details.html
index 7e07c0c1460..16083ff8fb7 100644
--- a/templates/analytics/current_plan_details.html
+++ b/templates/analytics/current_plan_details.html
@@ -21,7 +21,7 @@
{% if plan_data.current_plan.price_per_license %}
<b>Price per license</b>: ${{ dollar_amount(plan_data.current_plan.price_per_license) }}<br />
{% elif plan_data.current_plan.fixed_price %}
- <b>Plan has a fixed price.</b>
+ <b>Plan has a fixed price.</b><br />
{% endif %}
<b>Annual recurring revenue</b>: ${{ dollar_amount(plan_data.annual_recurring_revenue) }}<br />
<b>Start of next billing cycle</b>: {{ plan_data.next_billing_cycle_start.strftime('%d %B %Y') }}<br />
diff --git a/templates/analytics/next_plan_details.html b/templates/analytics/next_plan_details.html
index 0d103fc971b..3d7a6530151 100644
--- a/templates/analytics/next_plan_details.html
+++ b/templates/analytics/next_plan_details.html
@@ -1,15 +1,15 @@
<h4>⏱️ Next plan information:</h4>
<b>Plan name</b>: {{ plan_data.next_plan.name }}<br />
<b>Status</b>: {{ plan_data.next_plan.get_plan_status_as_text() }}<br />
-<b>Start date</b>: {{ plan_data.next_plan.billing_cycle_anchor.strftime('%d %B %Y') }}<br />
-<b>Billing schedule</b>: {% if plan_data.next_plan.billing_schedule == plan_data.next_plan.BILLING_SCHEDULE_ANNUAL %}Annual{% else %}Monthly{% endif %}<br />
-{% if plan_data.next_plan.discount %}
- <b>Discount</b>: {{ format_discount(plan_data.next_plan.discount) }}%<br />
-{% endif %}
{% if plan_data.next_plan.price_per_license %}
+ <b>Start date</b>: {{ plan_data.next_plan.billing_cycle_anchor.strftime('%d %B %Y') }}<br />
+ <b>Billing schedule</b>: {% if plan_data.next_plan.billing_schedule == plan_data.next_plan.BILLING_SCHEDULE_ANNUAL %}Annual{% else %}Monthly{% endif %}<br />
+ {% if plan_data.next_plan.discount %}
+ <b>Discount</b>: {{ format_discount(plan_data.next_plan.discount) }}%<br />
+ {% endif %}
<b>Price per license</b>: ${{ dollar_amount(plan_data.next_plan.price_per_license) }}<br />
<b>Estimated billed licenses</b>: {{ plan_data.current_plan.licenses_at_next_renewal() }}<br />
{% elif plan_data.next_plan.fixed_price %}
- <b>Plan has a fixed price.</b>
+ <b>Plan has a fixed price.</b><br />
{% endif %}
<b>Estimated annual revenue</b>: ${{ dollar_amount(plan_data.estimated_next_plan_revenue) }}<br />
diff --git a/templates/analytics/next_plan_forms_support.html b/templates/analytics/next_plan_forms_support.html
new file mode 100644
index 00000000000..ef0ebbba72b
--- /dev/null
+++ b/templates/analytics/next_plan_forms_support.html
@@ -0,0 +1,8 @@
+<h4>⏱️ Schedule fixed price plan:</h4>
+<form method="POST" class="remote-form">
+ <b>Fixed price</b><br />
+ {{ csrf_input }}
+ <input type="hidden" name="{{ remote_type }}" value="{{ remote_id }}" />
+ <input type="number" name="fixed_price" placeholder="{{_('Annual amount in dollars')}}" required />
+ <button type="submit" class="btn btn-default support-submit-button">Schedule</button>
+</form>
diff --git a/templates/analytics/remote_realm_details.html b/templates/analytics/remote_realm_details.html
index 7b9b7476282..a4d372cd0af 100644
--- a/templates/analytics/remote_realm_details.html
+++ b/templates/analytics/remote_realm_details.html
@@ -65,4 +65,10 @@
{% include 'analytics/next_plan_details.html' %}
{% endwith %}
</div>
+{% else %}
+{% with %}
+ {% set remote_id = remote_realm.id %}
+ {% set remote_type = "remote_realm_id" %}
+ {% include 'analytics/next_plan_forms_support.html' %}
+{% endwith %}
{% endif %}
diff --git a/templates/analytics/remote_server_support.html b/templates/analytics/remote_server_support.html
index 5176ca4be77..9d6a7d31550 100644
--- a/templates/analytics/remote_server_support.html
+++ b/templates/analytics/remote_server_support.html
@@ -100,6 +100,12 @@
{% include 'analytics/next_plan_details.html' %}
{% endwith %}
</div>
+ {% else %}
+ {% with %}
+ {% set remote_id = remote_server.id %}
+ {% set remote_type = "remote_server_id" %}
+ {% include 'analytics/next_plan_forms_support.html' %}
+ {% endwith %}
{% endif %}
{% for remote_realm in remote_realms[remote_server.id] %}
diff --git a/templates/corporate/billing.html b/templates/corporate/billing.html
index 14b6c6fcb3d..b749a45b442 100644
--- a/templates/corporate/billing.html
+++ b/templates/corporate/billing.html
@@ -74,7 +74,7 @@
{%if switch_to_monthly_at_end_of_cycle %}data-switch-to-monthly-eoc="true"{% endif %}
{%if switch_to_annual_at_end_of_cycle %}data-switch-to-annual-eoc="true"{% endif %}>
<label for="org-billing-frequency">Billing frequency</label>
- {% if downgrade_at_end_of_free_trial or downgrade_at_end_of_cycle or is_server_on_legacy_plan %}
+ {% if downgrade_at_end_of_free_trial or downgrade_at_end_of_cycle or is_server_on_legacy_plan or fixed_price_plan %}
<div class="not-editable-realm-field">
{{ billing_frequency }}
</div>
@@ -106,7 +106,7 @@
</button>
<div id="org-billing-frequency-change-error" class="alert alert-danger billing-page-error"></div>
</div>
- {% if is_server_on_legacy_plan %}
+ {% if is_server_on_legacy_plan or fixed_price_plan %}
{% elif automanage_licenses %}
<div class="input-box billing-page-field no-validation">
<label for="automatic-license-count" class="inline-block label-title">
@@ -227,6 +227,9 @@
<a href="{{ billing_base_url }}/plans/">other features</a> of your current plan.
{% endif %}
{% else %}
+ {% if fixed_price_plan %}
+ This is a fixed-price plan.
+ {% endif %}
{% if charge_automatically %}
{% if is_server_on_legacy_plan %}
Your plan will automatically upgrade to {{ legacy_remote_server_next_plan_name }} on {{ remote_server_legacy_plan_end_date }}.
@@ -239,7 +242,7 @@
<br />
<div class="input-box billing-page-field">
<label for="expected-charge">Expected next charge</label>
- {% if not fixed_price %}
+ {% if not fixed_price_plan %}
<div class="not-editable-realm-field">
${{ pre_discount_renewal_cents }} (${{ price_per_license }} x {{ licenses_at_next_renewal }} {{ 'user' if licenses_at_next_renewal == 1 else 'users' }} x
{% if switch_to_annual_at_end_of_cycle %}
@@ -261,8 +264,9 @@
</div>
{% endif %}
</div>
+ <br />
<h1>${{ renewal_amount }}</h1>
- {% if not fixed_price and using_min_licenses_for_plan %}
+ {% if not fixed_price_plan and using_min_licenses_for_plan %}
<i>Minimum purchase for this plan: {{ min_licenses_for_plan }} licenses</i>
{% endif %}
{% endif %}
diff --git a/templates/corporate/upgrade.html b/templates/corporate/upgrade.html
index 5805f18d711..1ffa1cefcbc 100644
--- a/templates/corporate/upgrade.html
+++ b/templates/corporate/upgrade.html
@@ -69,8 +69,13 @@
{% else %}
<div class="input-box upgrade-page-field no-validation">
<select name="schedule" id="payment-schedule-select">
+ {% if fixed_price_plan %}
+ <option value="monthly">Pay monthly</option>
+ <option value="annual">Pay annually</option>
+ {% else %}
<option value="monthly" id="autopay_monthly_price"></option>
<option value="annual" id="autopay_annual_price_per_month"></option>
+ {% endif %}
</select>
<label for="payment-schedule-select">Payment schedule</label>
</div>
@@ -125,33 +130,37 @@
</span>
</label>
<div id="due-today" class="not-editable-realm-field">
- $<span id="pre-discount-renewal-cents"></span>
- ($<span class="due-today-unit-price"></span> x
- {% if not manual_license_management %}
- {{ seat_count }}
+ {% if fixed_price_plan %}
+ <h1>$<span class="due-today-price"></span></h1>
{% else %}
- <span class="due-today-license-count">{{ seat_count }}</span>
- {% endif %}
- <span class="due-today-license-count-user-plural">
- {{ 'user' if seat_count == 1 else 'users' }}
- </span> x
- <span class="due-today-duration"></span>)
- {% if discount_percent %}
- <br/>
- <i class="billing-page-discount">Includes: {{ discount_percent }}% discount</i>
- {% endif %}
- {% if page_params.flat_discounted_months > 0 %}
- <br/>
- <span class="flat-discount-minus-sign">−</span>
- <span class="flat-discount-separator">$<span class="flat-discounted-price"></span>/month off</span> <i class="billing-page-discount">({{ page_params.flat_discounted_months }} {{ "month" if page_params.flat_discounted_months == 1 else "months" }} remaining)</i>
- {% endif %}
- <h1>$<span class="due-today-price"></span></h1>
- {% if free_trial_days %}
- <i>Your actual bill will depend on the number of
- active users in your organization.</i>
- {% endif %}
- {% if not manual_license_management and using_min_licenses_for_plan %}
- <i>Minimum purchase for this plan: {{ min_licenses_for_plan }} licenses</i>
+ $<span id="pre-discount-renewal-cents"></span>
+ ($<span class="due-today-unit-price"></span> x
+ {% if not manual_license_management %}
+ {{ seat_count }}
+ {% else %}
+ <span class="due-today-license-count">{{ seat_count }}</span>
+ {% endif %}
+ <span class="due-today-license-count-user-plural">
+ {{ 'user' if seat_count == 1 else 'users' }}
+ </span> x
+ <span class="due-today-duration"></span>)
+ {% if discount_percent %}
+ <br/>
+ <i class="billing-page-discount">Includes: {{ discount_percent }}% discount</i>
+ {% endif %}
+ {% if page_params.flat_discounted_months > 0 %}
+ <br/>
+ <span class="flat-discount-minus-sign">−</span>
+ <span class="flat-discount-separator">$<span class="flat-discounted-price"></span>/month off</span> <i class="billing-page-discount">({{ page_params.flat_discounted_months }} {{ "month" if page_params.flat_discounted_months == 1 else "months" }} remaining)</i>
+ {% endif %}
+ <h1>$<span class="due-today-price"></span></h1>
+ {% if free_trial_days %}
+ <i>Your actual bill will depend on the number of
+ active users in your organization.</i>
+ {% endif %}
+ {% if not manual_license_management and using_min_licenses_for_plan %}
+ <i>Minimum purchase for this plan: {{ min_licenses_for_plan }} licenses</i>
+ {% endif %}
{% endif %}
</div>
</div>
@@ -160,10 +169,15 @@
{% elif not manual_license_management %}
<div id="license-automatic-section" class="input-box upgrade-page-field license-management-section">
<p class="not-editable-realm-field">
- Your subscription will renew automatically. Your bill will vary based on the number
- of active users in your organization. You can also
+ {% if fixed_price_plan %}
+ This is a fixed-price plan.
+ {% endif %}
+ Your subscription will renew automatically.
+ {% if not fixed_price_plan %}
+ Your bill will vary based on the number of active users in your organization. You can also
<a href="{{ page_params.billing_base_url }}/upgrade/?manual_license_management=true&tier={{ page_params.tier }}">purchase a fixed number of licenses</a> instead. See
<a target="_blank" href="https://zulip.com/help/zulip-cloud-billing">here</a> for details.
+ {% endif %}
</p>
<input type="hidden" name="licenses" id="automatic_license_count" value="{{ seat_count }}" />
</div>
diff --git a/web/src/billing/page_params.ts b/web/src/billing/page_params.ts
index 984c620d4dd..240520ce6d8 100644
--- a/web/src/billing/page_params.ts
+++ b/web/src/billing/page_params.ts
@@ -11,6 +11,7 @@ export const page_params: {
tier: number;
flat_discount: number;
flat_discounted_months: number;
+ fixed_price: number | null;
} = $("#page-params").data("params");
if (!page_params) {
diff --git a/web/src/billing/upgrade.ts b/web/src/billing/upgrade.ts
index 065f0c5cc09..ec807edc978 100644
--- a/web/src/billing/upgrade.ts
+++ b/web/src/billing/upgrade.ts
@@ -44,6 +44,16 @@ function update_due_today(schedule: string): void {
if (schedule === "monthly") {
num_months = 1;
}
+
+ if (page_params.fixed_price !== null) {
+ let due_today = page_params.fixed_price;
+ if (schedule === "monthly") {
+ due_today = page_params.fixed_price / 12;
+ }
+ $(".due-today-price").text(helpers.format_money(due_today));
+ return;
+ }
+
$("#due-today .due-today-duration").text(num_months === 1 ? "1 month" : "12 months");
const schedule_typed = helpers.schedule_schema.parse(schedule);
const pre_flat_discount_price = prices[schedule_typed] * current_license_count;