#n1xx1n_meter-usage-update-speed

1 messages ¡ Page 1 of 1 (latest)

abstract pivotBOT
#

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

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

wraith matrix
#

Yeah it's not live and real time updates AFAIK.

#

For this case you should add an interceptor

#

for example in your integration and track the usage in // in Stripe

cosmic crystal
#

We do have an interceptor acting as a "billing service". Before allowing any usage, it checks with Stripe if the user has any outstanding payments and is allowed to use our product.

So let's say our limit is 10$. The user requests to use 20 units and the price per unit is 1$. The expected behaviour is that for each usage a metered event should be recorded. Meaning when the user gets to 10 usages the cost will be 10$ and the limit will be reached. For the 11th usage. When we check stripe, there should be already an invoice to be paid and that way we can block the user from further usage.

What actually happens is that the metered usage and the invoice creation does not happen fast enough for us to know when to block the user.

wraith matrix
#

Thanks for these additional details.

#

Yeah it's not acting in real time, that's why you should implement your own interceptor and implement these custom rules

abstract pivotBOT