#nextplayerrr_api
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1337450546981769217
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
invoice = stripe.Invoice.create(
customer=stripe_customer_id,
collection_method="charge_automatically",
metadata={
"invoice_id": invoice_id
},
currency="usd",
description=description
)
stripe_invoice_id = invoice.id
for item in items_billed:
if not item['unit_price'] or not item['amount']:
stripe.InvoiceItem.create(
customer=stripe_customer_id,
amount=item['total_price'],
currency="usd",
description=item['title'],
invoice=stripe_invoice_id
)
else:
stripe.InvoiceItem.create(
customer=stripe_customer_id,
unit_amount=item['unit_price'],
quantity=item['amount'],
currency="usd",
description=item['title'],
invoice=stripe_invoice_id
)
result = stripe.Invoice.finalize_invoice(stripe_invoice_id)```
This is how I create the invoice
Hi, I'm still taking a look here as it appears that the customer has a default payment method on the invoice settings, https://docs.stripe.com/api/invoices/create#create_invoice-collection_method
Ok thank you
Yeah, since the payment method was set as the deafult one, we should have used it: https://docs.stripe.com/api/invoices/create#create_invoice-default_payment_method
I see auto_advance: false can you change that to true: https://docs.stripe.com/api/invoices/create#create_invoice-auto_advance?