#Scott-pagination

1 messages · Page 1 of 1 (latest)

cerulean finch
#

Hi! Yes it should. Why are you asking this question, are you having an issue?

cedar umbra
#

It's a question but when I use it I am calculating the total volume and it's different to what I see on stripe dashboard

#

On stripe dashboard I see €103.88
Where on my website I see: €91.61

cerulean finch
#

You mean the "gross volume" showed on the dashboard main page?

#

Could you share the code you wrote to compute the volume?

cedar umbra
#

Excuse my stupid question.. that 103 was gross..

#

[code]
public async Task<IActionResult> TestBalance()
{
ConnectAccount acc = GetConnectAccount();

        var service = new BalanceTransactionService();
        var requestOptions = new RequestOptions();
        requestOptions.StripeAccount = AppEncryption.Decrypt(acc.StripeAccountID);

        var options = new BalanceTransactionListOptions{
            Limit = 100,
            Type = "charge"
        };

        List<BalanceTransaction> balance = await GetAllBalances();

        long bal = 0;
        await foreach(var _bal in service.ListAutoPagingAsync(options, requestOptions))
        {
            bal = bal + _bal.Net;
        }

        return new JsonResult(bal);
    }

[code]

#

Apologies for wasting your time on that one.

#

I was looking at the Connect Account without going into the connect account dashboard

cerulean finch
#

No worries! So you managed to fix your issue?

cedar umbra
#

I did indeed, thank you. My last question will be, if there is say 10000 charges on a connected account, this method of getting the balance should work fine?

#

Might take a while to gather them all but overall it should work to get every balance transaction

cerulean finch
#

This should work yes! But let me check if there's a better way.

cedar umbra
#

No problem, thank you

#

Maybe the Balance object would be better?

#

Then use the ListAutoPagingAsync for payouts or listing transactions