corporate: Create change plan tier function for BillingSession.

Moves and generalizes `switch_realm_from_standard_to_plus_plan`
in stripe.py to be a more general function for changing a
CustomerPlan to a new and valid tier, `do_change_plan_to_new_tier`.

Adds a helper function with the previous function name to be used
for the support view and management command for changing a realm
from the Standard plan tier to the Plus plan tier.
This commit is contained in:
Lauryn Menard
2023-11-23 07:29:03 +01:00
committed by Tim Abbott
parent a00e687d02
commit b167eeff08
41 changed files with 3877 additions and 319 deletions

View File

@@ -56,13 +56,13 @@ if settings.BILLING_ENABLED:
from corporate.lib.stripe import (
RealmBillingSession,
get_latest_seat_count,
switch_realm_from_standard_to_plus_plan,
void_all_open_invoices,
)
from corporate.lib.support import (
approve_realm_sponsorship,
attach_discount_to_realm,
get_discount_for_realm,
switch_realm_from_standard_to_plus_plan,
update_realm_billing_method,
update_realm_sponsorship_status,
)