Class: Finicity::Resources::Transaction

Inherits:
Base
  • Object
show all
Defined in:
lib/finicity/resources/transaction.rb

Instance Attribute Summary

Attributes inherited from Base

#customer_id

Instance Method Summary collapse

Methods inherited from Base

#initialize, request

Constructor Details

This class inherits a constructor from Finicity::Resources::Base

Instance Method Details

#list(from:, to:, params: {}) ⇒ Object



4
5
6
7
8
9
# File 'lib/finicity/resources/transaction.rb', line 4

def list(from:, to:, params: {})
  endpoint = "/aggregation/v3/customers/#{customer_id}/transactions"
  query = { from_date: from.to_time.to_i, to_date: to.to_time.to_i }.merge(params)

  request(:get, endpoint, query: query)
end

#list_for_account(account_id, from:, to:, params: {}) ⇒ Object



11
12
13
14
15
16
# File 'lib/finicity/resources/transaction.rb', line 11

def (, from:, to:, params: {})
  endpoint = "/aggregation/v3/customers/#{customer_id}/accounts/#{}/transactions"
  query = { from_date: from.to_time.to_i, to_date: to.to_time.to_i }.merge(params)

  request(:get, endpoint, query: query)
end

#load_historic(account_id) ⇒ Object



18
19
20
21
22
# File 'lib/finicity/resources/transaction.rb', line 18

def load_historic()
  endpoint = "/aggregation/v1/customers/#{customer_id}/accounts/#{}/transactions/historic"

  request(:post, endpoint)
end

#load_historic_mfa(account_id, mfa_session, questions) ⇒ Object



24
25
26
27
28
29
30
# File 'lib/finicity/resources/transaction.rb', line 24

def load_historic_mfa(, mfa_session, questions)
  endpoint = "/aggregation/v1/customers/#{customer_id}/accounts/#{}/transactions/historic/mfa"
  headers = { "MFA-Session" => mfa_session }
  body = { questions: questions }

  request(:post, endpoint, body: body, headers: headers)
end