Class: Straddle::Resources::LinkedBankAccounts
- Inherits:
-
Object
- Object
- Straddle::Resources::LinkedBankAccounts
- Defined in:
- lib/straddle/resources/linked_bank_accounts.rb,
sig/straddle/resources/linked_bank_accounts.rbs
Overview
Linked bank accounts connect external bank accounts to an account or platform for charges, payouts, or billing.
Instance Method Summary collapse
-
#cancel(linked_bank_account_id, correlation_id: nil, idempotency_key: nil, request_id: nil, request_options: {}) ⇒ Straddle::Models::LinkedBankAccountResponse
Cancels a linked bank account and returns it with status
canceled. -
#create(bank_account:, account_id: nil, description: nil, metadata: nil, platform_id: nil, purposes: nil, correlation_id: nil, idempotency_key: nil, request_id: nil, request_options: {}) ⇒ Straddle::Models::LinkedBankAccountResponse
Some parameter documentations has been truncated, see Models::LinkedBankAccountCreateParams for more details.
-
#initialize(client:) ⇒ LinkedBankAccounts
constructor
private
A new instance of LinkedBankAccounts.
-
#list(account_id: nil, level: nil, page_number: nil, page_size: nil, purpose: nil, sort_by: nil, sort_order: nil, status: nil, correlation_id: nil, request_id: nil, request_options: {}) ⇒ Straddle::Models::LinkedBankAccountList
Some parameter documentations has been truncated, see Models::LinkedBankAccountListParams for more details.
-
#list_unmasked(linked_bank_account_id, correlation_id: nil, request_id: nil, request_options: {}) ⇒ Straddle::Models::UnmaskedLinkedBankAccountResponse
Returns the linked bank account with the specified ID without masking its account number.
-
#retrieve(linked_bank_account_id, correlation_id: nil, request_id: nil, request_options: {}) ⇒ Straddle::Models::LinkedBankAccountResponse
Returns the linked bank account with the specified ID.
-
#update(linked_bank_account_id, bank_account:, metadata: nil, correlation_id: nil, idempotency_key: nil, request_id: nil, request_options: {}) ⇒ Straddle::Models::LinkedBankAccountResponse
Some parameter documentations has been truncated, see Models::LinkedBankAccountUpdateParams for more details.
Constructor Details
#initialize(client:) ⇒ LinkedBankAccounts
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 LinkedBankAccounts.
242 243 244 |
# File 'lib/straddle/resources/linked_bank_accounts.rb', line 242 def initialize(client:) @client = client end |
Instance Method Details
#cancel(linked_bank_account_id, correlation_id: nil, idempotency_key: nil, request_id: nil, request_options: {}) ⇒ Straddle::Models::LinkedBankAccountResponse
Cancels a linked bank account and returns it with status canceled. The linked
bank account must have status created.
195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 |
# File 'lib/straddle/resources/linked_bank_accounts.rb', line 195 def cancel(linked_bank_account_id, params = {}) parsed, = Straddle::LinkedBankAccountCancelParams.dump_request(params) @client.request( method: :patch, path: ["v1/linked_bank_accounts/%1$s/cancel", linked_bank_account_id], headers: parsed.transform_keys( correlation_id: "correlation-id", idempotency_key: "idempotency-key", request_id: "request-id" ), model: Straddle::LinkedBankAccountResponse, options: ) end |
#create(bank_account:, account_id: nil, description: nil, metadata: nil, platform_id: nil, purposes: nil, correlation_id: nil, idempotency_key: nil, request_id: nil, request_options: {}) ⇒ Straddle::Models::LinkedBankAccountResponse
Some parameter documentations has been truncated, see Models::LinkedBankAccountCreateParams for more details.
Creates a linked bank account for an account or platform, assigns its payment purposes, and returns the linked bank account.
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/straddle/resources/linked_bank_accounts.rb', line 39 def create(params) parsed, = Straddle::LinkedBankAccountCreateParams.dump_request(params) header_params = { correlation_id: "correlation-id", idempotency_key: "idempotency-key", request_id: "request-id" } @client.request( method: :post, path: "v1/linked_bank_accounts", headers: parsed.slice(*header_params.keys).transform_keys(header_params), body: parsed.except(*header_params.keys), model: Straddle::LinkedBankAccountResponse, options: ) end |
#list(account_id: nil, level: nil, page_number: nil, page_size: nil, purpose: nil, sort_by: nil, sort_order: nil, status: nil, correlation_id: nil, request_id: nil, request_options: {}) ⇒ Straddle::Models::LinkedBankAccountList
Some parameter documentations has been truncated, see Models::LinkedBankAccountListParams for more details.
Returns a paginated list of linked bank accounts. Filter the list by account, scope, purpose, or status.
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 |
# File 'lib/straddle/resources/linked_bank_accounts.rb', line 159 def list(params = {}) query_params = %i[account_id level page_number page_size purpose sort_by sort_order status] parsed, = Straddle::LinkedBankAccountListParams.dump_request(params) query = Straddle::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( method: :get, path: "v1/linked_bank_accounts", query: query, headers: parsed.except(*query_params).transform_keys( correlation_id: "correlation-id", request_id: "request-id" ), model: Straddle::LinkedBankAccountList, options: ) end |
#list_unmasked(linked_bank_account_id, correlation_id: nil, request_id: nil, request_options: {}) ⇒ Straddle::Models::UnmaskedLinkedBankAccountResponse
Returns the linked bank account with the specified ID without masking its account number. This endpoint is available only when Straddle enables data unmasking for the account.
228 229 230 231 232 233 234 235 236 237 |
# File 'lib/straddle/resources/linked_bank_accounts.rb', line 228 def list_unmasked(linked_bank_account_id, params = {}) parsed, = Straddle::LinkedBankAccountListUnmaskedParams.dump_request(params) @client.request( method: :get, path: ["v1/linked_bank_accounts/%1$s/unmask", linked_bank_account_id], headers: parsed.transform_keys(correlation_id: "correlation-id", request_id: "request-id"), model: Straddle::UnmaskedLinkedBankAccountResponse, options: ) end |
#retrieve(linked_bank_account_id, correlation_id: nil, request_id: nil, request_options: {}) ⇒ Straddle::Models::LinkedBankAccountResponse
Returns the linked bank account with the specified ID. The response masks the account number.
72 73 74 75 76 77 78 79 80 81 |
# File 'lib/straddle/resources/linked_bank_accounts.rb', line 72 def retrieve(linked_bank_account_id, params = {}) parsed, = Straddle::LinkedBankAccountRetrieveParams.dump_request(params) @client.request( method: :get, path: ["v1/linked_bank_accounts/%1$s", linked_bank_account_id], headers: parsed.transform_keys(correlation_id: "correlation-id", request_id: "request-id"), model: Straddle::LinkedBankAccountResponse, options: ) end |
#update(linked_bank_account_id, bank_account:, metadata: nil, correlation_id: nil, idempotency_key: nil, request_id: nil, request_options: {}) ⇒ Straddle::Models::LinkedBankAccountResponse
Some parameter documentations has been truncated, see Models::LinkedBankAccountUpdateParams for more details.
Updates bank account details and metadata, then returns the linked bank account.
The linked bank account must have status created, or status onboarding with
status_detail.reason set to stuck.
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 |
# File 'lib/straddle/resources/linked_bank_accounts.rb', line 109 def update(linked_bank_account_id, params) parsed, = Straddle::LinkedBankAccountUpdateParams.dump_request(params) header_params = { correlation_id: "correlation-id", idempotency_key: "idempotency-key", request_id: "request-id" } @client.request( method: :put, path: ["v1/linked_bank_accounts/%1$s", linked_bank_account_id], headers: parsed.slice(*header_params.keys).transform_keys(header_params), body: parsed.except(*header_params.keys), model: Straddle::LinkedBankAccountResponse, options: ) end |