habulaj commited on
Commit
4f2939f
·
verified ·
1 Parent(s): 59615d0

Update routes/subscription.py

Browse files
Files changed (1) hide show
  1. routes/subscription.py +6 -5
routes/subscription.py CHANGED
@@ -13,8 +13,9 @@ stripe.api_version = "2023-10-16"
13
 
14
  ### MODELOS DE DADOS ###
15
  class PriceRequest(BaseModel):
16
- amount: int # Valor em centavos (ex: R$50,00 -> 5000)
17
-
 
18
  class SubscriptionRequest(BaseModel):
19
  user_id: str
20
  estilista_id: str
@@ -25,10 +26,10 @@ class CancelSubscriptionRequest(BaseModel):
25
 
26
  ### 1. CREATE DYNAMIC PRICE ###
27
  @router.post("/create_price")
28
- def create_price(data: PriceRequest, stylist_name: str):
29
  try:
30
- product_name = f"{stylist_name}'s Subscription"
31
- product_description = f"Monthly plan to access exclusive services from {stylist_name}."
32
 
33
  product = stripe.Product.create(
34
  name=product_name,
 
13
 
14
  ### MODELOS DE DADOS ###
15
  class PriceRequest(BaseModel):
16
+ amount: int # Value in cents (e.g., R$25.00 -> 2500)
17
+ stylist_name: str # Added stylist name to the request bod
18
+
19
  class SubscriptionRequest(BaseModel):
20
  user_id: str
21
  estilista_id: str
 
26
 
27
  ### 1. CREATE DYNAMIC PRICE ###
28
  @router.post("/create_price")
29
+ def create_price(data: PriceRequest):
30
  try:
31
+ product_name = f"{data.stylist_name}'s Subscription"
32
+ product_description = f"Monthly plan to access exclusive services from {data.stylist_name}."
33
 
34
  product = stripe.Product.create(
35
  name=product_name,