#neha_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/1240823310950858843
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
i don't want this 1h draft thing
Hi, sorry it's by design and it's the window for you to add any additional/extra invoice item to that Invoice
can i get rid of it programatically? its causing a lot of confusion and headache
my customers see that their sub will be renewed at noon and they want their new credits at noon
(for example)
but it takes till 1pm
I am temped to ask what is confusion and headache, but yes you can listen to webhook event invoice.created and call the Finalize Invoice API programmatically
i'm already listening to:
"customer.subscription.updated"
is it possible to use that? should i?
"checkout.session.completed":
"customer.subscription.created":
"customer.subscription.updated":
"customer.subscription.deleted":
"invoice.paid":
"invoice.payment_failed":
"payment_intent.succeeded":
"charge.refunded":
"charge.refund.updated":
these are the ones i listen to
const data = event.data.object;
stripe.invoices.finalizeInvoice(data.id, { auto_advance: true });
}```
is this all i need?
i cant figure out how to resend the webhook from the workbench in test mode
and i can't figure out where to add a new event to listen to
the workbench ui is kinda confusing
hi can you please help?
i just want to resend the invoice.created webhook in test mode
cannot figure out how with this UI
๐
Sure but invoice.created is the event when the Invoice is first created, and started waiting for 1 hour to be finalized
And yes the code looks correct
please test it in Test mode
i was trying to but i coulnd't resend the event
there was no resend butotn
so now ihave to start over.
Are you at this page?
There is a "Resend" button
there is not a resend button
evt_1PHFEuBZ8IchjqOer06M5xAl
can i go back to the old UI?
i'm wasting time on this.
ive never done it before, how do i do it
download Stripe CLI on your computer
this is what i see btw
Oh I see, that's because you never listen to that event hence we never sent it
The Resend button is only for sent but failed events
So you may not be able to trigger a past event that you never received
using Stripe CLI, just type stripe listen
stripe listen --forward-to localhost:4200/api/stripe
yeah i have that
2024-05-16 21:24:10 <-- [200] POST http://localhost:4200/api/stripe [evt_1PHFWoBZ8IchjqOeWBwnzwzN]
2024-05-16 21:24:10 --> customer.subscription.created [evt_1PHFWoBZ8IchjqOeU2NQURFI]
2024-05-16 21:24:10 <-- [200] POST http://localhost:4200/api/stripe [evt_1PHFWoBZ8IchjqOeU2NQURFI]
2024-05-16 21:24:48 --> invoice.upcoming [evt_1PHFXQBZ8IchjqOemXUmeUJw]
2024-05-16 21:24:48 <-- [200] POST http://localhost:4200/api/stripe [evt_1PHFXQBZ8IchjqOemXUmeUJw]
i see stuff
but it doesnt seem to send
ok i had to add
if (data.id != null && data.status === "draft") {
await stripe.invoices.finalizeInvoice(data.id, {
auto_advance: true,
});
}```
otherwise got this: Error: This invoice is already finalized, you can't re-finalize a non-draft invoice.
ok it didn't work, it just moved the invoice from Draft to Open
how do i make the customer pay
Okie you can call an additional Pay Invoice API