简体   繁体   English

使用nodejs调用Stripe API来获取total_count

[英]Using nodejs calling Stripe API to get total_count

I am using Stripe with nodejs to get a list of say all the charges, with the total_count included in the results. 我正在将Stripe与nodejs一起使用以获取所有费用的清单,结果中包含total_count。 I call it like this: 我这样称呼它:

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

But I get the following error back from the API: 但是我从API收到以下错误:

Unhandled rejection Error: Invalid array

(Leaving off the include parameter returns the results fine.) (不包括include参数可以使结果正常。)

Am I specifying the include parameter incorrectly? 我是否错误地指定了include参数?

I just tried on my end and this code worked as expected: 我只是尽力而为,此代码按预期工作:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM