#rraut-pagination
1 messages ยท Page 1 of 1 (latest)
Hello! We give examples of how to do this here: https://stripe.com/docs/api/pagination/auto?lang=ruby
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
After auto paging result still says has_more: true. Why is that ?
Rather then using block I just called auto paging on object like this @visual starnsaction.auto_paging_each
Can you clarify what you mean? What exactly does your code look like?
So I get all balance transactions like this Stripe::BalanceTransaction.list(some id).auto_paging_each
So I was expecting to get all the transactions
But it return has_more: true
So tat means there r more items needs to be paginated ?
Can share your exact code - specifically, I want to see what your printing/logging that's showing has_more: true
I need to head out, but if you have any follow up questions @quartz yarrow r can help!
๐ Taking over this thread
@transactions is the first page. auto_paging_each will continue the retrieve remaining object one by one from @transactions.
Sample code will be:
customers = Stripe::Customer.list({limit: 3})
customers.auto_paging_each do |customer|
# Do something with customer
end
Ya seen tat. Donโt need to pass block. Works fine without block as well. But it return incorrect value has_many: true.
After auto pagination has_many should return false.
Auto-pagination here will continue looping inside the do function until whole list ends. You should not assign @transactions.auto_paging_each to a variable as it's still iterating
auto_paging_each supports iterating the object individually and does not return whole list
Ok thanks
No problem! Happy to help ๐
Will modify my code