From a8fd350630b1573e959522f6ae3b623d4b764220 Mon Sep 17 00:00:00 2001 From: Aman Agrawal Date: Mon, 11 Dec 2023 08:45:35 +0000 Subject: [PATCH] stripe: Use session specific method to create customer. --- corporate/lib/stripe.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/corporate/lib/stripe.py b/corporate/lib/stripe.py index 3b8f07a404..e6b5ac99d6 100644 --- a/corporate/lib/stripe.py +++ b/corporate/lib/stripe.py @@ -3506,9 +3506,7 @@ class RemoteServerBillingSession(BillingSession): # nocoverage end_date: datetime, ) -> None: # Set stripe_customer_id to None to avoid customer being charged without a payment method. - customer = Customer.objects.create( - remote_server=self.remote_server, stripe_customer_id=None - ) + customer = self.update_or_create_customer(stripe_customer_id=None, defaults={"stripe_customer_id": None}) # Servers on legacy plan which are scheduled to be upgraded have 2 plans. # This plan will be used to track the current status of SWITCH_PLAN_TIER_AT_PLAN_END