#neha_api

1 messages ยท Page 1 of 1 (latest)

real wadiBOT
#

๐Ÿ‘‹ 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.

mild fulcrum
#

i don't want this 1h draft thing

ember coveBOT
mortal swift
#

Hi, sorry it's by design and it's the window for you to add any additional/extra invoice item to that Invoice

mild fulcrum
#

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

mortal swift
#

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

mild fulcrum
#

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

#

๐Ÿ‘‹

mortal swift
#

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

mild fulcrum
#

i was trying to but i coulnd't resend the event

#

there was no resend butotn

#

so now ihave to start over.

mortal swift
#

Are you at this page?

#

There is a "Resend" button

mild fulcrum
#

there is not a resend button

#

evt_1PHFEuBZ8IchjqOer06M5xAl

#

can i go back to the old UI?

#

i'm wasting time on this.

mortal swift
#

Okie can you just use Stripe CLI?

mild fulcrum
#

ive never done it before, how do i do it

mortal swift
#

download Stripe CLI on your computer

mild fulcrum
#

this is what i see btw

mortal swift
#

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

mild fulcrum
#

how do i listen in dev mode

#

i mean i am listening to everything

mortal swift
#

using Stripe CLI, just type stripe listen

mild fulcrum
#

stripe listen --forward-to localhost:4200/api/stripe

#

yeah i have that

#

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

mortal swift
#

Okie you can call an additional Pay Invoice API

mild fulcrum
#
            auto_advance: true,
          });
          await stripe.invoices.pay(data.id);```
#

like this? both?