wirecardBrasil / moip-sdk-ruby

Cliente em Ruby para integração server-side com APIs Moip v2
MIT License
29 stars 27 forks source link

Allow params for entries request #89

Open edison opened 5 years ago

edison commented 5 years ago

Just allow to use LIMIT and OFFSET parameters for entries request as described on API docs: https://dev.wirecard.com.br/v2.0/reference#listar-todos-lan%C3%A7amentos

Without this it's impossible to get more than 20 entries through this SDK.

I had previously made a pull-request (#86) to fix this, but I couldn't reopen. So I'm giving the following code which works properly if you can make the change directly:

File: lib/moip2/entry_api.rb

You need to change the find_all method to the following:

def find_all(params = {})
  params = URI.encode_www_form params
  Resource::Entry.new client, client.get("#{base_path}?#{params}")
end