#xfechx
1 messages · Page 1 of 1 (latest)
There's not a way to change the sort order
ok
what is the limit
of stripe transactions I can pull?
from a single API call?
this is my call
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
'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
);```
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?
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
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:
....
} ```
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
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 ?
Our api lists them newest to oldest. What you do with that data afterward is up to you
so you are just replacing data for autopaingIterator
You can change the order once you've processed things
Yes recommend you try it to understand how it behaves
Oh also I was wrong about the order
With autopagination you can do chronological which is what you're after
One sec