#Mahesh K

1 messages · Page 1 of 1 (latest)

olive cedarBOT
stone coyote
#

hello!

abstract garden
#

hi alex!

#

how are you?

#

how can we do paginaition while retreiving large data from stripe?

stone coyote
abstract garden
#

await stripe.customers.list().autoPagingEach(async (customer) => {
await doSomething(customer);
if (shouldBreak()) {
return false;
}
});
console.log('Done iterating.');

#

i didn't understand the terms in this code.

stone coyote
#

what specifically don't you understand?

abstract garden
#

i will tell what i am doing.

#

i am fetching list of all payouts and adding all the net amount.

#

by running a for loop for the response given by the payouts.list api.

stone coyote
#

alright, so what issues are you having when using auto pagination? what have you tried?

abstract garden
#

hey its done.

#

i mean its solved.

#

thanks..

abstract garden
#

alex😢

#

let balanceDeposited = 0
for await (const pay of stripe.payouts.list({limit:2})){
balanceDeposited += pay.amount /100
}

#

its not working

stone coyote
#

what's not working?

abstract garden
#

i am getting incorrect value.

stone coyote
#

for which parameter?

#

what value did you get? what value did you expect?

abstract garden
#

sorry

#

i forgot to mention my connect account id

#

let balanceDeposited = 0
for await (const pay of stripe.payouts.list({limit:2},{ stripeAccount: accountID })){
balanceDeposited += pay.amount /100
}

stone coyote
#

i'm sorry but i don't understand what's the issue. You're just pasting your code, but you're not explaining what is the issue - what value are you expecting to get, what did you get instead

abstract garden
abstract garden
# abstract garden sorry

but in this code i have included the stripe connect account id , then i am getting all the results that i want.

abstract garden
abstract garden
#

how to list all the failure charges.

stone coyote
abstract garden
#

alex, what is this charge??

#

{
"id": "txn_1MyqwJJFyf0NJAEUFguOsDU8",
"object": "balance_transaction",
"amount": -300,
"available_on": 1681971955,
"created": 1681971955,
"currency": "usd",
"description": "Connections Verification (2023-04-01 - 2023-04-30)",
"exchange_rate": null,
"fee": 0,
"fee_details": [],
"net": -300,
"reporting_category": "fee",
"source": null,
"status": "available",
"type": "stripe_fee"
},

stone coyote
#

we're not so familiar with Stripe fees here on this channel

abstract garden
#

ok alex