针对订阅 ID 查找 invoice.payment_succeeded

Find invoice.payment_succeeded against subscription id

我的网站宕机了一个星期,这一周订阅分期付款很少。但是我的网站没有捕捉到这个(使用 web hook for invoice.payment_succeeded)。

我已经查询了我的数据库并且有订阅 ID。 但是我如何获得触发 invoice.payment_succeeded 的事件。这样我就可以将相同的方法传递给 web-hook 方法,数据库将被更新。

https://api.stripe.com/v1/events?created=1565706893&type=invoice.payment_succeeded

并在该日期为 invoice.payment_succeeded 响应触发事件。

但有时,我找不到在 "paid_at" 期间创建的任何事件:1565706893,值。 我在这里错过了什么。或者是否有任何替代解决方案可以使用订阅 ID.

查找类型 invoice.payment_succeeded 的事件 ID

https://api.stripe.com/v1/subscriptions/sub_XXXXXX 只会获取 latest_invoice id。您确定您使用了正确的发票编号吗?

如果您只想关联事件 ID,也可以试试这个 https://api.stripe.com/v1/events?related_object= SUBSCRIPTIONID&type=invoice.payment_succeeded

在这里您可以找到为特定订阅创建的所有成功事件。希望对你有帮助。(不知道是不是官方的,没找到,你可以试试)