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,
lib/lithic/resources/financial_accounts/interest_tier_schedule.rb,
lib/lithic/resources/financial_accounts/loan_tape_configuration.rb

Defined Under Namespace

Classes: Balances, CreditConfiguration, FinancialTransactions, InterestTierSchedule, LoanTapeConfiguration, 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:



184
185
186
187
188
189
190
191
192
193
194
# File 'lib/lithic/resources/financial_accounts.rb', line 184

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)
  @loan_tape_configuration =
    Lithic::Resources::FinancialAccounts::LoanTapeConfiguration.new(client: client)
  @interest_tier_schedule = Lithic::Resources::FinancialAccounts::InterestTierSchedule.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

#interest_tier_scheduleLithic::Resources::FinancialAccounts::InterestTierSchedule (readonly)



25
26
27
# File 'lib/lithic/resources/financial_accounts.rb', line 25

def interest_tier_schedule
  @interest_tier_schedule
end

#loan_tape_configurationLithic::Resources::FinancialAccounts::LoanTapeConfiguration (readonly)



22
23
24
# File 'lib/lithic/resources/financial_accounts.rb', line 22

def loan_tape_configuration
  @loan_tape_configuration
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:



46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/lithic/resources/financial_accounts.rb', line 46

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:



116
117
118
119
120
121
122
123
124
125
126
127
# File 'lib/lithic/resources/financial_accounts.rb', line 116

def list(params = {})
  parsed, options = Lithic::FinancialAccountListParams.dump_request(params)
  query = Lithic::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "v1/financial_accounts",
    query: query,
    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:



142
143
144
145
146
147
148
149
150
151
# File 'lib/lithic/resources/financial_accounts.rb', line 142

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:



69
70
71
72
73
74
75
76
# File 'lib/lithic/resources/financial_accounts.rb', line 69

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:



89
90
91
92
93
94
95
96
97
98
# File 'lib/lithic/resources/financial_accounts.rb', line 89

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:, user_defined_status: nil, request_options: {}) ⇒ Lithic::Models::FinancialAccount

Update financial account status

Parameters:

Returns:

See Also:



170
171
172
173
174
175
176
177
178
179
# File 'lib/lithic/resources/financial_accounts.rb', line 170

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