如何获得我的帐户在条纹(Node.js)的总收入?

我需要从条形支付网关获得我的帐户的总收入为每日,每周,每月,每年。 有没有办法在Node.js API中做到这一点?

我试过这个,

var stripe = require("stripe")( "sk_test_R8lnqjR3wPDwbMhsc2pti0yN" ); stripe.balance.retrieve(function(err, balance) { console.log(balance); }); 

但是这只会返回可用的金额。 我需要每天,每周,每月,每年明智的。

你可以使用条纹api来取消所有的交易 ,然后你可以计算你的结果每月一天等…

 var stripe = require("stripe")( "sk_test_BQokikJOvBiI2HlWgH4olfQ2" ); stripe.balance.listTransactions( { starting_after: startAt, //specify your start date ending_before: endAt, // specify your end date }, function(err, transactions) { // here sum the balance for the transactions });