使用 nodejs 调用 Stripe API 得到 total_count

Using nodejs calling Stripe API to get total_count

我将 Stripe 与 nodejs 结合使用来获取所有费用的列表,结果中包含 total_count。我这样称呼它:

stripe.charges.list({include: ['total_count'] }, cb)

但我从 API 返回以下错误:

Unhandled rejection Error: Invalid array

(省略 include 参数 returns 结果很好。)

我是否错误地指定了 include 参数?

我刚刚试了一下,这段代码按预期工作:

stripe.charges.list(
  { limit: 3 , "include[]": "total_count"},
  function(err, charges) {
    console.log("Charges : ", JSON.stringify(charges));
  }
);