Class: TreezorClient::BankaccountApi

Inherits:
Object
  • Object
show all
Defined in:
lib/treezor_client/api/bankaccount_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ BankaccountApi

Returns a new instance of BankaccountApi.



19
20
21
# File 'lib/treezor_client/api/bankaccount_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/treezor_client/api/bankaccount_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#delete_bankaccount(id, opts = {}) ⇒ InlineResponse2001

deactivate a bank account Change bank account’s status to CANCELED. If a payout is being validated on this bank account, it can not be canceled.

Parameters:

  • id

    Bank Accounts internal id.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



27
28
29
30
# File 'lib/treezor_client/api/bankaccount_api.rb', line 27

def delete_bankaccount(id, opts = {})
  data, _status_code, _headers = delete_bankaccount_with_http_info(id, opts)
  data
end

#delete_bankaccount_with_http_info(id, opts = {}) ⇒ Array<(InlineResponse2001, Fixnum, Hash)>

deactivate a bank account Change bank account&#39;s status to CANCELED. If a payout is being validated on this bank account, it can not be canceled.

Parameters:

  • id

    Bank Accounts internal id.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(InlineResponse2001, Fixnum, Hash)>)

    InlineResponse2001 data, response status code and response headers



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/treezor_client/api/bankaccount_api.rb', line 37

def delete_bankaccount_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BankaccountApi.delete_bankaccount ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling BankaccountApi.delete_bankaccount"
  end
  # resource path
  local_var_path = '/bankaccounts/{id}'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['api_key']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InlineResponse2001')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BankaccountApi#delete_bankaccount\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_bankaccount(id, opts = {}) ⇒ InlineResponse2001

get a bank account Get a bank account from the system.

Parameters:

  • id

    Bank Accounts internal id.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



81
82
83
84
# File 'lib/treezor_client/api/bankaccount_api.rb', line 81

def get_bankaccount(id, opts = {})
  data, _status_code, _headers = get_bankaccount_with_http_info(id, opts)
  data
end

#get_bankaccount_with_http_info(id, opts = {}) ⇒ Array<(InlineResponse2001, Fixnum, Hash)>

get a bank account Get a bank account from the system.

Parameters:

  • id

    Bank Accounts internal id.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(InlineResponse2001, Fixnum, Hash)>)

    InlineResponse2001 data, response status code and response headers



91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# File 'lib/treezor_client/api/bankaccount_api.rb', line 91

def get_bankaccount_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BankaccountApi.get_bankaccount ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling BankaccountApi.get_bankaccount"
  end
  # resource path
  local_var_path = '/bankaccounts/{id}'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['api_key']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InlineResponse2001')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BankaccountApi#get_bankaccount\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_bankaccounts(opts = {}) ⇒ InlineResponse2001

search bank accounts Get bank accounts that match search criteria.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :access_signature (String)

    Access signature can be mandatory for specific context. Treezor will contact you if so. More info [here](agent.treezor.com/security-authentication).

  • :access_tag (String)

    Access tag is used for idem potency query. More info [here](agent.treezor.com/basics).

  • :access_user_id (Integer)

    Access user&#39;s id is used for user&#39;s action restriction. More info [here](agent.treezor.com/basics).

  • :access_user_ip (String)

    Access user&#39;s ip is used for user&#39;s action restriction. More info [here](agent.treezor.com/basics).

  • :bankaccount_id (Integer)

    bank account id.

  • :bankaccount_status (String)

    bank account status. Possible values: * CANCELED * PENDING * VALIDATED

  • :user_id (Integer)

    Bank account owner user&#39;s id

  • :bankaccount_iban (String)

    Bank account IBAN

  • :page_number (Integer)

    Pagination page number. More info [here](agent.treezor.com/lists).

  • :page_count (Integer)

    The number of items per page. More info [here](agent.treezor.com/lists).

  • :sort_by (String)

    The transaction element you want to sort the list with. Default value : createdDate. More info [here](agent.treezor.com/lists).

  • :sort_order (String)

    The order you want to sort the list. * DESC for a descending sort * ASC for a ascending sort. Default value : DESC. More info [here](agent.treezor.com/lists).

  • :created_date_from (DateTime)

    The creation date from which you want to filter the request result. Format YYYY-MM-DD HH:MM:SS. More info [here](agent.treezor.com/lists)

  • :created_date_to (DateTime)

    The creation date up to which you want to filter the request result. Format YYYY-MM-DD HH:MM:SS. More info [here](agent.treezor.com/lists)

  • :updated_date_from (DateTime)

    The modification date from which you want to filter the request result. Format YYYY-MM-DD HH:MM:SS. More info [here](agent.treezor.com/lists)

  • :updated_date_to (DateTime)

    The modification date up to which you want to filter the request result. Format YYYY-MM-DD HH:MM:SS. More info [here](agent.treezor.com/lists)

Returns:



150
151
152
153
# File 'lib/treezor_client/api/bankaccount_api.rb', line 150

def get_bankaccounts(opts = {})
  data, _status_code, _headers = get_bankaccounts_with_http_info(opts)
  data
end

#get_bankaccounts_with_http_info(opts = {}) ⇒ Array<(InlineResponse2001, Fixnum, Hash)>

search bank accounts Get bank accounts that match search criteria.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :access_signature (String)

    Access signature can be mandatory for specific context. Treezor will contact you if so. More info [here](agent.treezor.com/security-authentication).

  • :access_tag (String)

    Access tag is used for idem potency query. More info [here](agent.treezor.com/basics).

  • :access_user_id (Integer)

    Access user&#39;s id is used for user&#39;s action restriction. More info [here](agent.treezor.com/basics).

  • :access_user_ip (String)

    Access user&#39;s ip is used for user&#39;s action restriction. More info [here](agent.treezor.com/basics).

  • :bankaccount_id (Integer)

    bank account id.

  • :bankaccount_status (String)

    bank account status. Possible values: * CANCELED * PENDING * VALIDATED

  • :user_id (Integer)

    Bank account owner user&#39;s id

  • :bankaccount_iban (String)

    Bank account IBAN

  • :page_number (Integer)

    Pagination page number. More info [here](agent.treezor.com/lists).

  • :page_count (Integer)

    The number of items per page. More info [here](agent.treezor.com/lists).

  • :sort_by (String)

    The transaction element you want to sort the list with. Default value : createdDate. More info [here](agent.treezor.com/lists).

  • :sort_order (String)

    The order you want to sort the list. * DESC for a descending sort * ASC for a ascending sort. Default value : DESC. More info [here](agent.treezor.com/lists).

  • :created_date_from (DateTime)

    The creation date from which you want to filter the request result. Format YYYY-MM-DD HH:MM:SS. More info [here](agent.treezor.com/lists)

  • :created_date_to (DateTime)

    The creation date up to which you want to filter the request result. Format YYYY-MM-DD HH:MM:SS. More info [here](agent.treezor.com/lists)

  • :updated_date_from (DateTime)

    The modification date from which you want to filter the request result. Format YYYY-MM-DD HH:MM:SS. More info [here](agent.treezor.com/lists)

  • :updated_date_to (DateTime)

    The modification date up to which you want to filter the request result. Format YYYY-MM-DD HH:MM:SS. More info [here](agent.treezor.com/lists)

Returns:

  • (Array<(InlineResponse2001, Fixnum, Hash)>)

    InlineResponse2001 data, response status code and response headers



175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
# File 'lib/treezor_client/api/bankaccount_api.rb', line 175

def get_bankaccounts_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BankaccountApi.get_bankaccounts ...'
  end
  # resource path
  local_var_path = '/bankaccounts'

  # query parameters
  query_params = {}
  query_params[:'accessSignature'] = opts[:'access_signature'] if !opts[:'access_signature'].nil?
  query_params[:'accessTag'] = opts[:'access_tag'] if !opts[:'access_tag'].nil?
  query_params[:'accessUserId'] = opts[:'access_user_id'] if !opts[:'access_user_id'].nil?
  query_params[:'accessUserIp'] = opts[:'access_user_ip'] if !opts[:'access_user_ip'].nil?
  query_params[:'bankaccountId'] = opts[:'bankaccount_id'] if !opts[:'bankaccount_id'].nil?
  query_params[:'bankaccountStatus'] = opts[:'bankaccount_status'] if !opts[:'bankaccount_status'].nil?
  query_params[:'userId'] = opts[:'user_id'] if !opts[:'user_id'].nil?
  query_params[:'bankaccountIBAN'] = opts[:'bankaccount_iban'] if !opts[:'bankaccount_iban'].nil?
  query_params[:'pageNumber'] = opts[:'page_number'] if !opts[:'page_number'].nil?
  query_params[:'pageCount'] = opts[:'page_count'] if !opts[:'page_count'].nil?
  query_params[:'sortBy'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?
  query_params[:'sortOrder'] = opts[:'sort_order'] if !opts[:'sort_order'].nil?
  query_params[:'createdDateFrom'] = opts[:'created_date_from'] if !opts[:'created_date_from'].nil?
  query_params[:'createdDateTo'] = opts[:'created_date_to'] if !opts[:'created_date_to'].nil?
  query_params[:'updatedDateFrom'] = opts[:'updated_date_from'] if !opts[:'updated_date_from'].nil?
  query_params[:'updatedDateTo'] = opts[:'updated_date_to'] if !opts[:'updated_date_to'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['api_key']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InlineResponse2001')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BankaccountApi#get_bankaccounts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_bankaccount(user_id, bankaccount_owner_name, bankaccount_owner_address, bankaccount_iban, bankaccount_bic, bankaccount_type, opts = {}) ⇒ InlineResponse2001

create a bank account Create a new benefeciary bank account in the system.

Parameters:

  • user_id

    Owner user&#39;s id.

  • bankaccount_owner_name

    Bank account owner&#39;s name.

  • bankaccount_owner_address

    Bank account owner&#39;s address.

  • bankaccount_iban

    Beneficiary bank account&#39;s IBAN.

  • bankaccount_bic

    Beneficiary bank account&#39;s BIC (or SWIFT).

  • bankaccount_type

    Beneficiary bank account&#39;s type.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :access_signature (String)

    Access signature can be mandatory for specific context. Treezor will contact you if so. More info [here](agent.treezor.com/security-authentication).

  • :access_tag (String)

    Access tag is used for idem potency query. More info [here](agent.treezor.com/basics).

  • :access_user_id (Integer)

    Access user&#39;s id is used for user&#39;s action restriction. More info [here](agent.treezor.com/basics).

  • :access_user_ip (String)

    Access user&#39;s ip is used for user&#39;s action restriction. More info [here](agent.treezor.com/basics).

  • :bankaccount_tag (String)

    Custom data.

  • :name (String)

    Bank account&#39;s name.

Returns:



242
243
244
245
# File 'lib/treezor_client/api/bankaccount_api.rb', line 242

def post_bankaccount(user_id, bankaccount_owner_name, bankaccount_owner_address, bankaccount_iban, bankaccount_bic, bankaccount_type, opts = {})
  data, _status_code, _headers = post_bankaccount_with_http_info(user_id, bankaccount_owner_name, bankaccount_owner_address, bankaccount_iban, bankaccount_bic, bankaccount_type, opts)
  data
end

#post_bankaccount_with_http_info(user_id, bankaccount_owner_name, bankaccount_owner_address, bankaccount_iban, bankaccount_bic, bankaccount_type, opts = {}) ⇒ Array<(InlineResponse2001, Fixnum, Hash)>

create a bank account Create a new benefeciary bank account in the system.

Parameters:

  • user_id

    Owner user&#39;s id.

  • bankaccount_owner_name

    Bank account owner&#39;s name.

  • bankaccount_owner_address

    Bank account owner&#39;s address.

  • bankaccount_iban

    Beneficiary bank account&#39;s IBAN.

  • bankaccount_bic

    Beneficiary bank account&#39;s BIC (or SWIFT).

  • bankaccount_type

    Beneficiary bank account&#39;s type.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :access_signature (String)

    Access signature can be mandatory for specific context. Treezor will contact you if so. More info [here](agent.treezor.com/security-authentication).

  • :access_tag (String)

    Access tag is used for idem potency query. More info [here](agent.treezor.com/basics).

  • :access_user_id (Integer)

    Access user&#39;s id is used for user&#39;s action restriction. More info [here](agent.treezor.com/basics).

  • :access_user_ip (String)

    Access user&#39;s ip is used for user&#39;s action restriction. More info [here](agent.treezor.com/basics).

  • :bankaccount_tag (String)

    Custom data.

  • :name (String)

    Bank account&#39;s name.

Returns:

  • (Array<(InlineResponse2001, Fixnum, Hash)>)

    InlineResponse2001 data, response status code and response headers



263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
# File 'lib/treezor_client/api/bankaccount_api.rb', line 263

def post_bankaccount_with_http_info(user_id, bankaccount_owner_name, bankaccount_owner_address, bankaccount_iban, bankaccount_bic, bankaccount_type, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: BankaccountApi.post_bankaccount ...'
  end
  # verify the required parameter 'user_id' is set
  if @api_client.config.client_side_validation && user_id.nil?
    fail ArgumentError, "Missing the required parameter 'user_id' when calling BankaccountApi.post_bankaccount"
  end
  # verify the required parameter 'bankaccount_owner_name' is set
  if @api_client.config.client_side_validation && bankaccount_owner_name.nil?
    fail ArgumentError, "Missing the required parameter 'bankaccount_owner_name' when calling BankaccountApi.post_bankaccount"
  end
  # verify the required parameter 'bankaccount_owner_address' is set
  if @api_client.config.client_side_validation && bankaccount_owner_address.nil?
    fail ArgumentError, "Missing the required parameter 'bankaccount_owner_address' when calling BankaccountApi.post_bankaccount"
  end
  # verify the required parameter 'bankaccount_iban' is set
  if @api_client.config.client_side_validation && bankaccount_iban.nil?
    fail ArgumentError, "Missing the required parameter 'bankaccount_iban' when calling BankaccountApi.post_bankaccount"
  end
  # verify the required parameter 'bankaccount_bic' is set
  if @api_client.config.client_side_validation && bankaccount_bic.nil?
    fail ArgumentError, "Missing the required parameter 'bankaccount_bic' when calling BankaccountApi.post_bankaccount"
  end
  # verify the required parameter 'bankaccount_type' is set
  if @api_client.config.client_side_validation && bankaccount_type.nil?
    fail ArgumentError, "Missing the required parameter 'bankaccount_type' when calling BankaccountApi.post_bankaccount"
  end
  # verify enum value
  if @api_client.config.client_side_validation && !['sct', 'sdd_core', 'sdd_b2b'].include?(bankaccount_type)
    fail ArgumentError, "invalid value for 'bankaccount_type', must be one of sct, sdd_core, sdd_b2b"
  end
  # resource path
  local_var_path = '/bankaccounts'

  # query parameters
  query_params = {}
  query_params[:'userId'] = user_id
  query_params[:'bankaccountOwnerName'] = bankaccount_owner_name
  query_params[:'bankaccountOwnerAddress'] = bankaccount_owner_address
  query_params[:'bankaccountIBAN'] = bankaccount_iban
  query_params[:'bankaccountBIC'] = bankaccount_bic
  query_params[:'bankaccountType'] = bankaccount_type
  query_params[:'accessSignature'] = opts[:'access_signature'] if !opts[:'access_signature'].nil?
  query_params[:'accessTag'] = opts[:'access_tag'] if !opts[:'access_tag'].nil?
  query_params[:'accessUserId'] = opts[:'access_user_id'] if !opts[:'access_user_id'].nil?
  query_params[:'accessUserIp'] = opts[:'access_user_ip'] if !opts[:'access_user_ip'].nil?
  query_params[:'bankaccountTag'] = opts[:'bankaccount_tag'] if !opts[:'bankaccount_tag'].nil?
  query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['api_key']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InlineResponse2001')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: BankaccountApi#post_bankaccount\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end