#xfechx

1 messages · Page 1 of 1 (latest)

thorn boltBOT
quiet barn
#

There's not a way to change the sort order

azure ether
#

ok

#

what is the limit

#

of stripe transactions I can pull?

#

from a single API call?

#

this is my call

quiet barn
azure ether
#
      'created' => [
          'gte' => strtotime($startDate),
          'lt' => strtotime($endDate) + 86400 // Add 1 day to include payments on the end date
      ],
      'limit' => 100, 
      
      expand => [
      
    'data.source.customer',
          'data.source.payment_intent',
          'data.source.invoice',
      ]
    ], $connected_account
  );```
quiet barn
#

If you need more than 100 you can use auto pagination

azure ether
#

I don't really understand it

#

so

#

my next snippet is

#

foreach ($balance_transactions->data as $payment) {

#

where should I use the autoPagingIterator()

#

and I need to produce them on chronological order, is that impossible?

quiet barn
#

They should show with most recent at the top

#

Just convert the example I sent with customers to balance_transactions

#

It should functionally be the same

#

$transactions = $stripe->balanceTransactions->all(['limit' => 3]);
foreach ($transactions->autoPagingIterator() as $transaction) {
// Do something with $transaction
}

#

Something like that

#

But play around with it

azure ether
#

my specific example is

#
      'created' => [
          'gte' => strtotime($startDate),
          'lt' => strtotime($endDate) + 86400 // Add 1 day to include payments on the end date
      ],
      'limit' => 100, 
      //'expand'=>['data.source']
      expand => [
          'data.source.customer',
          'data.source.payment_intent',
          'data.source.invoice',
      ]
    ], $connected_account
  );```
#

so first thing, I would like to have the oldest ones first, recent one later. Because I need to generate a tax document for each balance transaction, and they should be numbered in an orderly manner. With 1 being the oldest, and x being the newest

#

also, I need to retrieve more than 100.

#

I need to obtain data from the balance transactions, so not sure where to add the paginator. My code is:

.... 
} ```
quiet barn
#

your for each should look like this then:

foreach($balance_transactions->autoPagingIterator() as $transaction)
  // do something for transaction
}```
#

Recommend you just try things

#

And you can't sort oldest to newest

azure ether
#

really? so if I have to generate documents to complain with tax, and cannot sort oldest to newest am I in a dead end?

#

also, the code, is just the code appearing in the API, but I really need help with my specific scenario

#

for autoPagingIterator

#

are you a php dev ?

quiet barn
azure ether
#

so you are just replacing data for autopaingIterator

quiet barn
#

You can change the order once you've processed things

quiet barn
#

Oh also I was wrong about the order

#

With autopagination you can do chronological which is what you're after

#

One sec