Class: Square::BankAccountsApi
- Defined in:
- lib/square/api/bank_accounts_api.rb
Overview
BankAccountsApi
Instance Attribute Summary
Attributes inherited from BaseApi
Instance Method Summary collapse
-
#get_bank_account(bank_account_id:) ⇒ GetBankAccountResponse Hash
Returns details of a [BankAccount]($m/BankAccount) linked to a Square account.
-
#get_bank_account_by_v1_id(v1_bank_account_id:) ⇒ GetBankAccountByV1IdResponse Hash
Returns details of a [BankAccount]($m/BankAccount) identified by V1 bank account ID.
-
#list_bank_accounts(cursor: nil, limit: nil, location_id: nil) ⇒ ListBankAccountsResponse Hash
Returns a list of [BankAccount]($m/BankAccount) objects linked to a Square account.
Methods inherited from BaseApi
#initialize, #new_api_call_builder, #new_parameter, #new_request_builder, #new_response_handler, user_agent, user_agent_parameters
Constructor Details
This class inherits a constructor from Square::BaseApi
Instance Method Details
#get_bank_account(bank_account_id:) ⇒ GetBankAccountResponse Hash
Returns details of a [BankAccount]($m/BankAccount) linked to a Square account. the desired ‘BankAccount`.
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/square/api/bank_accounts_api.rb', line 67 def get_bank_account(bank_account_id:) new_api_call_builder .request(new_request_builder(HttpMethodEnum::GET, '/v2/bank-accounts/{bank_account_id}', 'default') .template_param(new_parameter(bank_account_id, key: 'bank_account_id') .should_encode(true)) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler .deserializer(APIHelper.method(:json_deserialize)) .is_api_response(true) .convertor(ApiResponse.method(:create))) .execute end |
#get_bank_account_by_v1_id(v1_bank_account_id:) ⇒ GetBankAccountByV1IdResponse Hash
Returns details of a [BankAccount]($m/BankAccount) identified by V1 bank account ID. the desired ‘BankAccount`. For more information, see [Retrieve a bank account by using an ID issued by V1 Bank Accounts API](developer.squareup.com/docs/bank-accounts-api#retrieve-a-bank -account-by-using-an-id-issued-by-v1-bank-accounts-api).
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/square/api/bank_accounts_api.rb', line 46 def get_bank_account_by_v1_id(v1_bank_account_id:) new_api_call_builder .request(new_request_builder(HttpMethodEnum::GET, '/v2/bank-accounts/by-v1-id/{v1_bank_account_id}', 'default') .template_param(new_parameter(v1_bank_account_id, key: 'v1_bank_account_id') .should_encode(true)) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler .deserializer(APIHelper.method(:json_deserialize)) .is_api_response(true) .convertor(ApiResponse.method(:create))) .execute end |
#list_bank_accounts(cursor: nil, limit: nil, location_id: nil) ⇒ ListBankAccountsResponse Hash
Returns a list of [BankAccount]($m/BankAccount) objects linked to a Square account. by a previous call to this endpoint. Use it in the next ‘ListBankAccounts` request to retrieve the next set of results. See the [Pagination](developer.squareup.com/docs/working-with-apis/paginat ion) guide for more information. bank accounts to return in the response. Currently, 1000 is the largest supported limit. You can specify a limit of up to 1000 bank accounts. This is also the default limit. specify this optional filter to retrieve only the linked bank accounts belonging to a specific location.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/square/api/bank_accounts_api.rb', line 19 def list_bank_accounts(cursor: nil, limit: nil, location_id: nil) new_api_call_builder .request(new_request_builder(HttpMethodEnum::GET, '/v2/bank-accounts', 'default') .query_param(new_parameter(cursor, key: 'cursor')) .query_param(new_parameter(limit, key: 'limit')) .query_param(new_parameter(location_id, key: 'location_id')) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('global'))) .response(new_response_handler .deserializer(APIHelper.method(:json_deserialize)) .is_api_response(true) .convertor(ApiResponse.method(:create))) .execute end |