#kai_invoices
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/1220428674919174287
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
It seems like part of the answer got cut off. Here is the missing part for the question "What have you already attempted?"
Despite these steps, the dashboard shows the invoices as paid with $0 instantly and lists the invoice items with the specified amounts as pending.
I believe the issue here is that the pending invoice items weren't pulled into the Invoice. Can you try again and change your invoice creation code to pass in pending_invoice_items_behavior (https://docs.stripe.com/api/invoices/create#create_invoice-pending_invoice_items_behavior) to pass in include
It seemed like it initiated the payment with the 'open' status. Does it always take 1 hour for the payment to complete? Is there a way to make the payment instantanious?
in_1OwptQEvUNDxHSmfl4bSsH3i
You could call the Pay invoice API (https://docs.stripe.com/api/invoices/pay) to immediatley attempt payment
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Thank you very much.
InvoiceItem.create() -> Invoice.create() -> Invoice.finalize_invoice() -> Invoice.pay()
Is this the common and correct implementation for having a credit system like mine?
There's a lot of different ways to implement a system like yours - basically, you just need Stripe to manage the payment-acceptance part (which Invoices works great for) but there's a lot of other options for accept payments
It seems like implementation worked. very very helpful. Thanks!
๐