Class: UltracartClient::CheckoutApi
- Inherits:
-
Object
- Object
- UltracartClient::CheckoutApi
- Defined in:
- lib/ultracart_api/api/checkout_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Class Method Summary collapse
Instance Method Summary collapse
-
#city_state(cart, opts = {}) ⇒ CityStateZip
City/State for Zip Look up the city and state for the shipping zip code.
-
#city_state_with_http_info(cart, opts = {}) ⇒ Array<(CityStateZip, Integer, Hash)>
City/State for Zip Look up the city and state for the shipping zip code.
-
#finalize_order(finalize_request, opts = {}) ⇒ CartFinalizeOrderResponse
Finalize Order Finalize the cart into an order.
-
#finalize_order_with_http_info(finalize_request, opts = {}) ⇒ Array<(CartFinalizeOrderResponse, Integer, Hash)>
Finalize Order Finalize the cart into an order.
-
#get_affirm_checkout(cart_id, opts = {}) ⇒ CartAffirmCheckoutResponse
Get affirm checkout (by cart id) Get a Affirm checkout object for the specified cart_id parameter.
-
#get_affirm_checkout_with_http_info(cart_id, opts = {}) ⇒ Array<(CartAffirmCheckoutResponse, Integer, Hash)>
Get affirm checkout (by cart id) Get a Affirm checkout object for the specified cart_id parameter.
-
#get_allowed_countries(opts = {}) ⇒ CheckoutAllowedCountriesResponse
Allowed countries Lookup the allowed countries for this merchant id.
-
#get_allowed_countries_with_http_info(opts = {}) ⇒ Array<(CheckoutAllowedCountriesResponse, Integer, Hash)>
Allowed countries Lookup the allowed countries for this merchant id.
-
#get_cart(opts = {}) ⇒ CartResponse
Get cart If the cookie is set on the browser making the request then it will return their active cart.
-
#get_cart_by_cart_id(cart_id, opts = {}) ⇒ CartResponse
Get cart (by cart id) Get a cart specified by the cart_id parameter.
-
#get_cart_by_cart_id_with_http_info(cart_id, opts = {}) ⇒ Array<(CartResponse, Integer, Hash)>
Get cart (by cart id) Get a cart specified by the cart_id parameter.
-
#get_cart_by_return_code(return_code, opts = {}) ⇒ CartResponse
Get cart (by return code) Get a cart specified by the return code parameter.
-
#get_cart_by_return_code_with_http_info(return_code, opts = {}) ⇒ Array<(CartResponse, Integer, Hash)>
Get cart (by return code) Get a cart specified by the return code parameter.
-
#get_cart_by_return_token(opts = {}) ⇒ CartResponse
Get cart (by return token) Get a cart specified by the encrypted return token parameter.
-
#get_cart_by_return_token_with_http_info(opts = {}) ⇒ Array<(CartResponse, Integer, Hash)>
Get cart (by return token) Get a cart specified by the encrypted return token parameter.
-
#get_cart_with_http_info(opts = {}) ⇒ Array<(CartResponse, Integer, Hash)>
Get cart If the cookie is set on the browser making the request then it will return their active cart.
-
#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.
-
#get_state_provinces_for_country_with_http_info(country_code, opts = {}) ⇒ Array<(CheckoutStateProvinceResponse, Integer, Hash)>
Get state/province list for a country code Lookup a state/province list for a given country code.
-
#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).
-
#handoff_cart_with_http_info(handoff_request, opts = {}) ⇒ Array<(CheckoutHandoffResponse, Integer, 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).
-
#initialize(api_client = ApiClient.default) ⇒ CheckoutApi
constructor
A new instance of CheckoutApi.
-
#login(login_request, opts = {}) ⇒ CartProfileLoginResponse
Profile login Login in to the customer profile specified by cart.billing.email and password.
-
#login_with_http_info(login_request, opts = {}) ⇒ Array<(CartProfileLoginResponse, Integer, Hash)>
Profile login Login in to the customer profile specified by cart.billing.email and password.
-
#logout(cart, opts = {}) ⇒ CartResponse
Profile logout Log the cart out of the current profile.
-
#logout_with_http_info(cart, opts = {}) ⇒ Array<(CartResponse, Integer, Hash)>
Profile logout Log the cart out of the current profile.
-
#register(register_request, opts = {}) ⇒ CartProfileRegisterResponse
Profile registration Register a new customer profile.
-
#register_affiliate_click(register_affiliate_click_request, opts = {}) ⇒ RegisterAffiliateClickResponse
Register affiliate click Register an affiliate click.
-
#register_affiliate_click_with_http_info(register_affiliate_click_request, opts = {}) ⇒ Array<(RegisterAffiliateClickResponse, Integer, Hash)>
Register affiliate click Register an affiliate click.
-
#register_with_http_info(register_request, opts = {}) ⇒ Array<(CartProfileRegisterResponse, Integer, Hash)>
Profile registration Register a new customer profile.
-
#related_items_for_cart(cart, opts = {}) ⇒ ItemsResponse
Related items Retrieve all the related items for the cart contents.
-
#related_items_for_cart_with_http_info(cart, opts = {}) ⇒ Array<(ItemsResponse, Integer, Hash)>
Related items Retrieve all the related items for the cart contents.
-
#related_items_for_item(item_id, cart, opts = {}) ⇒ ItemsResponse
Related items (specific item) Retrieve all the related items for the cart contents.
-
#related_items_for_item_with_http_info(item_id, cart, opts = {}) ⇒ Array<(ItemsResponse, Integer, Hash)>
Related items (specific item) Retrieve all the related items for the cart contents.
-
#setup_browser_key(browser_key_request, opts = {}) ⇒ CheckoutSetupBrowserKeyResponse
Setup Browser Application Setup a browser key authenticated application with checkout permissions.
-
#setup_browser_key_with_http_info(browser_key_request, opts = {}) ⇒ Array<(CheckoutSetupBrowserKeyResponse, Integer, Hash)>
Setup Browser Application Setup a browser key authenticated application with checkout permissions.
-
#update_cart(cart, opts = {}) ⇒ CartResponse
Update cart Update the cart.
-
#update_cart_with_http_info(cart, opts = {}) ⇒ Array<(CartResponse, Integer, Hash)>
Update cart Update the cart.
-
#validate_cart(validation_request, opts = {}) ⇒ CartValidationResponse
Validate Validate the cart for errors.
-
#validate_cart_with_http_info(validation_request, opts = {}) ⇒ Array<(CartValidationResponse, Integer, Hash)>
Validate Validate the cart for errors.
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_client ⇒ Object
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
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, Integer, 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
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 98 99 100 101 102 |
# 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 = 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']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) 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(cart) # return_type return_type = opts[:debug_return_type] || 'CityStateZip' # auth_names auth_names = opts[:debug_auth_names] || ['ultraCartBrowserApiKey', 'ultraCartOauth', 'ultraCartSimpleApiKey'] = opts.merge( :operation => :"CheckoutApi.city_state", :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, ) 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.
109 110 111 112 |
# File 'lib/ultracart_api/api/checkout_api.rb', line 109 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, Integer, 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.
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 165 166 167 168 169 170 171 |
# File 'lib/ultracart_api/api/checkout_api.rb', line 119 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 = 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']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) 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(finalize_request) # return_type return_type = opts[:debug_return_type] || 'CartFinalizeOrderResponse' # auth_names auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey'] = opts.merge( :operation => :"CheckoutApi.finalize_order", :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, ) 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.
178 179 180 181 |
# File 'lib/ultracart_api/api/checkout_api.rb', line 178 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, Integer, Hash)>
Get affirm checkout (by cart id) Get a Affirm checkout object for the specified cart_id parameter.
188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 |
# File 'lib/ultracart_api/api/checkout_api.rb', line 188 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' + '}', CGI.escape(cart_id.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] || 'CartAffirmCheckoutResponse' # auth_names auth_names = opts[:debug_auth_names] || ['ultraCartBrowserApiKey', 'ultraCartOauth', 'ultraCartSimpleApiKey'] = opts.merge( :operation => :"CheckoutApi.get_affirm_checkout", :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, ) 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
241 242 243 244 |
# File 'lib/ultracart_api/api/checkout_api.rb', line 241 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, Integer, Hash)>
Allowed countries Lookup the allowed countries for this merchant id
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 291 292 293 |
# File 'lib/ultracart_api/api/checkout_api.rb', line 250 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 = 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] || 'CheckoutAllowedCountriesResponse' # auth_names auth_names = opts[:debug_auth_names] || ['ultraCartBrowserApiKey', 'ultraCartOauth', 'ultraCartSimpleApiKey'] = opts.merge( :operation => :"CheckoutApi.get_allowed_countries", :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, ) 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.
300 301 302 303 |
# File 'lib/ultracart_api/api/checkout_api.rb', line 300 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.
362 363 364 365 |
# File 'lib/ultracart_api/api/checkout_api.rb', line 362 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, Integer, Hash)>
Get cart (by cart id) Get a cart specified by the cart_id parameter.
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 409 410 411 412 413 414 415 416 417 418 419 420 421 |
# File 'lib/ultracart_api/api/checkout_api.rb', line 373 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' + '}', CGI.escape(cart_id.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] || 'CartResponse' # auth_names auth_names = opts[:debug_auth_names] || ['ultraCartBrowserApiKey', 'ultraCartOauth', 'ultraCartSimpleApiKey'] = opts.merge( :operation => :"CheckoutApi.get_cart_by_cart_id", :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, ) 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.
429 430 431 432 |
# File 'lib/ultracart_api/api/checkout_api.rb', line 429 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, Integer, Hash)>
Get cart (by return code) Get a cart specified by the return code parameter.
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 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 |
# File 'lib/ultracart_api/api/checkout_api.rb', line 440 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' + '}', CGI.escape(return_code.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] || 'CartResponse' # auth_names auth_names = opts[:debug_auth_names] || ['ultraCartBrowserApiKey', 'ultraCartOauth', 'ultraCartSimpleApiKey'] = opts.merge( :operation => :"CheckoutApi.get_cart_by_return_code", :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, ) 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.
496 497 498 499 |
# File 'lib/ultracart_api/api/checkout_api.rb', line 496 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, Integer, Hash)>
Get cart (by return token) Get a cart specified by the encrypted return token parameter.
507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 |
# File 'lib/ultracart_api/api/checkout_api.rb', line 507 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 = opts[: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 = 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] || 'CartResponse' # auth_names auth_names = opts[:debug_auth_names] || ['ultraCartBrowserApiKey', 'ultraCartOauth', 'ultraCartSimpleApiKey'] = opts.merge( :operation => :"CheckoutApi.get_cart_by_return_token", :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, ) 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, Integer, 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.
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/checkout_api.rb', line 310 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 = 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] || 'CartResponse' # auth_names auth_names = opts[:debug_auth_names] || ['ultraCartBrowserApiKey', 'ultraCartOauth', 'ultraCartSimpleApiKey'] = opts.merge( :operation => :"CheckoutApi.get_cart", :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, ) 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
559 560 561 562 |
# File 'lib/ultracart_api/api/checkout_api.rb', line 559 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, Integer, Hash)>
Get state/province list for a country code Lookup a state/province list for a given country code
569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 |
# File 'lib/ultracart_api/api/checkout_api.rb', line 569 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' + '}', CGI.escape(country_code.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] || 'CheckoutStateProvinceResponse' # auth_names auth_names = opts[:debug_auth_names] || ['ultraCartBrowserApiKey', 'ultraCartOauth', 'ultraCartSimpleApiKey'] = opts.merge( :operation => :"CheckoutApi.get_state_provinces_for_country", :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, ) 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).
624 625 626 627 |
# File 'lib/ultracart_api/api/checkout_api.rb', line 624 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, Integer, 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).
635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 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 |
# File 'lib/ultracart_api/api/checkout_api.rb', line 635 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 = 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']) 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(handoff_request) # return_type return_type = opts[:debug_return_type] || 'CheckoutHandoffResponse' # auth_names auth_names = opts[:debug_auth_names] || ['ultraCartBrowserApiKey', 'ultraCartOauth', 'ultraCartSimpleApiKey'] = opts.merge( :operation => :"CheckoutApi.handoff_cart", :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, ) 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
696 697 698 699 |
# File 'lib/ultracart_api/api/checkout_api.rb', line 696 def login(login_request, opts = {}) data, _status_code, _headers = login_with_http_info(login_request, opts) data end |
#login_with_http_info(login_request, opts = {}) ⇒ Array<(CartProfileLoginResponse, Integer, Hash)>
Profile login Login in to the customer profile specified by cart.billing.email and password
707 708 709 710 711 712 713 714 715 716 717 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 759 760 |
# File 'lib/ultracart_api/api/checkout_api.rb', line 707 def login_with_http_info(login_request, 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 && login_request.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 = 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']) 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(login_request) # return_type return_type = opts[:debug_return_type] || 'CartProfileLoginResponse' # auth_names auth_names = opts[:debug_auth_names] || ['ultraCartBrowserApiKey', 'ultraCartOauth', 'ultraCartSimpleApiKey'] = opts.merge( :operation => :"CheckoutApi.login", :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, ) 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.
768 769 770 771 |
# File 'lib/ultracart_api/api/checkout_api.rb', line 768 def logout(cart, opts = {}) data, _status_code, _headers = logout_with_http_info(cart, opts) data end |
#logout_with_http_info(cart, opts = {}) ⇒ Array<(CartResponse, Integer, Hash)>
Profile logout Log the cart out of the current profile. No error will occur if they are not logged in.
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 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 |
# File 'lib/ultracart_api/api/checkout_api.rb', line 779 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 = 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']) 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(cart) # return_type return_type = opts[:debug_return_type] || 'CartResponse' # auth_names auth_names = opts[:debug_auth_names] || ['ultraCartBrowserApiKey', 'ultraCartOauth', 'ultraCartSimpleApiKey'] = opts.merge( :operation => :"CheckoutApi.logout", :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, ) 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.
840 841 842 843 |
# File 'lib/ultracart_api/api/checkout_api.rb', line 840 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.
912 913 914 915 |
# File 'lib/ultracart_api/api/checkout_api.rb', line 912 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, Integer, Hash)>
Register affiliate click Register an affiliate click. Used by custom checkouts that are completely API based and do not perform checkout handoff.
923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 |
# File 'lib/ultracart_api/api/checkout_api.rb', line 923 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 = 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']) 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(register_affiliate_click_request) # return_type return_type = opts[:debug_return_type] || 'RegisterAffiliateClickResponse' # auth_names auth_names = opts[:debug_auth_names] || ['ultraCartBrowserApiKey', 'ultraCartOauth', 'ultraCartSimpleApiKey'] = opts.merge( :operation => :"CheckoutApi.register_affiliate_click", :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, ) 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, Integer, Hash)>
Profile registration Register a new customer profile. Requires the cart.billing object to be populated along with the password.
851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 |
# File 'lib/ultracart_api/api/checkout_api.rb', line 851 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 = 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']) 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(register_request) # return_type return_type = opts[:debug_return_type] || 'CartProfileRegisterResponse' # auth_names auth_names = opts[:debug_auth_names] || ['ultraCartBrowserApiKey', 'ultraCartOauth', 'ultraCartSimpleApiKey'] = opts.merge( :operation => :"CheckoutApi.register", :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, ) 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_for_cart(cart, opts = {}) ⇒ ItemsResponse
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.
984 985 986 987 |
# File 'lib/ultracart_api/api/checkout_api.rb', line 984 def (cart, opts = {}) data, _status_code, _headers = (cart, opts) data end |
#related_items_for_cart_with_http_info(cart, opts = {}) ⇒ Array<(ItemsResponse, Integer, Hash)>
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.
995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 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 |
# File 'lib/ultracart_api/api/checkout_api.rb', line 995 def (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 = 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']) 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(cart) # return_type return_type = opts[:debug_return_type] || 'ItemsResponse' # auth_names auth_names = opts[:debug_auth_names] || ['ultraCartBrowserApiKey', 'ultraCartOauth', 'ultraCartSimpleApiKey'] = opts.merge( :operation => :"CheckoutApi.related_items_for_cart", :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, ) 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_for_item(item_id, cart, opts = {}) ⇒ ItemsResponse
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.
1057 1058 1059 1060 |
# File 'lib/ultracart_api/api/checkout_api.rb', line 1057 def (item_id, cart, opts = {}) data, _status_code, _headers = (item_id, cart, opts) data end |
#related_items_for_item_with_http_info(item_id, cart, opts = {}) ⇒ Array<(ItemsResponse, Integer, Hash)>
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.
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 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 |
# File 'lib/ultracart_api/api/checkout_api.rb', line 1069 def (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' + '}', CGI.escape(item_id.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']) 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(cart) # return_type return_type = opts[:debug_return_type] || 'ItemsResponse' # auth_names auth_names = opts[:debug_auth_names] || ['ultraCartBrowserApiKey', 'ultraCartOauth', 'ultraCartSimpleApiKey'] = opts.merge( :operation => :"CheckoutApi.related_items_for_item", :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, ) 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.
1133 1134 1135 1136 |
# File 'lib/ultracart_api/api/checkout_api.rb', line 1133 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, Integer, 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.
1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 |
# File 'lib/ultracart_api/api/checkout_api.rb', line 1143 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 = 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']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) 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(browser_key_request) # return_type return_type = opts[:debug_return_type] || 'CheckoutSetupBrowserKeyResponse' # auth_names auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey'] = opts.merge( :operation => :"CheckoutApi.setup_browser_key", :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, ) 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.
1203 1204 1205 1206 |
# File 'lib/ultracart_api/api/checkout_api.rb', line 1203 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, Integer, Hash)>
Update cart Update the cart.
1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 |
# File 'lib/ultracart_api/api/checkout_api.rb', line 1214 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 = 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']) 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(cart) # return_type return_type = opts[:debug_return_type] || 'CartResponse' # auth_names auth_names = opts[:debug_auth_names] || ['ultraCartBrowserApiKey', 'ultraCartOauth', 'ultraCartSimpleApiKey'] = opts.merge( :operation => :"CheckoutApi.update_cart", :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, ) 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.
1275 1276 1277 1278 |
# File 'lib/ultracart_api/api/checkout_api.rb', line 1275 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, Integer, Hash)>
Validate Validate the cart for errors. Specific checks can be passed and multiple validations can occur throughout your checkout flow.
1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 |
# File 'lib/ultracart_api/api/checkout_api.rb', line 1286 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 = 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']) 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(validation_request) # return_type return_type = opts[:debug_return_type] || 'CartValidationResponse' # auth_names auth_names = opts[:debug_auth_names] || ['ultraCartBrowserApiKey', 'ultraCartOauth', 'ultraCartSimpleApiKey'] = opts.merge( :operation => :"CheckoutApi.validate_cart", :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, ) 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 |