diff --git a/corporate/lib/stripe.py b/corporate/lib/stripe.py index a35aff02a4..e6619c2266 100644 --- a/corporate/lib/stripe.py +++ b/corporate/lib/stripe.py @@ -450,6 +450,7 @@ class UpgradeRequest: class InitialUpgradeRequest: onboarding: bool manual_license_management: bool + tier: int class AuditLogEventType(Enum): @@ -1239,6 +1240,7 @@ class BillingSession(ABC): seat_count = self.current_count_for_billed_licenses() signed_seat_count, salt = sign_string(str(seat_count)) + tier = initial_upgrade_request.tier context: Dict[str, Any] = { "seat_count": seat_count, "signed_seat_count": signed_seat_count, @@ -1251,9 +1253,8 @@ class BillingSession(ABC): "onboarding": onboarding, "page_params": { "seat_count": seat_count, - "annual_price": 8000, - "monthly_price": 800, - "percent_off": float(percent_off), + "annual_price": get_price_per_license(tier, CustomerPlan.ANNUAL, percent_off), + "monthly_price": get_price_per_license(tier, CustomerPlan.MONTHLY, percent_off), }, "manual_license_management": initial_upgrade_request.manual_license_management, } diff --git a/corporate/views/upgrade.py b/corporate/views/upgrade.py index 0feda632c9..956b069fd4 100644 --- a/corporate/views/upgrade.py +++ b/corporate/views/upgrade.py @@ -17,7 +17,7 @@ from corporate.lib.stripe import ( UpgradeRequest, ) from corporate.lib.support import get_support_url -from corporate.models import ZulipSponsorshipRequest +from corporate.models import CustomerPlan, ZulipSponsorshipRequest from zerver.actions.users import do_change_is_billing_admin from zerver.decorator import require_organization_member, zulip_login_required from zerver.lib.request import REQ, has_request_variables @@ -94,6 +94,7 @@ def initial_upgrade( initial_upgrade_request = InitialUpgradeRequest( onboarding=onboarding, manual_license_management=manual_license_management, + tier=CustomerPlan.STANDARD, ) billing_session = RealmBillingSession(user) redirect_url, context = billing_session.get_initial_upgrade_context(initial_upgrade_request) diff --git a/web/src/billing/page_params.ts b/web/src/billing/page_params.ts index 180e95a56c..5497ddf430 100644 --- a/web/src/billing/page_params.ts +++ b/web/src/billing/page_params.ts @@ -6,7 +6,6 @@ import $ from "jquery"; export const page_params: { annual_price: number; monthly_price: number; - percent_off: number; seat_count: number; } = $("#page-params").data("params"); diff --git a/web/src/billing/upgrade.ts b/web/src/billing/upgrade.ts index eb93e46422..fa4887532e 100644 --- a/web/src/billing/upgrade.ts +++ b/web/src/billing/upgrade.ts @@ -8,8 +8,8 @@ import type {Prices} from "./helpers"; import {page_params} from "./page_params"; const prices: Prices = { - annual: page_params.annual_price * (1 - page_params.percent_off / 100), - monthly: page_params.monthly_price * (1 - page_params.percent_off / 100), + annual: page_params.annual_price, + monthly: page_params.monthly_price, }; const ls = localstorage();