#benjamin_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/1433398363654717552
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
hi
So, yeah i don't know what i'm supposed to do in that situation
will be with you shortly, please bear with me
๐
there's only one entitlement for this customer
what are you expecting? and what are you seeing?
yes, however it's sometimes not returned when i call the "list all active entitlements" while processing the webhook for the subscription:created
My current workflow is that i'm only listening to the subscription events (subscription created / updated), then i fetch the active entitltments of the user while processing the webhook.
But it seems like i sometimes get 0 result on the call
why don't you just listen to the entitlements.active_entitlement_summary.updated e.g. https://dashboard.stripe.com/test/events/evt_1SNsbsBXlS1Nu3ssTk3EW11B ?
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
I could, but then it would mean that i would have a weird state in between the two webhook calls
My user would be in a subscribed state, but without any information regarding the entitlements
(or at least any valid information)
or you can keep the subscription pending until you receive the entitlements.active_entitlement_summary.updated event
I would have to do that. However, is there a guarantee that i will receive webhook events in that specific order, all the time ? First the subscription, THen the update of the entitlements ?
Yeah, that's what i thought. So, it adds a lot to the complexity of the state machine on my side.
That's why i wanted to know first if this lag between subscription webhook event, and the update of the entitlements on stripe's side was an expected behavior or just a sandbox artifact
I think it's not a sandbox issue
ok, i'll have to think of something then..
Maybe i could just see which entitltemsnt are associated to the product of the subscription, and then use that ?
Is there any other reason why a user's entitlement would change, beyond an update to the subscription ?
if you attach new product features or remove them
the idea behind entitlements is not to have to update the subscription and change the price in order to control which features a customer should have
yeah, i understand that, but the fact that they're not updated atomically for a user makes it harder to use..
Yes, that's an issue in my case.. But it's ok, i'll just fetch the product's configuration
and do the logic on my side