#drismail_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/1331536671409311755
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Clean pic on Github Orakaro ๐๐ผ
Looking forward to your help!
Hi there ๐ ๐
The issue is that Stripe generates a first invoice when creating the subscription and charges the user again. I need to link the captured payment intent to the subscriptionโs first invoice (marking it as paid) while ensuring future renewals are charged automatically. How can I achieve this?
Taking a step back, I think a cleaner solution would be directly create a Subscription first, let it generate a PaymentIntent then try to change that PaymentIntent's capture_method to manual.
Not sure if that's possible, let me quickly test it
Otherwise, as you observed, you would want to mark the first Invoice of your Subscription as paid by giving the customer a credit notes, a 100% discount
Hey! ๐
If the first solution is possible, it would be really clean!
Ugh it's not possible, sorry
Some of the parameters you provided (capture_method) cannot be used when modifying a PaymentIntent that was created by an invoice. You can try again without those parameters
So yeah you would want to "adjust" the first Invoice. Mark it as paid_out_out_band is also a way
how to set paid out of band?
Just call this Pay Invoice API and specify this = true: https://docs.stripe.com/api/invoices/pay#pay_invoice-paid_out_of_band
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Thanks for sharing!
But, how to set up the subscription in such way that it doesn't charge on creation?
You can set payment_behavior to default_incomplete
Yeah, will be using the payment method you setup for the Subscription
(you will want to set the collected payment_method on the Payment Intent, to the Subscription)
Sure
yes, I did that
thanks for the heads up
You can't set it right away by the way
you need to first attach it to the customer
when you set the payment intent
then set customer.pm to the sub
Yep. Or you set the PM as the customer's invoice_settings.default_payment_method
hmm, that's clean as well!
My second question was: Is it possible to specify how many retries on failed subscription renewals before sub cancellation? If so, when and how should it be specified?
There is Smart Retries: https://docs.stripe.com/billing/revenue-recovery/smart-retries#smart-retries and you can disable it and define your own rule in Dashboard
Thanks Orakaro
Really appreciate your help
Can this chat be closed and kept for my reference or will it be deleted?
Hey! Taking over for my colleague.
This thread will just be closed, but not deleted. So you can keep it as one of your references.
thanks