#ykb-pagination
1 messages ยท Page 1 of 1 (latest)
You'd want to use https://stripe.com/docs/api/pagination/auto (leave the limit at 10 or even lower if the requests take too long individually)
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Hmm
Soo
Let me check ๐
I think that works
So limit as even : 1
Will be ignored by this function?
Just to make sure
The limit parameter will still be taken into account. If you set the limit to 3, then the auto-pagination feature will continue to fetch objects 3 at a time.
So how to make sure that in my query, I will get all transactions?
What language are you using, maybe it'll be easier if we look at some code.
PHP
Just to clarify
Im trying to get .CSV file with all my transactions
I know that Stripe offers this, but in wrong way in my case
Because Stripe Fee is as Column
And I need this as row
Alright, so the first part is to fetch a group of objects, such as:
$customers = $stripe->customers->all([ 'limit' => 3, ]);
This is where you provide the limit, which will control how many records are retrieved initially.
Then you use the auto-pagination feature as so:
foreach ($customers->autoPagingIterator() as $customer) { // Do something with $customer }
This will iterate through all objects (in this case customers) originally fetched, and when that list is exhausted it will fetch a new batch. Because the limit was set to 3 at the beginning it will fetch the records 3 at a time.
So if you want a complete list, then you'll need to append each object to another array/list as you iterate through them.
Yeah, I want complete list
For some reason I don't understand how to get complete list :/
You'd want to do something along these lines, you'd declare an array to hold all of your transactions and then put each transaction in it as you iterate through the auto-pagination. (Apologies if the syntax is off, my PHP is a touch rusty)
$customers = $stripe->customers->all([
'limit' => 3,
]);
foreach ($customers->autoPagingIterator() as $customer) {
array_push($allCustomers, $customer);
}```
I think now Understand Toby
Soo
This functions : ->autoPagingIterator()
Will "Fill" list (my array which I will paste to it)
But will it fill for sure?
I mean
Lets make an example
If I have 1000 transactions of my account
I set Limit to 10
Will autoPagingIterator() fill rest?
It will go through all 1000 transactions.
It'll go until there are no more records to fetch.