#yannik_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/1305830737911480330
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi, let me help you with this.
Each time we try
How are you doing this exactly right now?
subscriptions where we use setup_intents and invoice generation
And how you do this currently, in detail?
For payment_intents, I use the invoice creation API and the pay method to mark it as paid once the payment is received through the webhook.
For setup_intents, I use Laravel Cashier, which handles things in the background.
And how do Subscriptions come into play?
This sounds a bit too complicated.
You can just create Invoices, which will have an PaymentIntent attached to them, and that will take care of payment. You can handle payments manually or charge the saved Payment Method.
Alright, can I use the invoice’s payment_intent to process the payment with Stripe Elements?
I create the invoice with collection_method set to send_invoice, then I finalize it. Should I use it in my Stripe Elements or finalize it afterward?
Yes
The PaymentIntent won't be generated until you finalize the invoice. You can just set auto_advance=false on the Invoice to make sure the Invoice doesn't advance to the next stage (send, or pay) automatically. This will allow you to grab the PaymentIntent and confirm it via Payment Element.
Thank you, we’ll test this workflow.
Happy to help.