#FallenBlade
1 messages ยท Page 1 of 1 (latest)
Hi ๐ typically you don't. Invoices generate Payment Intents to process the payment associated with the Invoice, so typically you would create the Invoice first and then use its Payment Intent to handle the payment for it.
Thanks for your response.
Can you give me an article to implement an invoice for one-time payment and that charge automatically?
I tried creating an invoice but the paymentIntent is null. So, I might missed something.
If you haven't yet finalized the Invoice then that is expected.
This is a good entry point to our documentation for working with Invoices. It links to related documents based on whether you're looking for an API-based solution or a no-code option:
https://stripe.com/docs/invoicing
Thanks for the link.
So I need to finalized an invoice in order for it to create an paymentIntent?
Is this how stripe finalized an invoice?
https://stripe.com/docs/api/invoices/finalize
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Yup, to both.
Thanks! I'll implement this now.
๐ sounds good, we're here if that process gives you trouble.
Is my implementation correct?
- Created customer
2.Created invoice
3.Created invoiceItems
4.finalizeInvoice
5.Use clientsecret toconfirmCardPayment
Yup, I think that looks like right, is it doing what you're hoping?
Yep, I wanted to create an invoice for a one-time payment. Is this invoice will be send automatically to customer email once it is live?
I don't believe so. There is a setting that can be enabled here regarding emailing finalized Invoices, but I'm pretty sure that only gets used when collection_method is set to send_invoice.
Yeah, I think that's on Settings -> Subscriptions and emails? https://passimage.in/i/c2452a129dd647117ff8.png
Does this also affect an invoice without a subscription?
Yes, that section is specifically for one-off Invoices
I see, so I'm good. Thank you so much for your help here Toby. I've been cracking my head this past few days on how to create a one-time payment with invoice and customer. I tried looking everywhere how to do it but there's no stripe documentation for it. it only talks about when collection_method is set to send_invoice.
Thanks for your help! I appreciate it.
Any time, happy to help!