Stripe Webhook没有返回user_id

时间:2016-07-07 03:07:45

标签: stripe-payments webhooks stripe-connect

我有一个网络应用程序正在通过oauth收听他们所连接的帐户的webhook,并且出于某种原因,每个进入的webhook都没有user_id属性。

{ 
  id: 'evt_18USWeLQuocIBkVl4x3RYTYn',
  object: 'event',
  api_version: '2016-06-15',
  created: 1467859564,
  data:
   { object:
      { id: 'ch_18USWdLQuocIBkVlfev2xN9n',
        object: 'charge',
        amount: 300,
        amount_refunded: 0,
        application_fee: null,
        balance_transaction: 'txn_18USWeLQuocIBkVlYKlhfYl7',
        captured: true,
        created: 1467859563,
        currency: 'usd',
        customer: null,
        description: '',
        destination: null,
        dispute: null,
        failure_code: null,
        failure_message: null,
        fraud_details: {},
        invoice: null,
        livemode: false,
        metadata: {},
        order: null,
        paid: true,
        receipt_email: null,
        receipt_number: null,
        refunded: false,
        refunds: [Object],
        shipping: null,
        source: [Object],
        source_transfer: null,
        statement_descriptor: null,
        status: 'succeeded' } },
  livemode: false,
  pending_webhooks: 2,
  request: 'req_8m0X3GgVB7IWpM',
  type: 'charge.succeeded'
}

1 个答案:

答案 0 :(得分:2)

可以设置两种不同类型的webhooks

  • "帐户" webhooks将收到您自己帐户中发生的事件

  • "连结" webhooks将接收连接到您平台的任何帐户上发生的事件

仅发送到" Connect" webhooks将包含user_id字段。

如果您在没有user_id字段的情况下收到活动,则表示该活动发生在您自己的帐户中,并通过"帐户"发送给您。终点而不是" Connect"端点。