#Skrypnyk81
1 messages · Page 1 of 1 (latest)
Hi! Let me help you with this.
ok
Where do you get this ID from? di_1MgWTxE0TrdS8dkGbQXDeXiX
Ok, I solved it, I forgot to add .object to discount quote = stripe.Quote.retrieve(quote_id)
quote_line_items = stripe.Quote.list_line_items(quote_id)
customer_id = quote["customer"]
metadata = quote["metadata"]
discounts_list = quote["discounts"]
payment_period = metadata["payment_recurrence"]
coupon = ""
if len(discounts_list) > 0:
coupon = discounts_list[0].object