Module: Unit::Counterparty
- Defined in:
- lib/unit/models/counterparty/counterparty.rb,
lib/unit/models/counterparty/list_counterparty_params.rb,
lib/unit/models/counterparty/create_counterparty_request.rb,
lib/unit/models/counterparty/update_counterparty_request.rb,
lib/unit/models/counterparty/create_with_plaid_token_request.rb
Defined Under Namespace
Classes: CreateCounterpartyRequest, CreateWithPlaidTokenRequest, ListCounterpartyParams, UpdateCounterpartyRequest
Constant Summary collapse
- COUNTER_PARTY_LIMIT =
100
- COUNTER_PARTY_OFFSET =
0
Class Method Summary collapse
-
.create_counterparty(customer_id:, name:, routing_number:, account_number:, account_type:, type:, tags: nil, permissions: nil, idempotency_key: nil) ⇒ Object
Create counterparty by calling Unit’s API.
-
.create_with_plaid_token(customer_id:, type:, name:, plaid_processor_token:, verify_name: nil, permissions: nil, tags: nil, idempotency_key: nil) ⇒ Object
Create counterparty with plaid token.
-
.delete_counterparty(counterparty_id:) ⇒ Object
Delete counterparty.
-
.get_counterparty(counterparty_id:) ⇒ Object
Get counterparty by id.
-
.get_counterparty_balance(counterparty_id:) ⇒ Object
Get counterparty balance.
-
.list_counterparty(limit: COUNTER_PARTY_LIMIT, offset: COUNTER_PARTY_OFFSET, customer_id: nil, account_number: nil, routing_number: nil, tags: nil, permissions: nil) ⇒ Object
List counterparties.
-
.update_counterparty(counterparty_id:, plaid_processor_token: nil, verify_name: nil, permissions: nil, tags: nil) ⇒ Object
Update counterparty.
Class Method Details
.create_counterparty(customer_id:, name:, routing_number:, account_number:, account_type:, type:, tags: nil, permissions: nil, idempotency_key: nil) ⇒ Object
Create counterparty by calling Unit’s API
25 26 27 28 |
# File 'lib/unit/models/counterparty/counterparty.rb', line 25 def create_counterparty(customer_id:, name:, routing_number:, account_number:, account_type:, type:, tags: nil, permissions: nil, idempotency_key: nil) request = CreateCounterpartyRequest.new(customer_id, name, routing_number, account_number, account_type, type, , , idempotency_key) Unit::Resource::CounterpartyResource.create_counterparty(request) end |
.create_with_plaid_token(customer_id:, type:, name:, plaid_processor_token:, verify_name: nil, permissions: nil, tags: nil, idempotency_key: nil) ⇒ Object
Create counterparty with plaid token
40 41 42 43 |
# File 'lib/unit/models/counterparty/counterparty.rb', line 40 def create_with_plaid_token(customer_id:, type:, name:, plaid_processor_token:, verify_name: nil, permissions: nil, tags: nil, idempotency_key: nil) request = CreateWithPlaidTokenRequest.new(customer_id, type, name, plaid_processor_token, verify_name, , , idempotency_key) Unit::Resource::CounterpartyResource.create_counterparty(request) end |
.delete_counterparty(counterparty_id:) ⇒ Object
Delete counterparty
88 89 90 |
# File 'lib/unit/models/counterparty/counterparty.rb', line 88 def delete_counterparty(counterparty_id:) Unit::Resource::CounterpartyResource.delete(counterparty_id) end |
.get_counterparty(counterparty_id:) ⇒ Object
Get counterparty by id
62 63 64 |
# File 'lib/unit/models/counterparty/counterparty.rb', line 62 def get_counterparty(counterparty_id:) Unit::Resource::CounterpartyResource.get_counterparty(counterparty_id) end |
.get_counterparty_balance(counterparty_id:) ⇒ Object
Get counterparty balance
69 70 71 |
# File 'lib/unit/models/counterparty/counterparty.rb', line 69 def get_counterparty_balance(counterparty_id:) Unit::Resource::CounterpartyResource.get_counterparty_balance(counterparty_id) end |
.list_counterparty(limit: COUNTER_PARTY_LIMIT, offset: COUNTER_PARTY_OFFSET, customer_id: nil, account_number: nil, routing_number: nil, tags: nil, permissions: nil) ⇒ Object
List counterparties
54 55 56 57 |
# File 'lib/unit/models/counterparty/counterparty.rb', line 54 def list_counterparty(limit: COUNTER_PARTY_LIMIT, offset: COUNTER_PARTY_OFFSET, customer_id: nil, account_number: nil, routing_number: nil, tags: nil, permissions: nil) params = ListCounterpartyParams.new(limit, offset, customer_id, account_number, routing_number, , ) Unit::Resource::CounterpartyResource.list(params) end |
.update_counterparty(counterparty_id:, plaid_processor_token: nil, verify_name: nil, permissions: nil, tags: nil) ⇒ Object
Update counterparty
80 81 82 83 |
# File 'lib/unit/models/counterparty/counterparty.rb', line 80 def update_counterparty(counterparty_id:, plaid_processor_token: nil, verify_name: nil, permissions: nil, tags: nil) request = UpdateCounterpartyRequest.new(counterparty_id, plaid_processor_token, verify_name, , ) Unit::Resource::CounterpartyResource.update_counterparty(request) end |