mirror of
https://github.com/zulip/zulip.git
synced 2026-06-30 21:11:04 +08:00
stripe: Create customer if one doesn't exist.
Since this function can only be called by billing admins, it is okay to allow them to create a customer if one doesn't exist.
This commit is contained in:
parent
9b96b45841
commit
bb8a0ea1f4
@ -818,12 +818,10 @@ class BillingSession(ABC):
|
||||
setup_payment_by_invoice: bool = False,
|
||||
) -> str:
|
||||
customer = self.get_customer()
|
||||
if setup_payment_by_invoice and (
|
||||
customer is None or customer.stripe_customer_id is None
|
||||
): # nocoverage
|
||||
if customer is None or customer.stripe_customer_id is None: # nocoverage
|
||||
customer = self.create_stripe_customer()
|
||||
|
||||
assert customer is not None and customer.stripe_customer_id is not None
|
||||
assert customer.stripe_customer_id is not None
|
||||
|
||||
if return_to_billing_page:
|
||||
return_url = f"{self.billing_session_url}/billing/"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user