lib/moip2/invoice_api.rb in moip2-0.1.4 vs lib/moip2/invoice_api.rb in moip2-1.0.0
- old
+ new
@@ -1,7 +1,6 @@
module Moip2
-
class InvoiceApi
attr_reader :client
def initialize(client)
@client = client
@@ -22,11 +21,17 @@
def update(invoice_external_id, invoice)
Resource::Invoice.new client, client.put("#{base_path}/#{invoice_external_id}", invoice)
end
def list(begin_date, end_date)
- Resource::Invoice.new client, client.get("#{base_path}?begin=#{begin_date}&end=#{end_date}")
+ find_all(begin_date: begin_date, end_date: end_date)
end
+ def find_all(email: nil, begin_date: nil, end_date: nil, limit: 20, offset: 0)
+ Resource::Invoice.new(
+ client,
+ client.get("#{base_path}?email=#{email}&begin=#{begin_date}"\
+ "&end=#{end_date}&limit=#{limit}&offset=#{offset}"),
+ )
+ end
end
-
end