Class: Pluggy::Services::BillService

Inherits:
BaseService show all
Defined in:
lib/pluggy/services/other_services.rb

Instance Method Summary collapse

Methods inherited from BaseService

#initialize

Constructor Details

This class inherits a constructor from Pluggy::Services::BaseService

Instance Method Details

#list(account_id:) ⇒ Object

GET /bills. Scoped to one credit-card account.



37
38
39
40
41
42
# File 'lib/pluggy/services/other_services.rb', line 37

def list(account_id:)
  require_args!(account_id: )
  result = list_request("/bills", klass: Resources::Bill, accountId: )
  annotate_cycles!(result)
  result
end

#retrieve(id) ⇒ Object



44
45
46
47
# File 'lib/pluggy/services/other_services.rb', line 44

def retrieve(id)
  require_args!(id: id)
  object_request(:get, "/bills/#{id}", klass: Resources::Bill)
end

#transactions(bill, **options) ⇒ Object

Convenience mirroring Bill#transactions.



50
51
52
53
# File 'lib/pluggy/services/other_services.rb', line 50

def transactions(bill, **options)
  bill = retrieve(bill) unless bill.is_a?(Resources::Bill)
  bill.transactions(**options)
end