#kikko088_subscription-webhook-events

1 messages ยท Page 1 of 1 (latest)

slate cipherBOT
#

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

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

sacred depot
#

Hello

#

There is a 1 hour delay for renewal Invoices before they finalize/charge.

#

You don't need to wait a day to test.

#

Lastly, I'd recommend not using invoice.paid at all here.

#

Instead, you should just listen to customer.subscription.updated

#

That will fire each time the Subscription cycles

#

And you just look at the status of the Subscription based on that Webhook

uncut mountain
#

mmm but so I should update my subscription locally before the payment has been received?

#

what is the payment fails? I know I can delete the new subscription in my local db but I'd give 1h for free?

#

given in a rel world the subs is monlty, 1h for free is not a big deal, but it is logically wrong

sacred depot
#

Can you share the Subscription ID you tested with?

uncut mountain
#

sub_1QrKUnRVLdRWMHyQyFEObIhD

#

the event has 20 Feb, 14:32 as starting date, I've received the event at 15:32

slate cipherBOT
uncut mountain
#

and this is the event id evt_1Qubk5RVLdRWMHyQWMKr1NEJ

sacred depot
#

So yeah, as I mentioned if you don't want to potentially have that 1 hour period be "free" then you should force payment using the API when you receive invoice.created or customer.subscription.updated

slate cipherBOT
uncut mountain
#

ok, is there a reason why you have this 1h delay? whats the best practice in generale to manage subs renewal?

slate cipherBOT
sacred oracle
#

Hi ๐Ÿ‘‹

i'm stepping in as my colleague has to go

#

The 1 hour draft status is intended to allow merchants to modify the generated Invoice prior to when it if finalized and we attempt to charge the customer

uncut mountain
#

shouldn't be better to create the invoice 1h earlier and finalize it when the subs period ends?

sacred oracle
#

I don't currently have access to the documentation where that was discussed but I strongly suspect that was debated internally.

#

To be clear, the billing period still covers that hour

uncut mountain
#

ok, I'll have a look and find the best solution for this, thanks for the feedback!

sacred oracle
#

Sure thing! We recognize that our defaults might not be the best fit for all individual use cases so we try to provide enough other actions you can take so you can tailor your integration to fit your needs.