From 8929c731dba28a227075ac7cb6d31a37684e3e5f Mon Sep 17 00:00:00 2001 From: Soumyadas15 Date: Mon, 16 Jun 2025 17:58:30 +0530 Subject: [PATCH] chore(dev): add tolt referrals --- backend/services/billing.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/services/billing.py b/backend/services/billing.py index 0379af65..4b49a6a9 100644 --- a/backend/services/billing.py +++ b/backend/services/billing.py @@ -313,7 +313,7 @@ async def create_checkout_session( # Get or create Stripe customer customer_id = await get_stripe_customer_id(client, current_user_id) if not customer_id: customer_id = await create_stripe_customer(client, current_user_id, email) - + # Get the target price and product ID try: price = stripe.Price.retrieve(request.price_id, expand=['product']) @@ -545,6 +545,7 @@ async def create_checkout_session( logger.exception(f"Error updating subscription {existing_subscription.get('id') if existing_subscription else 'N/A'}: {str(e)}") raise HTTPException(status_code=500, detail=f"Error updating subscription: {str(e)}") else: + session = stripe.checkout.Session.create( customer=customer_id, payment_method_types=['card'],