habulaj commited on
Commit
456daaa
·
verified ·
1 Parent(s): ceb5d72

Update routes/subscription.py

Browse files
Files changed (1) hide show
  1. routes/subscription.py +2 -2
routes/subscription.py CHANGED
@@ -167,7 +167,7 @@ async def create_price(
167
  logger.info(f"🔹 Subscription {sub.id} set to cancel at period end.")
168
 
169
  # 🔹 5. Atualizar Supabase com o novo price_id
170
- update_data = {"price_id": updated_price_id}
171
  headers = {
172
  "Authorization": f"Bearer {user_token}", # Adicionando o token no header
173
  "Content-Type": "application/json"
@@ -181,7 +181,7 @@ async def create_price(
181
  if update_response.status_code not in [200, 204]:
182
  raise HTTPException(status_code=500, detail=f"Failed to update Supabase: {update_response.text}")
183
 
184
- logger.info(f"✅ Successfully updated user {user_id} with new price_id {updated_price_id}")
185
  return {"message": "Price created successfully!", "price_id": new_price_id}
186
 
187
  except Exception as e:
 
167
  logger.info(f"🔹 Subscription {sub.id} set to cancel at period end.")
168
 
169
  # 🔹 5. Atualizar Supabase com o novo price_id
170
+ update_data = {"price_id": new_price_id} # Corrigido para 'new_price_id'
171
  headers = {
172
  "Authorization": f"Bearer {user_token}", # Adicionando o token no header
173
  "Content-Type": "application/json"
 
181
  if update_response.status_code not in [200, 204]:
182
  raise HTTPException(status_code=500, detail=f"Failed to update Supabase: {update_response.text}")
183
 
184
+ logger.info(f"✅ Successfully updated user {user_id} with new price_id {new_price_id}")
185
  return {"message": "Price created successfully!", "price_id": new_price_id}
186
 
187
  except Exception as e: