Class: TreezorClient::PayoutApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ PayoutApi

Returns a new instance of PayoutApi



19
20
21
# File 'lib/treezor_client/api/payout_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/payout_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#delete_payout(id, opts = {}) ⇒ InlineResponse20019

cancel a payout Change pay out status to CANCELED. A VALIDATED pay out can't be canceled.

Parameters:

  • id

    Payouts internal id.

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

    the optional parameters

Returns:



28
29
30
31
# File 'lib/treezor_client/api/payout_api.rb', line 28

def delete_payout(id, opts = {})
  data, _status_code, _headers = delete_payout_with_http_info(id, opts)
  return data
end

#delete_payout_with_http_info(id, opts = {}) ⇒ Array<(InlineResponse20019, Fixnum, Hash)>

cancel a payout Change pay out status to CANCELED. A VALIDATED pay out can&#39;t be canceled.

Parameters:

  • id

    Payouts internal id.

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

    the optional parameters

Returns:

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

    InlineResponse20019 data, response status code and response headers



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
76
# File 'lib/treezor_client/api/payout_api.rb', line 38

def delete_payout_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: PayoutApi.delete_payout ..."
  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 PayoutApi.delete_payout"
  end
  # resource path
  local_var_path = "/payouts/{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 => 'InlineResponse20019')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PayoutApi#delete_payout\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_payout(id, opts = {}) ⇒ InlineResponse20019

get a payout Get a pay out from the system.

Parameters:

  • id

    Payouts internal id.

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

    the optional parameters

Returns:



83
84
85
86
# File 'lib/treezor_client/api/payout_api.rb', line 83

def get_payout(id, opts = {})
  data, _status_code, _headers = get_payout_with_http_info(id, opts)
  return data
end

#get_payout_with_http_info(id, opts = {}) ⇒ Array<(InlineResponse20019, Fixnum, Hash)>

get a payout Get a pay out from the system.

Parameters:

  • id

    Payouts internal id.

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

    the optional parameters

Returns:

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

    InlineResponse20019 data, response status code and response headers



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
130
131
# File 'lib/treezor_client/api/payout_api.rb', line 93

def get_payout_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: PayoutApi.get_payout ..."
  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 PayoutApi.get_payout"
  end
  # resource path
  local_var_path = "/payouts/{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 => 'InlineResponse20019')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PayoutApi#get_payout\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_payouts(opts = {}) ⇒ InlineResponse20019

search pay outs Get pay out 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).

  • :payout_id (Integer)

    Payout&#39;s Id

  • :payout_tag (String)

    Custom data.

  • :payout_status (String)

    pay out status; Possible values: * CANCELED * PENDING * VALIDATED

  • :payout_type_id (Integer)

    Pay out type&#39;s id.

  • :payout_type (String)

    Pay out type; Possible values: * Credit Transfer * Direct Debit

  • :wallet_id (Integer)

    Pay out wallet&#39;s id.

  • :event_alias (String)

    Pay out wallet&#39;s event alias.

  • :user_id (Integer)

    Pay out user&#39;s id.

  • :user_name (String)

    Pay out user&#39;s name.

  • :user_email (String)

    Pay out user&#39;s email.

  • :payout_date (DateTime)

    pay out execution date. Format: YYYY-MM-DD HH:MM:SS&#39;

  • :bankaccount_id (Integer)

    Pay out bank account id.

  • :bankaccount_iban (String)

    Pay out bank account IBAN.

  • :label (String)

    Pay out label that will be displayed in the receiver&#39;s account.

  • :amount (String)

    Pay out amount.

  • :currency (String)

    Transfert amount currency. Format: [ISO 4217](fr.wikipedia.org/wiki/ISO_4217).

  • :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:



165
166
167
168
# File 'lib/treezor_client/api/payout_api.rb', line 165

def get_payouts(opts = {})
  data, _status_code, _headers = get_payouts_with_http_info(opts)
  return data
end

#get_payouts_with_http_info(opts = {}) ⇒ Array<(InlineResponse20019, Fixnum, Hash)>

search pay outs Get pay out 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).

  • :payout_id (Integer)

    Payout&#39;s Id

  • :payout_tag (String)

    Custom data.

  • :payout_status (String)

    pay out status; Possible values: * CANCELED * PENDING * VALIDATED

  • :payout_type_id (Integer)

    Pay out type&#39;s id.

  • :payout_type (String)

    Pay out type; Possible values: * Credit Transfer * Direct Debit

  • :wallet_id (Integer)

    Pay out wallet&#39;s id.

  • :event_alias (String)

    Pay out wallet&#39;s event alias.

  • :user_id (Integer)

    Pay out user&#39;s id.

  • :user_name (String)

    Pay out user&#39;s name.

  • :user_email (String)

    Pay out user&#39;s email.

  • :payout_date (DateTime)

    pay out execution date. Format: YYYY-MM-DD HH:MM:SS&#39;

  • :bankaccount_id (Integer)

    Pay out bank account id.

  • :bankaccount_iban (String)

    Pay out bank account IBAN.

  • :label (String)

    Pay out label that will be displayed in the receiver&#39;s account.

  • :amount (String)

    Pay out amount.

  • :currency (String)

    Transfert amount currency. Format: [ISO 4217](fr.wikipedia.org/wiki/ISO_4217).

  • :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<(InlineResponse20019, Fixnum, Hash)>)

    InlineResponse20019 data, response status code and response headers



202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
# File 'lib/treezor_client/api/payout_api.rb', line 202

def get_payouts_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: PayoutApi.get_payouts ..."
  end
  # resource path
  local_var_path = "/payouts"

  # 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[:'payoutId'] = opts[:'payout_id'] if !opts[:'payout_id'].nil?
  query_params[:'payoutTag'] = opts[:'payout_tag'] if !opts[:'payout_tag'].nil?
  query_params[:'payoutStatus'] = opts[:'payout_status'] if !opts[:'payout_status'].nil?
  query_params[:'payoutTypeId'] = opts[:'payout_type_id'] if !opts[:'payout_type_id'].nil?
  query_params[:'payoutType'] = opts[:'payout_type'] if !opts[:'payout_type'].nil?
  query_params[:'walletId'] = opts[:'wallet_id'] if !opts[:'wallet_id'].nil?
  query_params[:'eventAlias'] = opts[:'event_alias'] if !opts[:'event_alias'].nil?
  query_params[:'userId'] = opts[:'user_id'] if !opts[:'user_id'].nil?
  query_params[:'userName'] = opts[:'user_name'] if !opts[:'user_name'].nil?
  query_params[:'userEmail'] = opts[:'user_email'] if !opts[:'user_email'].nil?
  query_params[:'payoutDate'] = opts[:'payout_date'] if !opts[:'payout_date'].nil?
  query_params[:'bankaccountId'] = opts[:'bankaccount_id'] if !opts[:'bankaccount_id'].nil?
  query_params[:'bankaccountIBAN'] = opts[:'bankaccount_iban'] if !opts[:'bankaccount_iban'].nil?
  query_params[:'label'] = opts[:'label'] if !opts[:'label'].nil?
  query_params[:'amount'] = opts[:'amount'] if !opts[:'amount'].nil?
  query_params[:'currency'] = opts[:'currency'] if !opts[:'currency'].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 => 'InlineResponse20019')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PayoutApi#get_payouts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_payout(wallet_id, amount, currency, opts = {}) ⇒ InlineResponse20019

create a pay out Create a new pay out in the system.

Parameters:

  • wallet_id

    Pay out wallet id.

  • amount

    Pay out amount.

  • currency

    Transfert amount currency. Format: [ISO 4217](fr.wikipedia.org/wiki/ISO_4217).

  • 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).

  • :payout_tag (String)

    Custom data.

  • :bankaccount_id (Integer)

    Pay out bank account&#39;s id. Mandatory id beneficiaryId is not provided. If bankaccountId and beneficiaryId are both provided, the beneficiaryId will be used.

  • :beneficiary_id (Integer)

    Pay out beneficiary&#39;s id. Mandatory id bankaccountId is not provided. If bankaccountId and beneficiaryId are both provided, the beneficiaryId will be used.

  • :label (String)

    Pay out label that will be displayed in the receiver&#39;s account (140 chars max).

  • :supporting_file_link (String)

    Support file link

Returns:



282
283
284
285
# File 'lib/treezor_client/api/payout_api.rb', line 282

def post_payout(wallet_id, amount, currency, opts = {})
  data, _status_code, _headers = post_payout_with_http_info(wallet_id, amount, currency, opts)
  return data
end

#post_payout_with_http_info(wallet_id, amount, currency, opts = {}) ⇒ Array<(InlineResponse20019, Fixnum, Hash)>

create a pay out Create a new pay out in the system.

Parameters:

  • wallet_id

    Pay out wallet id.

  • amount

    Pay out amount.

  • currency

    Transfert amount currency. Format: [ISO 4217](fr.wikipedia.org/wiki/ISO_4217).

  • 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).

  • :payout_tag (String)

    Custom data.

  • :bankaccount_id (Integer)

    Pay out bank account&#39;s id. Mandatory id beneficiaryId is not provided. If bankaccountId and beneficiaryId are both provided, the beneficiaryId will be used.

  • :beneficiary_id (Integer)

    Pay out beneficiary&#39;s id. Mandatory id bankaccountId is not provided. If bankaccountId and beneficiaryId are both provided, the beneficiaryId will be used.

  • :label (String)

    Pay out label that will be displayed in the receiver&#39;s account (140 chars max).

  • :supporting_file_link (String)

    Support file link

Returns:

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

    InlineResponse20019 data, response status code and response headers



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
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
# File 'lib/treezor_client/api/payout_api.rb', line 303

def post_payout_with_http_info(wallet_id, amount, currency, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: PayoutApi.post_payout ..."
  end
  # verify the required parameter 'wallet_id' is set
  if @api_client.config.client_side_validation && wallet_id.nil?
    fail ArgumentError, "Missing the required parameter 'wallet_id' when calling PayoutApi.post_payout"
  end
  # verify the required parameter 'amount' is set
  if @api_client.config.client_side_validation && amount.nil?
    fail ArgumentError, "Missing the required parameter 'amount' when calling PayoutApi.post_payout"
  end
  # verify the required parameter 'currency' is set
  if @api_client.config.client_side_validation && currency.nil?
    fail ArgumentError, "Missing the required parameter 'currency' when calling PayoutApi.post_payout"
  end
  # resource path
  local_var_path = "/payouts"

  # query parameters
  query_params = {}
  query_params[:'walletId'] = wallet_id
  query_params[:'amount'] = amount
  query_params[:'currency'] = currency
  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[:'payoutTag'] = opts[:'payout_tag'] if !opts[:'payout_tag'].nil?
  query_params[:'bankaccountId'] = opts[:'bankaccount_id'] if !opts[:'bankaccount_id'].nil?
  query_params[:'beneficiaryId'] = opts[:'beneficiary_id'] if !opts[:'beneficiary_id'].nil?
  query_params[:'label'] = opts[:'label'] if !opts[:'label'].nil?
  query_params[:'supportingFileLink'] = opts[:'supporting_file_link'] if !opts[:'supporting_file_link'].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 => 'InlineResponse20019')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PayoutApi#post_payout\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end