Class: UltracartClient::CheckoutApi

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ CheckoutApi

Returns a new instance of CheckoutApi.



19
20
21
# File 'lib/ultracart_api/api/checkout_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/checkout_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/checkout_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::CheckoutApi.new(api_client)
end

Instance Method Details

#city_state(cart, opts = {}) ⇒ CityStateZip

City/State for Zip Look up the city and state for the shipping zip code. Useful for building an auto complete for parts of the shipping address

Parameters:

  • cart

    Cart

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

    the optional parameters

Returns:



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

def city_state(cart, opts = {})
  data, _status_code, _headers = city_state_with_http_info(cart, opts)
  data
end

#city_state_with_http_info(cart, opts = {}) ⇒ Array<(CityStateZip, Fixnum, Hash)>

City/State for Zip Look up the city and state for the shipping zip code. Useful for building an auto complete for parts of the shipping address

Parameters:

  • cart

    Cart

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

    the optional parameters

Returns:

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

    CityStateZip 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
# File 'lib/ultracart_api/api/checkout_api.rb', line 50

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

  # 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 = @api_client.object_to_http_body(cart)
  auth_names = ['ultraCartBrowserApiKey', '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 => 'CityStateZip')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CheckoutApi#city_state\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#finalize_order(finalize_request, opts = {}) ⇒ CartFinalizeOrderResponse

Finalize Order Finalize the cart into an order. This method can not be called with browser key authentication. It is ONLY meant for server side code to call.

Parameters:

  • finalize_request

    Finalize request

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

    the optional parameters

Returns:



95
96
97
98
# File 'lib/ultracart_api/api/checkout_api.rb', line 95

def finalize_order(finalize_request, opts = {})
  data, _status_code, _headers = finalize_order_with_http_info(finalize_request, opts)
  data
end

#finalize_order_with_http_info(finalize_request, opts = {}) ⇒ Array<(CartFinalizeOrderResponse, Fixnum, Hash)>

Finalize Order Finalize the cart into an order. This method can not be called with browser key authentication. It is ONLY meant for server side code to call.

Parameters:

  • finalize_request

    Finalize request

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

    the optional parameters

Returns:

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

    CartFinalizeOrderResponse data, response status code and response headers



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

def finalize_order_with_http_info(finalize_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CheckoutApi.finalize_order ...'
  end
  # verify the required parameter 'finalize_request' is set
  if @api_client.config.client_side_validation && finalize_request.nil?
    fail ArgumentError, "Missing the required parameter 'finalize_request' when calling CheckoutApi.finalize_order"
  end
  # resource path
  local_var_path = '/checkout/cart/finalizeOrder'

  # 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 = @api_client.object_to_http_body(finalize_request)
  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 => 'CartFinalizeOrderResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CheckoutApi#finalize_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_affirm_checkout(cart_id, opts = {}) ⇒ CartAffirmCheckoutResponse

Get affirm checkout (by cart id) Get a Affirm checkout object for the specified cart_id parameter.

Parameters:

  • cart_id

    Cart ID to retrieve

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

    the optional parameters

Returns:



150
151
152
153
# File 'lib/ultracart_api/api/checkout_api.rb', line 150

def get_affirm_checkout(cart_id, opts = {})
  data, _status_code, _headers = get_affirm_checkout_with_http_info(cart_id, opts)
  data
end

#get_affirm_checkout_with_http_info(cart_id, opts = {}) ⇒ Array<(CartAffirmCheckoutResponse, Fixnum, Hash)>

Get affirm checkout (by cart id) Get a Affirm checkout object for the specified cart_id parameter.

Parameters:

  • cart_id

    Cart ID to retrieve

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

    the optional parameters

Returns:

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

    CartAffirmCheckoutResponse data, response status code and response headers



160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
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
# File 'lib/ultracart_api/api/checkout_api.rb', line 160

def get_affirm_checkout_with_http_info(cart_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CheckoutApi.get_affirm_checkout ...'
  end
  # verify the required parameter 'cart_id' is set
  if @api_client.config.client_side_validation && cart_id.nil?
    fail ArgumentError, "Missing the required parameter 'cart_id' when calling CheckoutApi.get_affirm_checkout"
  end
  # resource path
  local_var_path = '/checkout/cart/{cart_id}/affirmCheckout'.sub('{' + 'cart_id' + '}', cart_id.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 = ['ultraCartBrowserApiKey', '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 => 'CartAffirmCheckoutResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CheckoutApi#get_affirm_checkout\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_allowed_countries(opts = {}) ⇒ CheckoutAllowedCountriesResponse

Allowed countries Lookup the allowed countries for this merchant id

Parameters:

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

    the optional parameters

Returns:



204
205
206
207
# File 'lib/ultracart_api/api/checkout_api.rb', line 204

def get_allowed_countries(opts = {})
  data, _status_code, _headers = get_allowed_countries_with_http_info(opts)
  data
end

#get_allowed_countries_with_http_info(opts = {}) ⇒ Array<(CheckoutAllowedCountriesResponse, Fixnum, Hash)>

Allowed countries Lookup the allowed countries for this merchant id

Parameters:

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

    the optional parameters

Returns:



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

def get_allowed_countries_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CheckoutApi.get_allowed_countries ...'
  end
  # resource path
  local_var_path = '/checkout/allowedCountries'

  # 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 = ['ultraCartBrowserApiKey', '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 => 'CheckoutAllowedCountriesResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CheckoutApi#get_allowed_countries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_cart(opts = {}) ⇒ CartResponse

Get cart If the cookie is set on the browser making the request then it will return their active cart. Otherwise it will create a new cart.

Parameters:

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



254
255
256
257
# File 'lib/ultracart_api/api/checkout_api.rb', line 254

def get_cart(opts = {})
  data, _status_code, _headers = get_cart_with_http_info(opts)
  data
end

#get_cart_by_cart_id(cart_id, opts = {}) ⇒ CartResponse

Get cart (by cart id) Get a cart specified by the cart_id parameter.

Parameters:

  • cart_id

    Cart ID 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:



307
308
309
310
# File 'lib/ultracart_api/api/checkout_api.rb', line 307

def get_cart_by_cart_id(cart_id, opts = {})
  data, _status_code, _headers = get_cart_by_cart_id_with_http_info(cart_id, opts)
  data
end

#get_cart_by_cart_id_with_http_info(cart_id, opts = {}) ⇒ Array<(CartResponse, Fixnum, Hash)>

Get cart (by cart id) Get a cart specified by the cart_id parameter.

Parameters:

  • cart_id

    Cart ID 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<(CartResponse, Fixnum, Hash)>)

    CartResponse data, response status code and response headers



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

def get_cart_by_cart_id_with_http_info(cart_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CheckoutApi.get_cart_by_cart_id ...'
  end
  # verify the required parameter 'cart_id' is set
  if @api_client.config.client_side_validation && cart_id.nil?
    fail ArgumentError, "Missing the required parameter 'cart_id' when calling CheckoutApi.get_cart_by_cart_id"
  end
  # resource path
  local_var_path = '/checkout/cart/{cart_id}'.sub('{' + 'cart_id' + '}', cart_id.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 = ['ultraCartBrowserApiKey', '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 => 'CartResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CheckoutApi#get_cart_by_cart_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_cart_by_return_code(return_code, opts = {}) ⇒ CartResponse

Get cart (by return code) Get a cart specified by the return code parameter.

Parameters:

  • return_code

    Return code to lookup cart ID by

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



365
366
367
368
# File 'lib/ultracart_api/api/checkout_api.rb', line 365

def get_cart_by_return_code(return_code, opts = {})
  data, _status_code, _headers = get_cart_by_return_code_with_http_info(return_code, opts)
  data
end

#get_cart_by_return_code_with_http_info(return_code, opts = {}) ⇒ Array<(CartResponse, Fixnum, Hash)>

Get cart (by return code) Get a cart specified by the return code parameter.

Parameters:

  • return_code

    Return code to lookup cart ID by

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

    CartResponse data, response status code and response headers



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
409
410
411
412
413
414
415
416
# File 'lib/ultracart_api/api/checkout_api.rb', line 376

def get_cart_by_return_code_with_http_info(return_code, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CheckoutApi.get_cart_by_return_code ...'
  end
  # verify the required parameter 'return_code' is set
  if @api_client.config.client_side_validation && return_code.nil?
    fail ArgumentError, "Missing the required parameter 'return_code' when calling CheckoutApi.get_cart_by_return_code"
  end
  # resource path
  local_var_path = '/checkout/return/{return_code}'.sub('{' + 'return_code' + '}', return_code.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 = ['ultraCartBrowserApiKey', '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 => 'CartResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CheckoutApi#get_cart_by_return_code\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_cart_by_return_token(opts = {}) ⇒ CartResponse

Get cart (by return token) Get a cart specified by the encrypted return token parameter.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :return_token (String)

    Return token provided by StoreFront Communications

  • :_expand (String)

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

Returns:



423
424
425
426
# File 'lib/ultracart_api/api/checkout_api.rb', line 423

def get_cart_by_return_token(opts = {})
  data, _status_code, _headers = get_cart_by_return_token_with_http_info(opts)
  data
end

#get_cart_by_return_token_with_http_info(opts = {}) ⇒ Array<(CartResponse, Fixnum, Hash)>

Get cart (by return token) Get a cart specified by the encrypted return token parameter.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :return_token (String)

    Return token provided by StoreFront Communications

  • :_expand (String)

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

Returns:

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

    CartResponse data, response status code and response headers



434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
# File 'lib/ultracart_api/api/checkout_api.rb', line 434

def get_cart_by_return_token_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CheckoutApi.get_cart_by_return_token ...'
  end
  # resource path
  local_var_path = '/checkout/return_token'

  # query parameters
  query_params = {}
  query_params[:'return_token'] = opts[:'return_token'] if !opts[:'return_token'].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 = ['ultraCartBrowserApiKey', '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 => 'CartResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CheckoutApi#get_cart_by_return_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_cart_with_http_info(opts = {}) ⇒ Array<(CartResponse, Fixnum, Hash)>

Get cart If the cookie is set on the browser making the request then it will return their active cart. Otherwise it will create a new cart.

Parameters:

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

    CartResponse data, response status code and response headers



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

def get_cart_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CheckoutApi.get_cart ...'
  end
  # resource path
  local_var_path = '/checkout/cart'

  # 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 = ['ultraCartBrowserApiKey', '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 => 'CartResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CheckoutApi#get_cart\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_state_provinces_for_country(country_code, opts = {}) ⇒ CheckoutStateProvinceResponse

Get state/province list for a country code Lookup a state/province list for a given country code

Parameters:

  • country_code

    Two letter ISO country code

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

    the optional parameters

Returns:



477
478
479
480
# File 'lib/ultracart_api/api/checkout_api.rb', line 477

def get_state_provinces_for_country(country_code, opts = {})
  data, _status_code, _headers = get_state_provinces_for_country_with_http_info(country_code, opts)
  data
end

#get_state_provinces_for_country_with_http_info(country_code, opts = {}) ⇒ Array<(CheckoutStateProvinceResponse, Fixnum, Hash)>

Get state/province list for a country code Lookup a state/province list for a given country code

Parameters:

  • country_code

    Two letter ISO country code

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

    the optional parameters

Returns:



487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
# File 'lib/ultracart_api/api/checkout_api.rb', line 487

def get_state_provinces_for_country_with_http_info(country_code, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CheckoutApi.get_state_provinces_for_country ...'
  end
  # verify the required parameter 'country_code' is set
  if @api_client.config.client_side_validation && country_code.nil?
    fail ArgumentError, "Missing the required parameter 'country_code' when calling CheckoutApi.get_state_provinces_for_country"
  end
  # resource path
  local_var_path = '/checkout/stateProvincesForCountry/{country_code}'.sub('{' + 'country_code' + '}', country_code.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 = ['ultraCartBrowserApiKey', '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 => 'CheckoutStateProvinceResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CheckoutApi#get_state_provinces_for_country\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#handoff_cart(handoff_request, opts = {}) ⇒ CheckoutHandoffResponse

Handoff cart Handoff the browser to UltraCart for view cart on StoreFront, transfer to PayPal, transfer to Affirm, transfer to Sezzle or finalization of the order (including upsell processing).

Parameters:

  • handoff_request

    Handoff request

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



533
534
535
536
# File 'lib/ultracart_api/api/checkout_api.rb', line 533

def handoff_cart(handoff_request, opts = {})
  data, _status_code, _headers = handoff_cart_with_http_info(handoff_request, opts)
  data
end

#handoff_cart_with_http_info(handoff_request, opts = {}) ⇒ Array<(CheckoutHandoffResponse, Fixnum, Hash)>

Handoff cart Handoff the browser to UltraCart for view cart on StoreFront, transfer to PayPal, transfer to Affirm, transfer to Sezzle or finalization of the order (including upsell processing).

Parameters:

  • handoff_request

    Handoff request

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

    CheckoutHandoffResponse data, response status code and response headers



544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
# File 'lib/ultracart_api/api/checkout_api.rb', line 544

def handoff_cart_with_http_info(handoff_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CheckoutApi.handoff_cart ...'
  end
  # verify the required parameter 'handoff_request' is set
  if @api_client.config.client_side_validation && handoff_request.nil?
    fail ArgumentError, "Missing the required parameter 'handoff_request' when calling CheckoutApi.handoff_cart"
  end
  # resource path
  local_var_path = '/checkout/cart/handoff'

  # 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 = @api_client.object_to_http_body(handoff_request)
  auth_names = ['ultraCartBrowserApiKey', '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 => 'CheckoutHandoffResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CheckoutApi#handoff_cart\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#login(login_request, opts = {}) ⇒ CartProfileLoginResponse

Profile login Login in to the customer profile specified by cart.billing.email and password

Parameters:

  • login_request

    Login request

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



591
592
593
594
# File 'lib/ultracart_api/api/checkout_api.rb', line 591

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

#login_with_http_info(login_request, opts = {}) ⇒ Array<(CartProfileLoginResponse, Fixnum, Hash)>

Profile login Login in to the customer profile specified by cart.billing.email and password

Parameters:

  • login_request

    Login request

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

    CartProfileLoginResponse data, response status code and response headers



602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
# File 'lib/ultracart_api/api/checkout_api.rb', line 602

def (, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CheckoutApi.login ...'
  end
  # verify the required parameter 'login_request' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'login_request' when calling CheckoutApi.login"
  end
  # resource path
  local_var_path = '/checkout/cart/profile/login'

  # 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 = @api_client.object_to_http_body()
  auth_names = ['ultraCartBrowserApiKey', '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 => 'CartProfileLoginResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CheckoutApi#login\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#logout(cart, opts = {}) ⇒ CartResponse

Profile logout Log the cart out of the current profile. No error will occur if they are not logged in.

Parameters:

  • cart

    Cart

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



649
650
651
652
# File 'lib/ultracart_api/api/checkout_api.rb', line 649

def logout(cart, opts = {})
  data, _status_code, _headers = logout_with_http_info(cart, opts)
  data
end

#logout_with_http_info(cart, opts = {}) ⇒ Array<(CartResponse, Fixnum, Hash)>

Profile logout Log the cart out of the current profile. No error will occur if they are not logged in.

Parameters:

  • cart

    Cart

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

    CartResponse data, response status code and response headers



660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
# File 'lib/ultracart_api/api/checkout_api.rb', line 660

def logout_with_http_info(cart, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CheckoutApi.logout ...'
  end
  # verify the required parameter 'cart' is set
  if @api_client.config.client_side_validation && cart.nil?
    fail ArgumentError, "Missing the required parameter 'cart' when calling CheckoutApi.logout"
  end
  # resource path
  local_var_path = '/checkout/cart/profile/logout'

  # 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 = @api_client.object_to_http_body(cart)
  auth_names = ['ultraCartBrowserApiKey', '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 => 'CartResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CheckoutApi#logout\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#register(register_request, opts = {}) ⇒ CartProfileRegisterResponse

Profile registration Register a new customer profile. Requires the cart.billing object to be populated along with the password.

Parameters:

  • register_request

    Register request

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



707
708
709
710
# File 'lib/ultracart_api/api/checkout_api.rb', line 707

def register(register_request, opts = {})
  data, _status_code, _headers = register_with_http_info(register_request, opts)
  data
end

#register_affiliate_click(register_affiliate_click_request, opts = {}) ⇒ RegisterAffiliateClickResponse

Register affiliate click Register an affiliate click. Used by custom checkouts that are completely API based and do not perform checkout handoff.

Parameters:

  • register_affiliate_click_request

    Register affiliate click request

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



765
766
767
768
# File 'lib/ultracart_api/api/checkout_api.rb', line 765

def register_affiliate_click(register_affiliate_click_request, opts = {})
  data, _status_code, _headers = register_affiliate_click_with_http_info(register_affiliate_click_request, opts)
  data
end

#register_affiliate_click_with_http_info(register_affiliate_click_request, opts = {}) ⇒ Array<(RegisterAffiliateClickResponse, Fixnum, Hash)>

Register affiliate click Register an affiliate click. Used by custom checkouts that are completely API based and do not perform checkout handoff.

Parameters:

  • register_affiliate_click_request

    Register affiliate click request

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



776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
# File 'lib/ultracart_api/api/checkout_api.rb', line 776

def register_affiliate_click_with_http_info(register_affiliate_click_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CheckoutApi.register_affiliate_click ...'
  end
  # verify the required parameter 'register_affiliate_click_request' is set
  if @api_client.config.client_side_validation && register_affiliate_click_request.nil?
    fail ArgumentError, "Missing the required parameter 'register_affiliate_click_request' when calling CheckoutApi.register_affiliate_click"
  end
  # resource path
  local_var_path = '/checkout/affiliateClick/register'

  # 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 = @api_client.object_to_http_body(register_affiliate_click_request)
  auth_names = ['ultraCartBrowserApiKey', '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 => 'RegisterAffiliateClickResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CheckoutApi#register_affiliate_click\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#register_with_http_info(register_request, opts = {}) ⇒ Array<(CartProfileRegisterResponse, Fixnum, Hash)>

Profile registration Register a new customer profile. Requires the cart.billing object to be populated along with the password.

Parameters:

  • register_request

    Register request

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



718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
# File 'lib/ultracart_api/api/checkout_api.rb', line 718

def register_with_http_info(register_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CheckoutApi.register ...'
  end
  # verify the required parameter 'register_request' is set
  if @api_client.config.client_side_validation && register_request.nil?
    fail ArgumentError, "Missing the required parameter 'register_request' when calling CheckoutApi.register"
  end
  # resource path
  local_var_path = '/checkout/cart/profile/register'

  # 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 = @api_client.object_to_http_body(register_request)
  auth_names = ['ultraCartBrowserApiKey', '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 => 'CartProfileRegisterResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CheckoutApi#register\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

Related items Retrieve all the related items for the cart contents. Expansion is limited to content, content.assignments, content.attributes, content.multimedia, content.multimedia.thumbnails, options, pricing, and pricing.tiers.

Parameters:

  • cart

    Cart

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

    the optional parameters

Options Hash (opts):

  • :_expand (String)

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

Returns:



823
824
825
826
# File 'lib/ultracart_api/api/checkout_api.rb', line 823

def related_items_for_cart(cart, opts = {})
  data, _status_code, _headers = related_items_for_cart_with_http_info(cart, opts)
  data
end

Related items Retrieve all the related items for the cart contents. Expansion is limited to content, content.assignments, content.attributes, content.multimedia, content.multimedia.thumbnails, options, pricing, and pricing.tiers.

Parameters:

  • cart

    Cart

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

    the optional parameters

Options Hash (opts):

  • :_expand (String)

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

Returns:

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

    ItemsResponse data, response status code and response headers



834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
# File 'lib/ultracart_api/api/checkout_api.rb', line 834

def related_items_for_cart_with_http_info(cart, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CheckoutApi.related_items_for_cart ...'
  end
  # verify the required parameter 'cart' is set
  if @api_client.config.client_side_validation && cart.nil?
    fail ArgumentError, "Missing the required parameter 'cart' when calling CheckoutApi.related_items_for_cart"
  end
  # resource path
  local_var_path = '/checkout/related_items'

  # 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 = @api_client.object_to_http_body(cart)
  auth_names = ['ultraCartBrowserApiKey', '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 => 'ItemsResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CheckoutApi#related_items_for_cart\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

Related items (specific item) Retrieve all the related items for the cart contents. Expansion is limited to content, content.assignments, content.attributes, content.multimedia, content.multimedia.thumbnails, options, pricing, and pricing.tiers.

Parameters:

  • item_id

    Item ID to retrieve related items for

  • cart

    Cart

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

    the optional parameters

Options Hash (opts):

  • :_expand (String)

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

Returns:



882
883
884
885
# File 'lib/ultracart_api/api/checkout_api.rb', line 882

def related_items_for_item(item_id, cart, opts = {})
  data, _status_code, _headers = related_items_for_item_with_http_info(item_id, cart, opts)
  data
end

Related items (specific item) Retrieve all the related items for the cart contents. Expansion is limited to content, content.assignments, content.attributes, content.multimedia, content.multimedia.thumbnails, options, pricing, and pricing.tiers.

Parameters:

  • item_id

    Item ID to retrieve related items for

  • cart

    Cart

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

    the optional parameters

Options Hash (opts):

  • :_expand (String)

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

Returns:

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

    ItemsResponse data, response status code and response headers



894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
# File 'lib/ultracart_api/api/checkout_api.rb', line 894

def related_items_for_item_with_http_info(item_id, cart, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CheckoutApi.related_items_for_item ...'
  end
  # verify the required parameter 'item_id' is set
  if @api_client.config.client_side_validation && item_id.nil?
    fail ArgumentError, "Missing the required parameter 'item_id' when calling CheckoutApi.related_items_for_item"
  end
  # verify the required parameter 'cart' is set
  if @api_client.config.client_side_validation && cart.nil?
    fail ArgumentError, "Missing the required parameter 'cart' when calling CheckoutApi.related_items_for_item"
  end
  # resource path
  local_var_path = '/checkout/relatedItems/{item_id}'.sub('{' + 'item_id' + '}', item_id.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 = @api_client.object_to_http_body(cart)
  auth_names = ['ultraCartBrowserApiKey', '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 => 'ItemsResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CheckoutApi#related_items_for_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#setup_browser_key(browser_key_request, opts = {}) ⇒ CheckoutSetupBrowserKeyResponse

Setup Browser Application Setup a browser key authenticated application with checkout permissions. This REST call must be made with an authentication scheme that is not browser key. The new application will be linked to the application that makes this call. If this application is disabled / deleted, then so will the application setup by this call. The purpose of this call is to allow an OAuth application, such as the Wordpress plugin, to setup the proper browser based authentication for the REST checkout API to use.

Parameters:

  • browser_key_request

    Setup browser key request

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

    the optional parameters

Returns:



944
945
946
947
# File 'lib/ultracart_api/api/checkout_api.rb', line 944

def setup_browser_key(browser_key_request, opts = {})
  data, _status_code, _headers = setup_browser_key_with_http_info(browser_key_request, opts)
  data
end

#setup_browser_key_with_http_info(browser_key_request, opts = {}) ⇒ Array<(CheckoutSetupBrowserKeyResponse, Fixnum, Hash)>

Setup Browser Application Setup a browser key authenticated application with checkout permissions. This REST call must be made with an authentication scheme that is not browser key. The new application will be linked to the application that makes this call. If this application is disabled / deleted, then so will the application setup by this call. The purpose of this call is to allow an OAuth application, such as the Wordpress plugin, to setup the proper browser based authentication for the REST checkout API to use.

Parameters:

  • browser_key_request

    Setup browser key request

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

    the optional parameters

Returns:



954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
# File 'lib/ultracart_api/api/checkout_api.rb', line 954

def setup_browser_key_with_http_info(browser_key_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CheckoutApi.setup_browser_key ...'
  end
  # verify the required parameter 'browser_key_request' is set
  if @api_client.config.client_side_validation && browser_key_request.nil?
    fail ArgumentError, "Missing the required parameter 'browser_key_request' when calling CheckoutApi.setup_browser_key"
  end
  # resource path
  local_var_path = '/checkout/browser_key'

  # 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 = @api_client.object_to_http_body(browser_key_request)
  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 => 'CheckoutSetupBrowserKeyResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CheckoutApi#setup_browser_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_cart(cart, opts = {}) ⇒ CartResponse

Update cart Update the cart.

Parameters:

  • cart

    Cart

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



1000
1001
1002
1003
# File 'lib/ultracart_api/api/checkout_api.rb', line 1000

def update_cart(cart, opts = {})
  data, _status_code, _headers = update_cart_with_http_info(cart, opts)
  data
end

#update_cart_with_http_info(cart, opts = {}) ⇒ Array<(CartResponse, Fixnum, Hash)>

Update cart Update the cart.

Parameters:

  • cart

    Cart

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

    CartResponse data, response status code and response headers



1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
# File 'lib/ultracart_api/api/checkout_api.rb', line 1011

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

  # 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 = @api_client.object_to_http_body(cart)
  auth_names = ['ultraCartBrowserApiKey', '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 => 'CartResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CheckoutApi#update_cart\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#validate_cart(validation_request, opts = {}) ⇒ CartValidationResponse

Validate Validate the cart for errors. Specific checks can be passed and multiple validations can occur throughout your checkout flow.

Parameters:

  • validation_request

    Validation request

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



1058
1059
1060
1061
# File 'lib/ultracart_api/api/checkout_api.rb', line 1058

def validate_cart(validation_request, opts = {})
  data, _status_code, _headers = validate_cart_with_http_info(validation_request, opts)
  data
end

#validate_cart_with_http_info(validation_request, opts = {}) ⇒ Array<(CartValidationResponse, Fixnum, Hash)>

Validate Validate the cart for errors. Specific checks can be passed and multiple validations can occur throughout your checkout flow.

Parameters:

  • validation_request

    Validation request

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

    CartValidationResponse data, response status code and response headers



1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
# File 'lib/ultracart_api/api/checkout_api.rb', line 1069

def validate_cart_with_http_info(validation_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CheckoutApi.validate_cart ...'
  end
  # verify the required parameter 'validation_request' is set
  if @api_client.config.client_side_validation && validation_request.nil?
    fail ArgumentError, "Missing the required parameter 'validation_request' when calling CheckoutApi.validate_cart"
  end
  # resource path
  local_var_path = '/checkout/cart/validate'

  # 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 = @api_client.object_to_http_body(validation_request)
  auth_names = ['ultraCartBrowserApiKey', '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 => 'CartValidationResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CheckoutApi#validate_cart\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end