#andrea-skuola-pagination
1 messages · Page 1 of 1 (latest)
You should use the auto pagination feature in our client libraries: https://stripe.com/docs/api/pagination/auto
ok and if I limit to 3 records $subscriptions = $stripe->subscriptions->all(['limit' => 3]);
and use this foreach ($subscriptions->autoPagingIterator() as $subscription){
why am i getting more than 3 results?
Because the iterator will continue making API requests for a limit of 3 at a time
ok, so if i want only 3 i need to remove the autoIterator
You just don't need to paginate if you only want the most recent 3
ok, because i'm creating a command and probably i need this two behaviors
so I wanted to use the same foreach
changing only the subscription passed
an execution probably with all subscription, and another execution probably with only 3 or less
Does that unblock you then?
what?