You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I noticed when I set the limit option to 5 or any number for the list_account_invoices method, it gets ignored and returns all account invoices every time. Our Recurly sandbox account has around 40 invoices and all of them get returned each time. I'm not sure if I'm using the correct setup for params or not.
I've been caught off guard by this too, but it's by design. On all paginated APIs, the Ruby client will automatically iterate through all pages. The limit is only telling it how many records to fetch per page.
To get around this you could do something like:
invoices.each.each_with_index do |invoice, index|
puts "Invoice: #{invoice.number}"
break if index >= 4
end
Describe the bug
Hello, I noticed when I set the limit option to 5 or any number for the list_account_invoices method, it gets ignored and returns all account invoices every time. Our Recurly sandbox account has around 40 invoices and all of them get returned each time. I'm not sure if I'm using the correct setup for params or not.
To Reproduce
I used the example code found here and pass the limit option to params: Method: Recurly::Client#list_account_invoices
test_params = { limit: 5 }
invoices = @client.list_account_invoices( account_id: account_id, params: test_params )
invoices.each do |invoice| puts "Invoice: #{invoice.number}" end
Expected behavior
I expected at least 5 account invoices to be returned if the limit is set to 5.
Your Environment
The text was updated successfully, but these errors were encountered: