#raghul-s_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/1285865497409093694
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi there, can you tell me what you want to achieve?
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.
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.
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
The invoice is in draft state when you receive a invoice.created event.
When does a invoice get paid (source: Automatic)? Is there specific time duration for it to get paid after invoice creation?
https://dashboard.stripe.com/acct_1HyM9RA2ulLQR3A9/test/events/evt_1Q086VA2ulLQR3A9yAP7Af0o
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
You can see in the logs https://dashboard.stripe.com/acct_1HyM9RA2ulLQR3A9/test/invoices/in_1Q08A0A2ulLQR3A9zbZ0J9Vg
Draft invoice was created at 15:38:09
Got paid on 15:38:14
Within 6seconds, a draft invoice got paid. We haven't finalised the invoice.
https://docs.stripe.com/billing/invoices/subscription#subscription-renewal
Here, second point says, it leaves for an hour in draft state.
In invoices I attached, it didn't wait for an hour
you're using a test clock so naturally you don't have to wait an hour
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?
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
Checking it out. BRB