#dawson_best-practices
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/1341436357700227172
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- dawson_best-practices, 44 minutes ago, 6 messages
I want it to look like this pretty much
I was able to create a off-session + confirm payment intent and it successfully charge dthe account, but I was unable to add it to the invoice history.
I'm looking at stripe.invoices.create at the moment, but I can't figure out how to add any form of pricing to say how much the total cost was
Yeah a payment intent isn't an invoice, so you do need to run stripe.invoices.create if you want it to show in the invoice history
So after creating the invoice, you need to create the invoice item
For the amount
Then finalize: https://docs.stripe.com/api/invoices/finalize
Then pay it: https://docs.stripe.com/api/invoices/pay
Here's some other docs: https://docs.stripe.com/invoicing/integration
You'd need to do charge_automatically instead of send_invoice though: https://docs.stripe.com/api/invoices/object#invoice_object-collection_method . That above doc uses send_invoice
Awesome, thank you! I had to finalize the invoice
I have collection_method: "charge_automatically", do you know why it didn't charge automatically?
The card was on file before I made the invoice, this is in test mode
I tried with and without setting the default_payment_method
Can you share the invoice id
ii_1QttWLHiAWHhBxQItxQBsYvl
I also set auto_advance: true and it created a new unpaid invoice
There are multiple invoices, that was the latest one
Okay so, I was a bit confused.
I added #pay(invoiceId) to the end, I figured this wasn't required due to having auto_advanced set to true and collection_method to charge_automatically
It's all working now, I appreciate the help
Yeah so we wait an hour to pay the invoice actually
So if you need to pay immediately, you do need to call the /pay endpoint
Makes sense, have a good one.