Class: TreezorClient::PayinrefundApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ PayinrefundApi

Returns a new instance of PayinrefundApi.



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

def api_client
  @api_client
end

Instance Method Details

#delete_payinrefund(id, opts = {}) ⇒ InlineResponse20018

cancel a pay in refund Change payin refund’s status to CANCELED. A validated payin refund can’t be cancelled.

Parameters:

  • id

    Payinrefund's internal id.

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

    the optional parameters

Returns:



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

def delete_payinrefund(id, opts = {})
  data, _status_code, _headers = delete_payinrefund_with_http_info(id, opts)
  return data
end

#delete_payinrefund_with_http_info(id, opts = {}) ⇒ Array<(InlineResponse20018, Fixnum, Hash)>

cancel a pay in refund Change payin refund&#39;s status to CANCELED. A validated payin refund can&#39;t be cancelled.

Parameters:

  • id

    Payinrefund&#39;s internal id.

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

    the optional parameters

Returns:

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

    InlineResponse20018 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/payinrefund_api.rb', line 38

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

#get_payinrefund(id, opts = {}) ⇒ InlineResponse20018

get a pay in refund Get a payin refund from the system.

Parameters:

  • id

    Payinrefund&#39;s internal id.

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

    the optional parameters

Returns:



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

def get_payinrefund(id, opts = {})
  data, _status_code, _headers = get_payinrefund_with_http_info(id, opts)
  return data
end

#get_payinrefund_with_http_info(id, opts = {}) ⇒ Array<(InlineResponse20018, Fixnum, Hash)>

get a pay in refund Get a payin refund from the system.

Parameters:

  • id

    Payinrefund&#39;s internal id.

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

    the optional parameters

Returns:

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

    InlineResponse20018 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/payinrefund_api.rb', line 93

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

#get_payinrefunds(opts = {}) ⇒ InlineResponse20018

search pay in refunds Search for payinrefunds in the system.

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

  • :payin_id (Integer)

    Payin&#39;s id.

  • :payinrefund_id (Integer)

    Payinrefund&#39;s id.

  • :payinrefund_tag (String)

    Custom data.

  • :payinrefund_status (String)

    Payinrefund&#39;s status. Possible values: * PENDING * CANCELED * VALIDATED

  • :wallet_id (Integer)

    Wallet&#39;s id to refund.

  • :payinrefund_date (DateTime)

    payinrefund&#39;s date. Format: YYYY-MM-DD

  • :user_id (Integer)

    User&#39;s id who made refunds.

  • :amount (String)

    Refund&#39;s 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:



158
159
160
161
# File 'lib/treezor_client/api/payinrefund_api.rb', line 158

def get_payinrefunds(opts = {})
  data, _status_code, _headers = get_payinrefunds_with_http_info(opts)
  return data
end

#get_payinrefunds_with_http_info(opts = {}) ⇒ Array<(InlineResponse20018, Fixnum, Hash)>

search pay in refunds Search for payinrefunds in the system.

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

  • :payin_id (Integer)

    Payin&#39;s id.

  • :payinrefund_id (Integer)

    Payinrefund&#39;s id.

  • :payinrefund_tag (String)

    Custom data.

  • :payinrefund_status (String)

    Payinrefund&#39;s status. Possible values: * PENDING * CANCELED * VALIDATED

  • :wallet_id (Integer)

    Wallet&#39;s id to refund.

  • :payinrefund_date (DateTime)

    payinrefund&#39;s date. Format: YYYY-MM-DD

  • :user_id (Integer)

    User&#39;s id who made refunds.

  • :amount (String)

    Refund&#39;s 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<(InlineResponse20018, Fixnum, Hash)>)

    InlineResponse20018 data, response status code and response headers



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
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
# File 'lib/treezor_client/api/payinrefund_api.rb', line 188

def get_payinrefunds_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: PayinrefundApi.get_payinrefunds ..."
  end
  # resource path
  local_var_path = "/payinrefunds"

  # 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[:'payinId'] = opts[:'payin_id'] if !opts[:'payin_id'].nil?
  query_params[:'payinrefundId'] = opts[:'payinrefund_id'] if !opts[:'payinrefund_id'].nil?
  query_params[:'payinrefundTag'] = opts[:'payinrefund_tag'] if !opts[:'payinrefund_tag'].nil?
  query_params[:'payinrefundStatus'] = opts[:'payinrefund_status'] if !opts[:'payinrefund_status'].nil?
  query_params[:'walletId'] = opts[:'wallet_id'] if !opts[:'wallet_id'].nil?
  query_params[:'payinrefundDate'] = opts[:'payinrefund_date'] if !opts[:'payinrefund_date'].nil?
  query_params[:'userId'] = opts[:'user_id'] if !opts[:'user_id'].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 => 'InlineResponse20018')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PayinrefundApi#get_payinrefunds\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_payinrefunds(payin_id, amount, currency, opts = {}) ⇒ InlineResponse20018

create a pay in refund Create a new payinrefund in the system.

Parameters:

  • payin_id

    payin&#39;s id to refund.

  • amount

    Refund amount.

  • currency

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

  • :payinrefund_tag (String)

    Custom data.

  • :comment (String)

    End user, client or issuer comment.

Returns:



258
259
260
261
# File 'lib/treezor_client/api/payinrefund_api.rb', line 258

def post_payinrefunds(payin_id, amount, currency, opts = {})
  data, _status_code, _headers = post_payinrefunds_with_http_info(payin_id, amount, currency, opts)
  return data
end

#post_payinrefunds_with_http_info(payin_id, amount, currency, opts = {}) ⇒ Array<(InlineResponse20018, Fixnum, Hash)>

create a pay in refund Create a new payinrefund in the system.

Parameters:

  • payin_id

    payin&#39;s id to refund.

  • amount

    Refund amount.

  • currency

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

  • :payinrefund_tag (String)

    Custom data.

  • :comment (String)

    End user, client or issuer comment.

Returns:

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

    InlineResponse20018 data, response status code and response headers



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
# File 'lib/treezor_client/api/payinrefund_api.rb', line 276

def post_payinrefunds_with_http_info(payin_id, amount, currency, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: PayinrefundApi.post_payinrefunds ..."
  end
  # verify the required parameter 'payin_id' is set
  if @api_client.config.client_side_validation && payin_id.nil?
    fail ArgumentError, "Missing the required parameter 'payin_id' when calling PayinrefundApi.post_payinrefunds"
  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 PayinrefundApi.post_payinrefunds"
  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 PayinrefundApi.post_payinrefunds"
  end
  # resource path
  local_var_path = "/payinrefunds"

  # query parameters
  query_params = {}
  query_params[:'payinId'] = payin_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[:'payinrefundTag'] = opts[:'payinrefund_tag'] if !opts[:'payinrefund_tag'].nil?
  query_params[:'comment'] = opts[:'comment'] if !opts[:'comment'].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 => 'InlineResponse20018')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PayinrefundApi#post_payinrefunds\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end