#차가운새우

1 messages · Page 1 of 1 (latest)

hard questBOT
topaz aurora
#

Hi there, can you elaborate more?

clear sable
#

okay

topaz aurora
#

Maybe you can use an example to walk me through

clear sable
#

we are utilizing stripe.js to gather card and billing information from customers and make setup intent confirmed, and pass the payment method id to backend to use stripe API for making subscription

#

since setup intent is confirmed already what backend site do is just make subscription with collection_method=charge_automatically, but when we make subscription with this option the invoice finalizes right after created

#

and the invoice is not editable after finalized, so we want to find a way to add description before finalized or way to delay the finalizing so we can edit it

topaz aurora
#

Got it, thanks for the context.

#

You can listen to the invoice.created event in your webhook endpoint. When this event happens, the invoice is still in draft mode so you can still update the description. Once that's done, you can call the finalize API to finalize the invoice

clear sable
#

oh great
so do we need to change collection_method other than charge_automatically?

topaz aurora
#

No need to change, you can keep it as charge_automatically

clear sable
#

but when we call subscription call with this
https://api.stripe.com/v1/subscriptions
we found that the invoice finalizes soon after without any other action, did you mean when we call to update invoice we can keep it as draft mode?

topaz aurora