Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't have support to start parameter when fetching subscriptions #32

Open
rodriggochaves opened this issue Aug 2, 2019 · 2 comments
Open

Comments

@rodriggochaves
Copy link

Hello!

Today Iugu API endpoint to fetch all subscriptions has a limitation of 100 items per response. To navigate between the pages, we should use a parameter start to move between the pages/items. But the Iugu::Subscription#fetch doesn't support this. Would be cool to add this.

@rodriggochaves
Copy link
Author

Is this library still maintained by Iugu?

@daronco
Copy link

daronco commented Feb 5, 2020

While it's not supported you can do something like this:

start = 0
limit = 100
total = 1
while start < total
  subscriptions = ::Iugu::Subscription.fetch("?start=#{start}&limit=#{limit}")
  start += limit
  total = subscriptions.total
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants