Class: Lithic::Resources::FinancialAccounts

Inherits:
Object
  • Object
show all
Defined in:
lib/lithic/resources/financial_accounts.rb,
lib/lithic/resources/financial_accounts/balances.rb,
lib/lithic/resources/financial_accounts/loan_tapes.rb,
lib/lithic/resources/financial_accounts/statements.rb,
lib/lithic/resources/financial_accounts/credit_configuration.rb,
lib/lithic/resources/financial_accounts/statements/line_items.rb,
lib/lithic/resources/financial_accounts/financial_transactions.rb

Defined Under Namespace

Classes: Balances, CreditConfiguration, FinancialTransactions, LoanTapes, Statements

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ FinancialAccounts

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of FinancialAccounts.

Parameters:



175
176
177
178
179
180
181
182
# File 'lib/lithic/resources/financial_accounts.rb', line 175

def initialize(client:)
  @client = client
  @balances = Lithic::Resources::FinancialAccounts::Balances.new(client: client)
  @financial_transactions = Lithic::Resources::FinancialAccounts::FinancialTransactions.new(client: client)
  @credit_configuration = Lithic::Resources::FinancialAccounts::CreditConfiguration.new(client: client)
  @statements = Lithic::Resources::FinancialAccounts::Statements.new(client: client)
  @loan_tapes = Lithic::Resources::FinancialAccounts::LoanTapes.new(client: client)
end

Instance Attribute Details

#balancesLithic::Resources::FinancialAccounts::Balances (readonly)



7
8
9
# File 'lib/lithic/resources/financial_accounts.rb', line 7

def balances
  @balances
end

#credit_configurationLithic::Resources::FinancialAccounts::CreditConfiguration (readonly)



13
14
15
# File 'lib/lithic/resources/financial_accounts.rb', line 13

def credit_configuration
  @credit_configuration
end

#financial_transactionsLithic::Resources::FinancialAccounts::FinancialTransactions (readonly)



10
11
12
# File 'lib/lithic/resources/financial_accounts.rb', line 10

def financial_transactions
  @financial_transactions
end

#loan_tapesLithic::Resources::FinancialAccounts::LoanTapes (readonly)



19
20
21
# File 'lib/lithic/resources/financial_accounts.rb', line 19

def loan_tapes
  @loan_tapes
end

#statementsLithic::Resources::FinancialAccounts::Statements (readonly)



16
17
18
# File 'lib/lithic/resources/financial_accounts.rb', line 16

def statements
  @statements
end

Instance Method Details

#create(nickname:, type:, account_token: nil, is_for_benefit_of: nil, idempotency_key: nil, request_options: {}) ⇒ Lithic::Models::FinancialAccount

Create a new financial account

Parameters:

Returns:

See Also:



40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/lithic/resources/financial_accounts.rb', line 40

def create(params)
  parsed, options = Lithic::FinancialAccountCreateParams.dump_request(params)
  header_params = {idempotency_key: "idempotency-key"}
  @client.request(
    method: :post,
    path: "v1/financial_accounts",
    headers: parsed.slice(*header_params.keys).transform_keys(header_params),
    body: parsed.except(*header_params.keys),
    model: Lithic::FinancialAccount,
    options: options
  )
end

#list(account_token: nil, business_account_token: nil, type: nil, request_options: {}) ⇒ Lithic::Internal::SinglePage<Lithic::Models::FinancialAccount>

Retrieve information on your financial accounts including routing and account number.

Parameters:

  • account_token (String)

    List financial accounts for a given account_token or business_account_token

  • business_account_token (String)

    List financial accounts for a given business_account_token

  • type (Symbol, Lithic::Models::FinancialAccountListParams::Type)

    List financial accounts of a given type

  • request_options (Lithic::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



110
111
112
113
114
115
116
117
118
119
120
# File 'lib/lithic/resources/financial_accounts.rb', line 110

def list(params = {})
  parsed, options = Lithic::FinancialAccountListParams.dump_request(params)
  @client.request(
    method: :get,
    path: "v1/financial_accounts",
    query: parsed,
    page: Lithic::Internal::SinglePage,
    model: Lithic::FinancialAccount,
    options: options
  )
end

#register_account_number(financial_account_token, account_number:, request_options: {}) ⇒ nil

Register account number

Parameters:

  • financial_account_token (String)

    Globally unique identifier for financial account.

  • account_number (String)
  • request_options (Lithic::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

  • (nil)

See Also:



135
136
137
138
139
140
141
142
143
144
# File 'lib/lithic/resources/financial_accounts.rb', line 135

def (, params)
  parsed, options = Lithic::FinancialAccountRegisterAccountNumberParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["v1/financial_accounts/%1$s/register_account_number", ],
    body: parsed,
    model: NilClass,
    options: options
  )
end

#retrieve(financial_account_token, request_options: {}) ⇒ Lithic::Models::FinancialAccount

Get a financial account

Parameters:

Returns:

See Also:



63
64
65
66
67
68
69
70
# File 'lib/lithic/resources/financial_accounts.rb', line 63

def retrieve(, params = {})
  @client.request(
    method: :get,
    path: ["v1/financial_accounts/%1$s", ],
    model: Lithic::FinancialAccount,
    options: params[:request_options]
  )
end

#update(financial_account_token, nickname: nil, request_options: {}) ⇒ Lithic::Models::FinancialAccount

Update a financial account

Parameters:

  • financial_account_token (String)
  • nickname (String)
  • request_options (Lithic::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



83
84
85
86
87
88
89
90
91
92
# File 'lib/lithic/resources/financial_accounts.rb', line 83

def update(, params = {})
  parsed, options = Lithic::FinancialAccountUpdateParams.dump_request(params)
  @client.request(
    method: :patch,
    path: ["v1/financial_accounts/%1$s", ],
    body: parsed,
    model: Lithic::FinancialAccount,
    options: options
  )
end

#update_status(financial_account_token, status:, substatus:, request_options: {}) ⇒ Lithic::Models::FinancialAccount

Update financial account status

Parameters:

Returns:

See Also:



161
162
163
164
165
166
167
168
169
170
# File 'lib/lithic/resources/financial_accounts.rb', line 161

def update_status(, params)
  parsed, options = Lithic::FinancialAccountUpdateStatusParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["v1/financial_accounts/%1$s/update_status", ],
    body: parsed,
    model: Lithic::FinancialAccount,
    options: options
  )
end