Class: UltracartClient::ChargebackApi

Inherits:
Object
  • Object
show all
Defined in:
lib/ultracart_api/api/chargeback_api.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ChargebackApi

Returns a new instance of ChargebackApi.



19
20
21
# File 'lib/ultracart_api/api/chargeback_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/ultracart_api/api/chargeback_api.rb', line 17

def api_client
  @api_client
end

Class Method Details

.new_using_api_key(simple_key, verify_ssl = true, debugging = false) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
# File 'lib/ultracart_api/api/chargeback_api.rb', line 23

def self.new_using_api_key(simple_key, verify_ssl = true, debugging = false)
  api_config = Configuration.new
  api_config.api_key_prefix['x-ultracart-simple-key'] = simple_key
  api_config.api_version = '2017-03-01'
  api_config.verify_ssl = verify_ssl

  api_client = ApiClient.new(api_config)
  api_client.config.debugging = debugging

  UltracartClient::ChargebackApi.new(api_client)
end

Instance Method Details

#delete_chargeback(chargeback_dispute_oid, opts = {}) ⇒ ChargebackDisputeResponse

Delete a chargeback Delete a chargeback on the UltraCart account.

Parameters:

  • chargeback_dispute_oid (Integer)

    The chargeback_dispute_oid to delete.

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

    the optional parameters

Returns:



40
41
42
43
# File 'lib/ultracart_api/api/chargeback_api.rb', line 40

def delete_chargeback(chargeback_dispute_oid, opts = {})
  data, _status_code, _headers = delete_chargeback_with_http_info(chargeback_dispute_oid, opts)
  data
end

#delete_chargeback_with_http_info(chargeback_dispute_oid, opts = {}) ⇒ Array<(ChargebackDisputeResponse, Integer, Hash)>

Delete a chargeback Delete a chargeback on the UltraCart account.

Parameters:

  • chargeback_dispute_oid (Integer)

    The chargeback_dispute_oid to delete.

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

    the optional parameters

Returns:

  • (Array<(ChargebackDisputeResponse, Integer, Hash)>)

    ChargebackDisputeResponse data, response status code and response headers



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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/ultracart_api/api/chargeback_api.rb', line 50

def delete_chargeback_with_http_info(chargeback_dispute_oid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ChargebackApi.delete_chargeback ...'
  end
  # verify the required parameter 'chargeback_dispute_oid' is set
  if @api_client.config.client_side_validation && chargeback_dispute_oid.nil?
    fail ArgumentError, "Missing the required parameter 'chargeback_dispute_oid' when calling ChargebackApi.delete_chargeback"
  end
  # resource path
  local_var_path = '/chargeback/chargebacks/{chargeback_dispute_oid}'.sub('{' + 'chargeback_dispute_oid' + '}', CGI.escape(chargeback_dispute_oid.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ChargebackDisputeResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"ChargebackApi.delete_chargeback",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ChargebackApi#delete_chargeback\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_chargeback_dispute(chargeback_dispute_oid, opts = {}) ⇒ ChargebackDisputeResponse

Retrieve a chargeback Retrieves a single chargeback using the specified chargeback dispute oid.

Parameters:

  • chargeback_dispute_oid (Integer)

    The chargeback dispute oid to retrieve.

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

    the optional parameters

Options Hash (opts):

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

Returns:



105
106
107
108
# File 'lib/ultracart_api/api/chargeback_api.rb', line 105

def get_chargeback_dispute(chargeback_dispute_oid, opts = {})
  data, _status_code, _headers = get_chargeback_dispute_with_http_info(chargeback_dispute_oid, opts)
  data
end

#get_chargeback_dispute_with_http_info(chargeback_dispute_oid, opts = {}) ⇒ Array<(ChargebackDisputeResponse, Integer, Hash)>

Retrieve a chargeback Retrieves a single chargeback using the specified chargeback dispute oid.

Parameters:

  • chargeback_dispute_oid (Integer)

    The chargeback dispute oid to retrieve.

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

    the optional parameters

Options Hash (opts):

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

Returns:

  • (Array<(ChargebackDisputeResponse, Integer, Hash)>)

    ChargebackDisputeResponse data, response status code and response headers



116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# File 'lib/ultracart_api/api/chargeback_api.rb', line 116

def get_chargeback_dispute_with_http_info(chargeback_dispute_oid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ChargebackApi.get_chargeback_dispute ...'
  end
  # verify the required parameter 'chargeback_dispute_oid' is set
  if @api_client.config.client_side_validation && chargeback_dispute_oid.nil?
    fail ArgumentError, "Missing the required parameter 'chargeback_dispute_oid' when calling ChargebackApi.get_chargeback_dispute"
  end
  # resource path
  local_var_path = '/chargeback/chargebacks/{chargeback_dispute_oid}'.sub('{' + 'chargeback_dispute_oid' + '}', CGI.escape(chargeback_dispute_oid.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'_expand'] = opts[:'_expand'] if !opts[:'_expand'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ChargebackDisputeResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"ChargebackApi.get_chargeback_dispute",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ChargebackApi#get_chargeback_dispute\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_chargeback_disputes(opts = {}) ⇒ ChargebackDisputesResponse

Retrieve chargebacks Retrieves chargebacks from the account. If no parameters are specified, all chargebacks will be returned. You will need to make multiple API calls in order to retrieve the entire result set since this API performs result set pagination.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :order_id (String)

    Order Id

  • :case_number (String)

    Case number

  • :status (String)

    Status

  • :expiration_dts_start (String)

    Expiration dts start

  • :expiration_dts_end (String)

    Expiration dts end

  • :chargeback_dts_start (String)

    Chargeback dts start

  • :chargeback_dts_end (String)

    Chargeback dts end

  • :_limit (Integer)

    The maximum number of records to return on this one API call. (Max 200) (default to 100)

  • :_offset (Integer)

    Pagination of the record set. Offset is a zero based index. (default to 0)

  • :_since (String)

    Fetch chargebacks that have been created/modified since this date/time.

  • :_sort (String)

    The sort order of the chargebacks. See Sorting documentation for examples of using multiple values and sorting by ascending and descending.

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

Returns:



182
183
184
185
# File 'lib/ultracart_api/api/chargeback_api.rb', line 182

def get_chargeback_disputes(opts = {})
  data, _status_code, _headers = get_chargeback_disputes_with_http_info(opts)
  data
end

#get_chargeback_disputes_with_http_info(opts = {}) ⇒ Array<(ChargebackDisputesResponse, Integer, Hash)>

Retrieve chargebacks Retrieves chargebacks from the account. If no parameters are specified, all chargebacks will be returned. You will need to make multiple API calls in order to retrieve the entire result set since this API performs result set pagination.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :order_id (String)

    Order Id

  • :case_number (String)

    Case number

  • :status (String)

    Status

  • :expiration_dts_start (String)

    Expiration dts start

  • :expiration_dts_end (String)

    Expiration dts end

  • :chargeback_dts_start (String)

    Chargeback dts start

  • :chargeback_dts_end (String)

    Chargeback dts end

  • :_limit (Integer)

    The maximum number of records to return on this one API call. (Max 200) (default to 100)

  • :_offset (Integer)

    Pagination of the record set. Offset is a zero based index. (default to 0)

  • :_since (String)

    Fetch chargebacks that have been created/modified since this date/time.

  • :_sort (String)

    The sort order of the chargebacks. See Sorting documentation for examples of using multiple values and sorting by ascending and descending.

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

Returns:

  • (Array<(ChargebackDisputesResponse, Integer, Hash)>)

    ChargebackDisputesResponse data, response status code and response headers



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
# File 'lib/ultracart_api/api/chargeback_api.rb', line 203

def get_chargeback_disputes_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ChargebackApi.get_chargeback_disputes ...'
  end
  # resource path
  local_var_path = '/chargeback/chargebacks'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'order_id'] = opts[:'order_id'] if !opts[:'order_id'].nil?
  query_params[:'case_number'] = opts[:'case_number'] if !opts[:'case_number'].nil?
  query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
  query_params[:'expiration_dts_start'] = opts[:'expiration_dts_start'] if !opts[:'expiration_dts_start'].nil?
  query_params[:'expiration_dts_end'] = opts[:'expiration_dts_end'] if !opts[:'expiration_dts_end'].nil?
  query_params[:'chargeback_dts_start'] = opts[:'chargeback_dts_start'] if !opts[:'chargeback_dts_start'].nil?
  query_params[:'chargeback_dts_end'] = opts[:'chargeback_dts_end'] if !opts[:'chargeback_dts_end'].nil?
  query_params[:'_limit'] = opts[:'_limit'] if !opts[:'_limit'].nil?
  query_params[:'_offset'] = opts[:'_offset'] if !opts[:'_offset'].nil?
  query_params[:'_since'] = opts[:'_since'] if !opts[:'_since'].nil?
  query_params[:'_sort'] = opts[:'_sort'] if !opts[:'_sort'].nil?
  query_params[:'_expand'] = opts[:'_expand'] if !opts[:'_expand'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ChargebackDisputesResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"ChargebackApi.get_chargeback_disputes",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ChargebackApi#get_chargeback_disputes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#insert_chargeback(chargeback, opts = {}) ⇒ ChargebackDisputeResponse

Insert a chargeback Insert a chargeback on the UltraCart account.

Parameters:

  • chargeback (ChargebackDispute)

    Chargeback to insert

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

    the optional parameters

Options Hash (opts):

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

Returns:



266
267
268
269
# File 'lib/ultracart_api/api/chargeback_api.rb', line 266

def insert_chargeback(chargeback, opts = {})
  data, _status_code, _headers = insert_chargeback_with_http_info(chargeback, opts)
  data
end

#insert_chargeback_with_http_info(chargeback, opts = {}) ⇒ Array<(ChargebackDisputeResponse, Integer, Hash)>

Insert a chargeback Insert a chargeback on the UltraCart account.

Parameters:

  • chargeback (ChargebackDispute)

    Chargeback to insert

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

    the optional parameters

Options Hash (opts):

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

Returns:

  • (Array<(ChargebackDisputeResponse, Integer, Hash)>)

    ChargebackDisputeResponse data, response status code and response headers



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
# File 'lib/ultracart_api/api/chargeback_api.rb', line 277

def insert_chargeback_with_http_info(chargeback, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ChargebackApi.insert_chargeback ...'
  end
  # verify the required parameter 'chargeback' is set
  if @api_client.config.client_side_validation && chargeback.nil?
    fail ArgumentError, "Missing the required parameter 'chargeback' when calling ChargebackApi.insert_chargeback"
  end
  # resource path
  local_var_path = '/chargeback/chargebacks'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'_expand'] = opts[:'_expand'] if !opts[:'_expand'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json; charset=UTF-8'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(chargeback)

  # return_type
  return_type = opts[:debug_return_type] || 'ChargebackDisputeResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"ChargebackApi.insert_chargeback",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ChargebackApi#insert_chargeback\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_chargeback(chargeback_dispute_oid, chargeback, opts = {}) ⇒ ChargebackDisputeResponse

Update a chargeback Update a chargeback on the UltraCart account.

Parameters:

  • chargeback_dispute_oid (Integer)

    The chargeback_dispute_oid to update.

  • chargeback (ChargebackDispute)

    Chargeback to update

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

    the optional parameters

Options Hash (opts):

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

Returns:



339
340
341
342
# File 'lib/ultracart_api/api/chargeback_api.rb', line 339

def update_chargeback(chargeback_dispute_oid, chargeback, opts = {})
  data, _status_code, _headers = update_chargeback_with_http_info(chargeback_dispute_oid, chargeback, opts)
  data
end

#update_chargeback_with_http_info(chargeback_dispute_oid, chargeback, opts = {}) ⇒ Array<(ChargebackDisputeResponse, Integer, Hash)>

Update a chargeback Update a chargeback on the UltraCart account.

Parameters:

  • chargeback_dispute_oid (Integer)

    The chargeback_dispute_oid to update.

  • chargeback (ChargebackDispute)

    Chargeback to update

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

    the optional parameters

Options Hash (opts):

  • :_expand (String)

    The object expansion to perform on the result. See documentation for examples

Returns:

  • (Array<(ChargebackDisputeResponse, Integer, Hash)>)

    ChargebackDisputeResponse data, response status code and response headers



351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
# File 'lib/ultracart_api/api/chargeback_api.rb', line 351

def update_chargeback_with_http_info(chargeback_dispute_oid, chargeback, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ChargebackApi.update_chargeback ...'
  end
  # verify the required parameter 'chargeback_dispute_oid' is set
  if @api_client.config.client_side_validation && chargeback_dispute_oid.nil?
    fail ArgumentError, "Missing the required parameter 'chargeback_dispute_oid' when calling ChargebackApi.update_chargeback"
  end
  # verify the required parameter 'chargeback' is set
  if @api_client.config.client_side_validation && chargeback.nil?
    fail ArgumentError, "Missing the required parameter 'chargeback' when calling ChargebackApi.update_chargeback"
  end
  # resource path
  local_var_path = '/chargeback/chargebacks/{chargeback_dispute_oid}'.sub('{' + 'chargeback_dispute_oid' + '}', CGI.escape(chargeback_dispute_oid.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'_expand'] = opts[:'_expand'] if !opts[:'_expand'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json; charset=UTF-8'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(chargeback)

  # return_type
  return_type = opts[:debug_return_type] || 'ChargebackDisputeResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']

  new_options = opts.merge(
    :operation => :"ChargebackApi.update_chargeback",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ChargebackApi#update_chargeback\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end