admin管理员组文章数量:1122846
We use Stripe Payment Links and Entitlements to manage user payments and permissions in our application. Here’s how our system is set up:
- We map Stripe customer IDs to our internal user IDs.
- We store the entitlements of each user in a table.
Both of these tables are synced with Stripe webhooks. Additionally, we have some Payment Links set up with free trials.
Yesterday, I tested what happens when a trial expires:
- I created a Payment Link with a one-day free trial (in test mode).
- I successfully completed the payment process.
- The appropriate webhook events (
entitlements.active_entitlement_summary.updated
) were triggered, and the entitlements table was updated correctly.
However, 24 hours later, when the trial ended, I expected the entitlements to update accordingly, but they did not:
- Webhook events like
customer.subscription.paused
were triggered, but noentitlements.active_entitlement_summary.updated
events were fired. - As a result, the user's entitlements still showed as active, granting them access even though the trial had expired.
According to the Stripe documentation:
"During the lifecycle of a customer’s subscription, from activation, through upgrades, downgrades, and so on, Stripe updates the customer’s entitlements based on your mapped features. ... As long as a customer maintains an active subscription for a feature, they retain an active entitlement. Make sure you provision access in your system for any users entitled to this feature."
This behavior raises several questions:
- Will the entitlements be updated at a later time, or is this expected behavior?
- If not, what would the proper way to handle trials in my case be?
- Should we expect
entitlements.active_entitlement_summary.updated
events to fire when a subscription is canceled, paused, or deleted? - If we need to sync the subscription status in a separate table anyways, does this not defeat the point of "Simplifing your billing integration"?
Any insights into how Stripe handles entitlements in these situations and the best practices for managing access control would be greatly appreciated! I already looked through the relevant docs and I found nothing about this behaviour.
本文标签: subscriptionStripe Entitlements are not updated after Trial endsStack Overflow
版权声明:本文标题:subscription - Stripe: Entitlements are not updated after Trial ends - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736309126a1933906.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论