取消订阅时(而不是结束时)Fire Stripe webhook

问题描述 投票:0回答:1

在 Stripe 中,每当用户取消订阅时,我想触发一个 Webhook,例如在其他地方更新许可证的到期日期。

我看到

customer.subscription.deleted
仅在订阅实际终止时才被触发。 Webhook
customer.subscription.updated
也不会触发。

关于我应该听什么事件有什么提示吗?

stripe-payments
1个回答
0
投票

触发哪个 Webhook 事件取决于您是取消订阅 now(通过 此端点)还是通过更新订阅并设置

cancel_at
cancel_at_period_end
将其设置为将来取消.

如果现在取消,则

customer.subscription.deleted
将立即触发。如果稍后取消,
customer.subscription.updated
将立即触发(以反映更新的字段),一旦在指定时间戳取消,
customer.subscription.deleted
就会触发。

我们的文档对此行为进行了解释。

© www.soinside.com 2019 - 2024. All rights reserved.