Class: PFS::API::StatementsService

Inherits:
Service
  • Object
show all
Defined in:
lib/pfs/api/statements_service.rb

Instance Attribute Summary

Attributes inherited from Service

#client

Instance Method Summary collapse

Methods inherited from Service

#initialize

Constructor Details

This class inherits a constructor from PFS::API::Service

Instance Method Details

#by_id(account_id:, statement_id:, inward_outward:, processor:) ⇒ Object



6
7
8
9
10
11
# File 'lib/pfs/api/statements_service.rb', line 6

def by_id(account_id:, statement_id:, inward_outward:, processor:)
  response = client.get(
    "/BankPayment/#{}/StatementById?statementitemid=#{statement_id}&InwardOutward=#{inward_outward}&Processor=#{processor}"
  )
  Resources::Statements::Statement.new(response, response.body.dig(:data, :transaction))
end

#history(account_id:, start_date:, end_date:, inward_outward:, processor:) ⇒ Object



13
14
15
16
17
18
# File 'lib/pfs/api/statements_service.rb', line 13

def history(account_id:, start_date:, end_date:, inward_outward:, processor:)
  response = client.get(
    "/BankPayment/#{}/Statement?StartDate=#{start_date}&EndDate=#{end_date}&InwardOutward=#{inward_outward}&Processor=#{processor}"
  )
  Resources::Statements::Statements.new(response, response.body.dig(:data, :transactions))
end