invoice.payment_succeeded 的身份第一个 Stripe webhook
Identity first Stripe webhook for invoice.payment_succeeded
当我使用 Stripe 设置订阅时,会触发类型为 "invoice.payment_succeeded" 的 webhook。
有没有办法判断这个webhook是不是第一个?
您可以查看您收到的 invoice.payment_succeeded
事件的 event.request.id
属性。
https://stripe.com/docs/api/events/object#event_object-request-id
当事件被自动续订触发时 event.request.id
将是 null
。当由 API 请求触发(开始订阅)时,event.request.id
的值将包含一个请求 ID (req_xxyyyzzz
)。
当我使用 Stripe 设置订阅时,会触发类型为 "invoice.payment_succeeded" 的 webhook。
有没有办法判断这个webhook是不是第一个?
您可以查看您收到的 invoice.payment_succeeded
事件的 event.request.id
属性。
https://stripe.com/docs/api/events/object#event_object-request-id
当事件被自动续订触发时 event.request.id
将是 null
。当由 API 请求触发(开始订阅)时,event.request.id
的值将包含一个请求 ID (req_xxyyyzzz
)。