Module: Unit::Account::Deposit
- Defined in:
- lib/unit/models/account/account.rb,
lib/unit/models/account/deposit/list_account_params.rb,
lib/unit/models/account/deposit/account_owners_request.rb,
lib/unit/models/account/deposit/freeze_account_request.rb,
lib/unit/models/account/deposit/balance_history_request.rb,
lib/unit/models/account/deposit/close_deposit_account_request.rb,
lib/unit/models/account/deposit/patch_deposit_account_request.rb,
lib/unit/models/account/deposit/create_deposit_account_request.rb
Defined Under Namespace
Classes: AccountOwnersRequest, BalanceHistoryRequest, CloseDepositAccountRequest, CreateDepositAccountRequest, FreezeAccountRequest, ListAccountParams, PatchDepositAccountRequest
Constant Summary collapse
- ACCOUNT_LIST_LIMIT =
100
- ACCOUNT_LIST_OFFSET =
0
- BALANCE_HISTORY_LIMIT =
100
- BALANCE_HISTORY_OFFSET =
0
Class Method Summary collapse
-
.add_owners(account_id:, customers:) ⇒ UnitResponse, UnitError
Add account owners by calling Unit’s API.
-
.close_deposit_account(account_id:, reason:, fraud_reason: nil) ⇒ UnitResponse, UnitError
Close deposit account.
-
.create_deposit_account(deposit_product:, tags: nil, relationships: nil, idempotency_key: nil) ⇒ UnitResponse, UnitError
Create a deposit account.
-
.freeze_account(account_id:, reason:, reason_text: nil) ⇒ UnitResponse, UnitError
Freeze deposit account.
-
.get_balance_history(limit = BALANCE_HISTORY_LIMIT, offset = BALANCE_HISTORY_OFFSET, account_id: nil, customer_id: nil, since: nil, _until: nil) ⇒ UnitResponse, UnitError
Get account balance history by calling Unit’s API.
-
.get_deposit_account(account_id:) ⇒ Object
Get a deposit account by id.
-
.get_deposit_products(account_id:) ⇒ UnitResponse, UnitError
Get deposit products.
-
.limits(account_id:) ⇒ UnitResponse, UnitError
Limit a deposit account.
-
.list_deposit_accounts(limit: ACCOUNT_LIST_LIMIT, offset: ACCOUNT_LIST_OFFSET, customer_id: nil, tags: nil, status: nil, from_balance: nil, to_balance: nil, include: nil) ⇒ UnitResponse, UnitError
Listing deposit accounts.
-
.remove_owners(account_id:, customers:) ⇒ UnitResponse, UnitError
Remove account owners by calling Unit’s API.
-
.reopen_account(account_id:) ⇒ Object
Reopen deposit account.
-
.unfreeze_account(account_id:) ⇒ UnitResponse, UnitError
Unfreeze deposit account.
-
.update_deposit_account(account_id:, tags: nil, deposit_product: nil) ⇒ UnitResponse, UnitError
Update a deposit account.
Class Method Details
.add_owners(account_id:, customers:) ⇒ UnitResponse, UnitError
Add account owners by calling Unit’s API
140 141 142 143 |
# File 'lib/unit/models/account/account.rb', line 140 def add_owners(account_id:, customers:) request = AccountOwnersRequest.new(account_id, customers) Unit::Resource::AccountResource.add_owners(request) end |
.close_deposit_account(account_id:, reason:, fraud_reason: nil) ⇒ UnitResponse, UnitError
Close deposit account
37 38 39 40 |
# File 'lib/unit/models/account/account.rb', line 37 def close_deposit_account(account_id:, reason:, fraud_reason: nil) request = CloseDepositAccountRequest.new(account_id, reason, fraud_reason) Unit::Resource::AccountResource.close_account(request) end |
.create_deposit_account(deposit_product:, tags: nil, relationships: nil, idempotency_key: nil) ⇒ UnitResponse, UnitError
Create a deposit account
26 27 28 29 |
# File 'lib/unit/models/account/account.rb', line 26 def create_deposit_account(deposit_product:, tags: nil, relationships: nil, idempotency_key: nil) request = CreateDepositAccountRequest.new(deposit_product, , relationships, idempotency_key) Unit::Resource::AccountResource.create_account(request) end |
.freeze_account(account_id:, reason:, reason_text: nil) ⇒ UnitResponse, UnitError
Freeze deposit account
63 64 65 66 |
# File 'lib/unit/models/account/account.rb', line 63 def freeze_account(account_id:, reason:, reason_text: nil) request = FreezeAccountRequest.new(account_id, reason, reason_text) Unit::Resource::AccountResource.freeze_account(request) end |
.get_balance_history(limit = BALANCE_HISTORY_LIMIT, offset = BALANCE_HISTORY_OFFSET, account_id: nil, customer_id: nil, since: nil, _until: nil) ⇒ UnitResponse, UnitError
Get account balance history by calling Unit’s API
129 130 131 132 133 |
# File 'lib/unit/models/account/account.rb', line 129 def get_balance_history(limit = BALANCE_HISTORY_LIMIT, offset = BALANCE_HISTORY_OFFSET, account_id: nil, customer_id: nil, since: nil, _until: nil) request = BalanceHistoryRequest.new(limit, offset, account_id, customer_id, since, _until) Unit::Resource::AccountResource.get_account_balance_history(request) end |
.get_deposit_account(account_id:) ⇒ Object
Get a deposit account by id
53 54 55 |
# File 'lib/unit/models/account/account.rb', line 53 def get_deposit_account(account_id:) Unit::Resource::AccountResource.get_account(account_id) end |
.get_deposit_products(account_id:) ⇒ UnitResponse, UnitError
Get deposit products
116 117 118 |
# File 'lib/unit/models/account/account.rb', line 116 def get_deposit_products(account_id:) Unit::Resource::AccountResource.get_deposit_products(account_id) end |
.limits(account_id:) ⇒ UnitResponse, UnitError
Limit a deposit account
108 109 110 |
# File 'lib/unit/models/account/account.rb', line 108 def limits(account_id:) Unit::Resource::AccountResource.limits(account_id) end |
.list_deposit_accounts(limit: ACCOUNT_LIST_LIMIT, offset: ACCOUNT_LIST_OFFSET, customer_id: nil, tags: nil, status: nil, from_balance: nil, to_balance: nil, include: nil) ⇒ UnitResponse, UnitError
Listing deposit accounts
87 88 89 90 91 |
# File 'lib/unit/models/account/account.rb', line 87 def list_deposit_accounts(limit: ACCOUNT_LIST_LIMIT, offset: ACCOUNT_LIST_OFFSET, customer_id: nil, tags: nil, status: nil, from_balance: nil, to_balance: nil, include: nil) request = ListAccountParams.new(limit, offset, customer_id, , status, from_balance, to_balance, include) Unit::Resource::AccountResource.list_accounts(request) end |
.remove_owners(account_id:, customers:) ⇒ UnitResponse, UnitError
Remove account owners by calling Unit’s API
150 151 152 153 |
# File 'lib/unit/models/account/account.rb', line 150 def remove_owners(account_id:, customers:) request = AccountOwnersRequest.new(account_id, customers) Unit::Resource::AccountResource.remove_owners(request) end |
.reopen_account(account_id:) ⇒ Object
Reopen deposit account
46 47 48 |
# File 'lib/unit/models/account/account.rb', line 46 def reopen_account(account_id:) Unit::Resource::AccountResource.reopen_account(account_id) end |
.unfreeze_account(account_id:) ⇒ UnitResponse, UnitError
Unfreeze deposit account
72 73 74 |
# File 'lib/unit/models/account/account.rb', line 72 def unfreeze_account(account_id:) Unit::Resource::AccountResource.unfreeze_account(account_id) end |
.update_deposit_account(account_id:, tags: nil, deposit_product: nil) ⇒ UnitResponse, UnitError
Update a deposit account
99 100 101 102 |
# File 'lib/unit/models/account/account.rb', line 99 def update_deposit_account(account_id:, tags: nil, deposit_product: nil) request = PatchDepositAccountRequest.new(account_id, , deposit_product) Unit::Resource::AccountResource.update_account(request) end |