Merge branch 'PRODUCTION'

This commit is contained in:
sharath 2025-06-16 12:39:44 +00:00
commit 313fa28c34
No known key found for this signature in database
1 changed files with 2 additions and 1 deletions

View File

@ -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'],