Update routes/subscription.py
Browse files- 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":
|
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 {
|
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:
|