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



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.



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, Fixnum, Hash)>

Delete a chargeback Delete a chargeback on the UltraCart account.



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
# 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' + '}', chargeback_dispute_oid.to_s)

  # query parameters

  query_params = {}

  # header parameters

  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'

  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters

  form_params = {}

  # http body (model)

  post_body = nil
  auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
  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 => 'ChargebackDisputeResponse')
  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.

Options Hash (opts):

  • :_expand (String)

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



96
97
98
99
# File 'lib/ultracart_api/api/chargeback_api.rb', line 96

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, Fixnum, Hash)>

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

Options Hash (opts):

  • :_expand (String)

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



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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# File 'lib/ultracart_api/api/chargeback_api.rb', line 107

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' + '}', chargeback_dispute_oid.to_s)

  # query parameters

  query_params = {}
  query_params[:'_expand'] = opts[:'_expand'] if !opts[:'_expand'].nil?

  # header parameters

  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'

  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters

  form_params = {}

  # http body (model)

  post_body = nil
  auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
  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 => 'ChargebackDisputeResponse')
  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.

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



164
165
166
167
# File 'lib/ultracart_api/api/chargeback_api.rb', line 164

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, Fixnum, 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.

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)

  • :_offset (Integer)

    Pagination of the record set. Offset is a zero based index.

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



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
226
227
228
229
230
231
232
# File 'lib/ultracart_api/api/chargeback_api.rb', line 185

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 = {}
  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 = {}
  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'

  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters

  form_params = {}

  # http body (model)

  post_body = nil
  auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
  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 => 'ChargebackDisputesResponse')
  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.

Options Hash (opts):

  • :_expand (String)

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



239
240
241
242
# File 'lib/ultracart_api/api/chargeback_api.rb', line 239

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, Fixnum, Hash)>

Insert a chargeback Insert a chargeback on the UltraCart account.

Options Hash (opts):

  • :_expand (String)

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



250
251
252
253
254
255
256
257
258
259
260
261
262
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
# File 'lib/ultracart_api/api/chargeback_api.rb', line 250

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 = {}
  query_params[:'_expand'] = opts[:'_expand'] if !opts[:'_expand'].nil?

  # header parameters

  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'

  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=UTF-8'])

  # form parameters

  form_params = {}

  # http body (model)

  post_body = @api_client.object_to_http_body(chargeback)
  auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
  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 => 'ChargebackDisputeResponse')
  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, chargeback_dispute_oid, opts = {}) ⇒ ChargebackDisputeResponse

Update a chargeback Update a chargeback on the UltraCart account.

Options Hash (opts):

  • :_expand (String)

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



298
299
300
301
# File 'lib/ultracart_api/api/chargeback_api.rb', line 298

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

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

Update a chargeback Update a chargeback on the UltraCart account.

Options Hash (opts):

  • :_expand (String)

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



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

def update_chargeback_with_http_info(chargeback, chargeback_dispute_oid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: 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
  # 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
  # resource path

  local_var_path = '/chargeback/chargebacks/{chargeback_dispute_oid}'.sub('{' + 'chargeback_dispute_oid' + '}', chargeback_dispute_oid.to_s)

  # query parameters

  query_params = {}
  query_params[:'_expand'] = opts[:'_expand'] if !opts[:'_expand'].nil?

  # header parameters

  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'

  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=UTF-8'])

  # form parameters

  form_params = {}

  # http body (model)

  post_body = @api_client.object_to_http_body(chargeback)
  auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ChargebackDisputeResponse')
  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