Class: Finicity::Resources::Account

Inherits:
Base
  • Object
show all
Defined in:
lib/finicity/resources/account.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

#activate(institution_id, accounts) ⇒ Object



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

def activate(institution_id, accounts)
  endpoint = "/aggregation/v2/customers/#{customer_id}/institutions/#{institution_id}/accounts"

  request(:put, endpoint, body: { accounts: accounts })
end

#add_all(institution_id, credentials) ⇒ Object



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

def add_all(institution_id, credentials)
  endpoint = "/aggregation/v1/customers/#{customer_id}/institutions/#{institution_id}/accounts/addall"
  body = { credentials: credentials }

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

#add_all_mfa(institution_id, mfa_session, questions) ⇒ Object



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

def add_all_mfa(institution_id, mfa_session, questions)
  endpoint = "/aggregation/v1/customers/#{customer_id}/institutions/#{institution_id}/accounts/addall/mfa"
  body = { mfa_challenges: { questions: questions } }
  headers = { "MFA-Session" => mfa_session }

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

#credentials(account_id) ⇒ Object



58
59
60
61
62
# File 'lib/finicity/resources/account.rb', line 58

def credentials()
  endpoint = "/aggregation/v1/customers/#{customer_id}/accounts/#{}/loginForm"

  request(:get, endpoint)
end

#delete(account_id) ⇒ Object



52
53
54
55
56
# File 'lib/finicity/resources/account.rb', line 52

def delete()
  endpoint = "/aggregation/v1/customers/#{customer_id}/accounts/#{}"

  request(:delete, endpoint)
end

#get(account_id) ⇒ Object



46
47
48
49
50
# File 'lib/finicity/resources/account.rb', line 46

def get()
  endpoint = "/aggregation/v1/customers/#{customer_id}/accounts/#{}"

  request(:get, endpoint)
end

#listObject



19
20
21
22
23
# File 'lib/finicity/resources/account.rb', line 19

def list
  endpoint = "/aggregation/v1/customers/#{customer_id}/accounts"

  request(:get, endpoint)
end

#owner_verification(account_id) ⇒ Object



71
72
73
74
75
# File 'lib/finicity/resources/account.rb', line 71

def owner_verification()
  endpoint = "/decisioning/v1/customers/#{customer_id}/accounts/#{}/owner"

  request(:get, endpoint)
end

#owner_verification_mfa(account_id, mfa_session, questions) ⇒ Object



77
78
79
80
81
82
83
84
# File 'lib/finicity/resources/account.rb', line 77

def owner_verification_mfa(, mfa_session, questions)
  endpoint = "/decisioning/v1/customers/#{customer_id}/accounts/#{}/owner/mfa"

  body = { questions: questions }
  headers = { "MFA-Session" => mfa_session }

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

#refresh(institution_login_id) ⇒ Object



31
32
33
34
35
# File 'lib/finicity/resources/account.rb', line 31

def refresh()
  endpoint = "/aggregation/v1/customers/#{customer_id}/institutionLogins/#{}/accounts"

  request(:post, endpoint)
end

#refresh_mfa(institution_login_id, mfa_session, questions) ⇒ Object



37
38
39
40
41
42
43
44
# File 'lib/finicity/resources/account.rb', line 37

def refresh_mfa(, mfa_session, questions)
  endpoint = "/aggregation/v1/customers/#{customer_id}/institutionLogins/#{}/accounts/mfa"

  body =  { questions: questions }
  headers = { "MFA-Session" => mfa_session }

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

#update_credentials(institution_login_id, credentials) ⇒ Object



64
65
66
67
68
69
# File 'lib/finicity/resources/account.rb', line 64

def update_credentials(, credentials)
  endpoint = "/aggregation/v1/customers/#{customer_id}/institutionLogins/#{}"
  body = { login_form: credentials }

  request(:put, endpoint, body: body)
end