Class: Finicity::V1::Request::GetTransactions

Inherits:
Object
  • Object
show all
Extended by:
HTTPClient::IncludeClient
Includes:
Logger
Defined in:
lib/finicity/v1/request/get_transactions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Logger

#log_request, #mask_body

Constructor Details

#initialize(token, customer_id, account_id, from_date, to_date) ⇒ GetTransactions

Instance Methods



22
23
24
25
26
27
28
# File 'lib/finicity/v1/request/get_transactions.rb', line 22

def initialize(token, customer_id, , from_date, to_date)
  @account_id = 
  @customer_id = customer_id
  @from_date = from_date
  @to_date = to_date
  @token = token
end

Instance Attribute Details

#account_idObject

Attributes



13
14
15
# File 'lib/finicity/v1/request/get_transactions.rb', line 13

def 
  @account_id
end

#customer_idObject

Attributes



13
14
15
# File 'lib/finicity/v1/request/get_transactions.rb', line 13

def customer_id
  @customer_id
end

#from_dateObject

Attributes



13
14
15
# File 'lib/finicity/v1/request/get_transactions.rb', line 13

def from_date
  @from_date
end

#to_dateObject

Attributes



13
14
15
# File 'lib/finicity/v1/request/get_transactions.rb', line 13

def to_date
  @to_date
end

#tokenObject

Attributes



13
14
15
# File 'lib/finicity/v1/request/get_transactions.rb', line 13

def token
  @token
end

Instance Method Details

#get_transactionsObject



30
31
32
# File 'lib/finicity/v1/request/get_transactions.rb', line 30

def get_transactions
  http_client.get(url, query, headers)
end

#headersObject



34
35
36
37
38
39
40
# File 'lib/finicity/v1/request/get_transactions.rb', line 34

def headers
  {
    'Finicity-App-Key' => ::Finicity.config.app_key,
    'Finicity-App-Token' => token,
    'Content-Type' => 'application/xml'
  }
end

#queryObject



42
43
44
# File 'lib/finicity/v1/request/get_transactions.rb', line 42

def query
  { :fromDate => from_date, :toDate => to_date }
end

#urlObject



46
47
48
49
50
51
52
53
54
55
56
# File 'lib/finicity/v1/request/get_transactions.rb', line 46

def url
  ::URI.join(
    ::Finicity.config.base_url,
    'v1/',
    'customers/',
    "#{customer_id}/",
    'accounts/',
    "#{}/",
    'transactions'
  )
end