Update routes/subscription.py
Browse files- routes/subscription.py +5 -5
routes/subscription.py
CHANGED
@@ -163,9 +163,9 @@ def create_checkout_session(
|
|
163 |
raise HTTPException(status_code=404, detail="Stylist not found")
|
164 |
|
165 |
stylist = stylist_data[0]
|
166 |
-
stylist_stripe_id = stylist.get("stripe_id")
|
|
|
167 |
consultations = stylist.get("consultations")
|
168 |
-
price_id = stylist.get("price_id") # Buscar o price_id do estilista
|
169 |
|
170 |
# 🔹 3. Validar dados do estilista
|
171 |
logger.info(f"📌 Stylist Data: {stylist}")
|
@@ -187,14 +187,14 @@ def create_checkout_session(
|
|
187 |
raise HTTPException(status_code=404, detail="Client not found")
|
188 |
|
189 |
user = user_data[0]
|
190 |
-
|
191 |
stripe_customer_id = user.get("stripe_customer_id") # Garantir que o campo customer_id esteja presente
|
192 |
|
193 |
# Depuração: Verificando se o stripe_customer_id existe
|
194 |
-
logger.info(f"📌 Retrieved Client stripe_id: {
|
195 |
logger.info(f"📌 Retrieved Client stripe_customer_id: {stripe_customer_id}")
|
196 |
|
197 |
-
if not
|
198 |
raise HTTPException(status_code=400, detail="Client does not have a Stripe ID")
|
199 |
|
200 |
if not stripe_customer_id:
|
|
|
163 |
raise HTTPException(status_code=404, detail="Stylist not found")
|
164 |
|
165 |
stylist = stylist_data[0]
|
166 |
+
stylist_stripe_id = stylist.get("stripe_id") # O stripe_id do estilista
|
167 |
+
price_id = stylist.get("price_id") # O price_id do estilista
|
168 |
consultations = stylist.get("consultations")
|
|
|
169 |
|
170 |
# 🔹 3. Validar dados do estilista
|
171 |
logger.info(f"📌 Stylist Data: {stylist}")
|
|
|
187 |
raise HTTPException(status_code=404, detail="Client not found")
|
188 |
|
189 |
user = user_data[0]
|
190 |
+
customer_stripe_id = user.get("stripe_id") # O stripe_id do cliente
|
191 |
stripe_customer_id = user.get("stripe_customer_id") # Garantir que o campo customer_id esteja presente
|
192 |
|
193 |
# Depuração: Verificando se o stripe_customer_id existe
|
194 |
+
logger.info(f"📌 Retrieved Client stripe_id: {customer_stripe_id}")
|
195 |
logger.info(f"📌 Retrieved Client stripe_customer_id: {stripe_customer_id}")
|
196 |
|
197 |
+
if not customer_stripe_id:
|
198 |
raise HTTPException(status_code=400, detail="Client does not have a Stripe ID")
|
199 |
|
200 |
if not stripe_customer_id:
|