#raghul-s_api

1 messages ¡ Page 1 of 1 (latest)

sand cometBOT
#

👋 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/1285865497409093694

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

storm veldt
#

Hi there, can you tell me what you want to achieve?

half frigate
#

Hi Jack. We modify the invoice with custom coupons. And finalise it. In the above mentioned invoices, we were unable to add the custom coupons into the invoice as it is getting paid before even finalising.

storm veldt
#

I don't see any request to add a coupon to the invoice.

#

You should listen to invoice.created event, add coupon to the invoice and finalize it.

half frigate
#

We are doing the same, listening to the invoice event and add it. But before doing that. The invoice got paid

We have a check at our side that, only if the invoice is in draft state, we will add the custom coupon as a invoice line item.
since invoice got to Paid state already, we didn't tried adding the line item

storm veldt
#

The invoice is in draft state when you receive a invoice.created event.

half frigate
half frigate
vagrant elm
#

you're using a test clock so naturally you don't have to wait an hour

half frigate
#

So how much time does that wait for when I use a test clock?

And even if thats the case, why does it doesn't finalise from stripe end before getting paid?

vagrant elm
#

it doesn't wait, it simulates advancing time to the time of the clock

#

your clock is November 1st, this invoice finalized and was paid October 17th, so it's all in the past and simulated that way and all those events happen when we process the advancing of the clock

#

why does it doesn't finalise from stripe end before getting paid?
it does? evt_1Q08A7A2ulLQR3A9gSVbcIcy

half frigate
#

Checking it out. BRB

sand cometBOT