class Conekta::OrdersApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/conekta/api/orders_api.rb, line 19
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

cancel_order(id, opts = {}) click to toggle source

Cancel Order Cancel an order that has been previously created. @param id [String] Identifier of the resource @param [Hash] opts the optional parameters @option opts [String] :accept_language Use for knowing which language to use (default to ‘es’) @option opts [String] :x_child_company_id In the case of a holding company, the company id of the child company to which will process the request. @return [OrderResponse]

# File lib/conekta/api/orders_api.rb, line 29
def cancel_order(id, opts = {})
  data, _status_code, _headers = cancel_order_with_http_info(id, opts)
  data
end
cancel_order_with_http_info(id, opts = {}) click to toggle source

Cancel Order Cancel an order that has been previously created. @param id [String] Identifier of the resource @param [Hash] opts the optional parameters @option opts [String] :accept_language Use for knowing which language to use (default to ‘es’) @option opts [String] :x_child_company_id In the case of a holding company, the company id of the child company to which will process the request. @return [Array<(OrderResponse, Integer, Hash)>] OrderResponse data, response status code and response headers

# File lib/conekta/api/orders_api.rb, line 41
def cancel_order_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrdersApi.cancel_order ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling OrdersApi.cancel_order"
  end
  allowable_values = ["es", "en"]
  if @api_client.config.client_side_validation && opts[:'accept_language'] && !allowable_values.include?(opts[:'accept_language'])
    fail ArgumentError, "invalid value for \"accept_language\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/orders/{id}/cancel'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.1.0+json'])
  header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil?
  header_params[:'X-Child-Company-Id'] = opts[:'x_child_company_id'] if !opts[:'x_child_company_id'].nil?

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"OrdersApi.cancel_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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrdersApi#cancel_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
create_order(order_request, opts = {}) click to toggle source

Create order Create a new order. @param order_request [OrderRequest] requested field for order @param [Hash] opts the optional parameters @option opts [String] :accept_language Use for knowing which language to use (default to ‘es’) @option opts [String] :x_child_company_id In the case of a holding company, the company id of the child company to which will process the request. @return [OrderResponse]

# File lib/conekta/api/orders_api.rb, line 102
def create_order(order_request, opts = {})
  data, _status_code, _headers = create_order_with_http_info(order_request, opts)
  data
end
create_order_with_http_info(order_request, opts = {}) click to toggle source

Create order Create a new order. @param order_request [OrderRequest] requested field for order @param [Hash] opts the optional parameters @option opts [String] :accept_language Use for knowing which language to use (default to ‘es’) @option opts [String] :x_child_company_id In the case of a holding company, the company id of the child company to which will process the request. @return [Array<(OrderResponse, Integer, Hash)>] OrderResponse data, response status code and response headers

# File lib/conekta/api/orders_api.rb, line 114
def create_order_with_http_info(order_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrdersApi.create_order ...'
  end
  # verify the required parameter 'order_request' is set
  if @api_client.config.client_side_validation && order_request.nil?
    fail ArgumentError, "Missing the required parameter 'order_request' when calling OrdersApi.create_order"
  end
  allowable_values = ["es", "en"]
  if @api_client.config.client_side_validation && opts[:'accept_language'] && !allowable_values.include?(opts[:'accept_language'])
    fail ArgumentError, "invalid value for \"accept_language\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/orders'

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

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.1.0+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
  header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil?
  header_params[:'X-Child-Company-Id'] = opts[:'x_child_company_id'] if !opts[:'x_child_company_id'].nil?

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"OrdersApi.create_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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrdersApi#create_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_order_by_id(id, opts = {}) click to toggle source

Get Order Info for a specific order @param id [String] Identifier of the resource @param [Hash] opts the optional parameters @option opts [String] :accept_language Use for knowing which language to use (default to ‘es’) @option opts [String] :x_child_company_id In the case of a holding company, the company id of the child company to which will process the request. @return [OrderResponse]

# File lib/conekta/api/orders_api.rb, line 180
def get_order_by_id(id, opts = {})
  data, _status_code, _headers = get_order_by_id_with_http_info(id, opts)
  data
end
get_order_by_id_with_http_info(id, opts = {}) click to toggle source

Get Order Info for a specific order @param id [String] Identifier of the resource @param [Hash] opts the optional parameters @option opts [String] :accept_language Use for knowing which language to use (default to ‘es’) @option opts [String] :x_child_company_id In the case of a holding company, the company id of the child company to which will process the request. @return [Array<(OrderResponse, Integer, Hash)>] OrderResponse data, response status code and response headers

# File lib/conekta/api/orders_api.rb, line 192
def get_order_by_id_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrdersApi.get_order_by_id ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling OrdersApi.get_order_by_id"
  end
  allowable_values = ["es", "en"]
  if @api_client.config.client_side_validation && opts[:'accept_language'] && !allowable_values.include?(opts[:'accept_language'])
    fail ArgumentError, "invalid value for \"accept_language\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/orders/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.1.0+json'])
  header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil?
  header_params[:'X-Child-Company-Id'] = opts[:'x_child_company_id'] if !opts[:'x_child_company_id'].nil?

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"OrdersApi.get_order_by_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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrdersApi#get_order_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_orders(opts = {}) click to toggle source

Get a list of Orders Get order details in the form of a list @param [Hash] opts the optional parameters @option opts [String] :accept_language Use for knowing which language to use (default to ‘es’) @option opts [String] :x_child_company_id In the case of a holding company, the company id of the child company to which will process the request. @option opts [Integer] :limit The numbers of items to return, the maximum value is 250 (default to 20) @option opts [String] :search General order search, e.g. by mail, reference etc. @option opts [String] :_next next page @option opts [String] :previous previous page @option opts [String] :payment_status Filters by order status @option opts [String] :last_payment_info_status Filters by last payment info status @option opts [Integer] :created_at created equal to @option opts [Integer] :created_at_gte created at greater than or equal to @option opts [Integer] :created_at_lte created at less than or equal to @option opts [Integer] :updated_at_gte updated at greater than or equal to @option opts [Integer] :updated_at_lte updated at less than or equal to @return [GetOrdersResponse]

# File lib/conekta/api/orders_api.rb, line 263
def get_orders(opts = {})
  data, _status_code, _headers = get_orders_with_http_info(opts)
  data
end
get_orders_with_http_info(opts = {}) click to toggle source

Get a list of Orders Get order details in the form of a list @param [Hash] opts the optional parameters @option opts [String] :accept_language Use for knowing which language to use (default to ‘es’) @option opts [String] :x_child_company_id In the case of a holding company, the company id of the child company to which will process the request. @option opts [Integer] :limit The numbers of items to return, the maximum value is 250 (default to 20) @option opts [String] :search General order search, e.g. by mail, reference etc. @option opts [String] :_next next page @option opts [String] :previous previous page @option opts [String] :payment_status Filters by order status @option opts [String] :last_payment_info_status Filters by last payment info status @option opts [Integer] :created_at created equal to @option opts [Integer] :created_at_gte created at greater than or equal to @option opts [Integer] :created_at_lte created at less than or equal to @option opts [Integer] :updated_at_gte updated at greater than or equal to @option opts [Integer] :updated_at_lte updated at less than or equal to @return [Array<(GetOrdersResponse, Integer, Hash)>] GetOrdersResponse data, response status code and response headers

# File lib/conekta/api/orders_api.rb, line 285
def get_orders_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrdersApi.get_orders ...'
  end
  allowable_values = ["es", "en"]
  if @api_client.config.client_side_validation && opts[:'accept_language'] && !allowable_values.include?(opts[:'accept_language'])
    fail ArgumentError, "invalid value for \"accept_language\", must be one of #{allowable_values}"
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 250
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling OrdersApi.get_orders, must be smaller than or equal to 250.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling OrdersApi.get_orders, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/orders'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?
  query_params[:'next'] = opts[:'_next'] if !opts[:'_next'].nil?
  query_params[:'previous'] = opts[:'previous'] if !opts[:'previous'].nil?
  query_params[:'payment_status'] = opts[:'payment_status'] if !opts[:'payment_status'].nil?
  query_params[:'last_payment_info.status'] = opts[:'last_payment_info_status'] if !opts[:'last_payment_info_status'].nil?
  query_params[:'created_at'] = opts[:'created_at'] if !opts[:'created_at'].nil?
  query_params[:'created_at.gte'] = opts[:'created_at_gte'] if !opts[:'created_at_gte'].nil?
  query_params[:'created_at.lte'] = opts[:'created_at_lte'] if !opts[:'created_at_lte'].nil?
  query_params[:'updated_at.gte'] = opts[:'updated_at_gte'] if !opts[:'updated_at_gte'].nil?
  query_params[:'updated_at.lte'] = opts[:'updated_at_lte'] if !opts[:'updated_at_lte'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.1.0+json'])
  header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil?
  header_params[:'X-Child-Company-Id'] = opts[:'x_child_company_id'] if !opts[:'x_child_company_id'].nil?

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

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

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrdersApi#get_orders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
order_cancel_refund(id, refund_id, opts = {}) click to toggle source

Cancel Refund A refunded order describes the items, amount, and reason an order is being refunded. @param id [String] Identifier of the resource @param refund_id [String] refund identifier @param [Hash] opts the optional parameters @option opts [String] :accept_language Use for knowing which language to use (default to ‘es’) @option opts [String] :x_child_company_id In the case of a holding company, the company id of the child company to which will process the request. @return [OrderResponse]

# File lib/conekta/api/orders_api.rb, line 362
def order_cancel_refund(id, refund_id, opts = {})
  data, _status_code, _headers = order_cancel_refund_with_http_info(id, refund_id, opts)
  data
end
order_cancel_refund_with_http_info(id, refund_id, opts = {}) click to toggle source

Cancel Refund A refunded order describes the items, amount, and reason an order is being refunded. @param id [String] Identifier of the resource @param refund_id [String] refund identifier @param [Hash] opts the optional parameters @option opts [String] :accept_language Use for knowing which language to use (default to ‘es’) @option opts [String] :x_child_company_id In the case of a holding company, the company id of the child company to which will process the request. @return [Array<(OrderResponse, Integer, Hash)>] OrderResponse data, response status code and response headers

# File lib/conekta/api/orders_api.rb, line 375
def order_cancel_refund_with_http_info(id, refund_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrdersApi.order_cancel_refund ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling OrdersApi.order_cancel_refund"
  end
  # verify the required parameter 'refund_id' is set
  if @api_client.config.client_side_validation && refund_id.nil?
    fail ArgumentError, "Missing the required parameter 'refund_id' when calling OrdersApi.order_cancel_refund"
  end
  allowable_values = ["es", "en"]
  if @api_client.config.client_side_validation && opts[:'accept_language'] && !allowable_values.include?(opts[:'accept_language'])
    fail ArgumentError, "invalid value for \"accept_language\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/orders/{id}/refunds/{refund_id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)).sub('{' + 'refund_id' + '}', CGI.escape(refund_id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.1.0+json'])
  header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil?
  header_params[:'X-Child-Company-Id'] = opts[:'x_child_company_id'] if !opts[:'x_child_company_id'].nil?

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

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

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrdersApi#order_cancel_refund\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
order_refund(id, order_refund_request, opts = {}) click to toggle source

Refund Order A refunded order describes the items, amount, and reason an order is being refunded. @param id [String] Identifier of the resource @param order_refund_request [OrderRefundRequest] requested field for a refund @param [Hash] opts the optional parameters @option opts [String] :accept_language Use for knowing which language to use (default to ‘es’) @option opts [String] :x_child_company_id In the case of a holding company, the company id of the child company to which will process the request. @return [OrderResponse]

# File lib/conekta/api/orders_api.rb, line 441
def order_refund(id, order_refund_request, opts = {})
  data, _status_code, _headers = order_refund_with_http_info(id, order_refund_request, opts)
  data
end
order_refund_with_http_info(id, order_refund_request, opts = {}) click to toggle source

Refund Order A refunded order describes the items, amount, and reason an order is being refunded. @param id [String] Identifier of the resource @param order_refund_request [OrderRefundRequest] requested field for a refund @param [Hash] opts the optional parameters @option opts [String] :accept_language Use for knowing which language to use (default to ‘es’) @option opts [String] :x_child_company_id In the case of a holding company, the company id of the child company to which will process the request. @return [Array<(OrderResponse, Integer, Hash)>] OrderResponse data, response status code and response headers

# File lib/conekta/api/orders_api.rb, line 454
def order_refund_with_http_info(id, order_refund_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrdersApi.order_refund ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling OrdersApi.order_refund"
  end
  # verify the required parameter 'order_refund_request' is set
  if @api_client.config.client_side_validation && order_refund_request.nil?
    fail ArgumentError, "Missing the required parameter 'order_refund_request' when calling OrdersApi.order_refund"
  end
  allowable_values = ["es", "en"]
  if @api_client.config.client_side_validation && opts[:'accept_language'] && !allowable_values.include?(opts[:'accept_language'])
    fail ArgumentError, "invalid value for \"accept_language\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/orders/{id}/refunds'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.1.0+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
  header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil?
  header_params[:'X-Child-Company-Id'] = opts[:'x_child_company_id'] if !opts[:'x_child_company_id'].nil?

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

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

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrdersApi#order_refund\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
orders_create_capture(id, opts = {}) click to toggle source

Capture Order Processes an order that has been previously authorized. @param id [String] Identifier of the resource @param [Hash] opts the optional parameters @option opts [String] :accept_language Use for knowing which language to use (default to ‘es’) @option opts [String] :x_child_company_id In the case of a holding company, the company id of the child company to which will process the request. @option opts [OrderCaptureRequest] :order_capture_request requested fields for capture order @return [OrderResponse]

# File lib/conekta/api/orders_api.rb, line 525
def orders_create_capture(id, opts = {})
  data, _status_code, _headers = orders_create_capture_with_http_info(id, opts)
  data
end
orders_create_capture_with_http_info(id, opts = {}) click to toggle source

Capture Order Processes an order that has been previously authorized. @param id [String] Identifier of the resource @param [Hash] opts the optional parameters @option opts [String] :accept_language Use for knowing which language to use (default to ‘es’) @option opts [String] :x_child_company_id In the case of a holding company, the company id of the child company to which will process the request. @option opts [OrderCaptureRequest] :order_capture_request requested fields for capture order @return [Array<(OrderResponse, Integer, Hash)>] OrderResponse data, response status code and response headers

# File lib/conekta/api/orders_api.rb, line 538
def orders_create_capture_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrdersApi.orders_create_capture ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling OrdersApi.orders_create_capture"
  end
  allowable_values = ["es", "en"]
  if @api_client.config.client_side_validation && opts[:'accept_language'] && !allowable_values.include?(opts[:'accept_language'])
    fail ArgumentError, "invalid value for \"accept_language\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/orders/{id}/capture'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.1.0+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
  header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil?
  header_params[:'X-Child-Company-Id'] = opts[:'x_child_company_id'] if !opts[:'x_child_company_id'].nil?

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

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

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrdersApi#orders_create_capture\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
update_order(id, order_update_request, opts = {}) click to toggle source

Update Order Update an existing Order. @param id [String] Identifier of the resource @param order_update_request [OrderUpdateRequest] requested field for an order @param [Hash] opts the optional parameters @option opts [String] :accept_language Use for knowing which language to use (default to ‘es’) @return [OrderResponse]

# File lib/conekta/api/orders_api.rb, line 604
def update_order(id, order_update_request, opts = {})
  data, _status_code, _headers = update_order_with_http_info(id, order_update_request, opts)
  data
end
update_order_with_http_info(id, order_update_request, opts = {}) click to toggle source

Update Order Update an existing Order. @param id [String] Identifier of the resource @param order_update_request [OrderUpdateRequest] requested field for an order @param [Hash] opts the optional parameters @option opts [String] :accept_language Use for knowing which language to use (default to ‘es’) @return [Array<(OrderResponse, Integer, Hash)>] OrderResponse data, response status code and response headers

# File lib/conekta/api/orders_api.rb, line 616
def update_order_with_http_info(id, order_update_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrdersApi.update_order ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling OrdersApi.update_order"
  end
  # verify the required parameter 'order_update_request' is set
  if @api_client.config.client_side_validation && order_update_request.nil?
    fail ArgumentError, "Missing the required parameter 'order_update_request' when calling OrdersApi.update_order"
  end
  allowable_values = ["es", "en"]
  if @api_client.config.client_side_validation && opts[:'accept_language'] && !allowable_values.include?(opts[:'accept_language'])
    fail ArgumentError, "invalid value for \"accept_language\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/orders/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.conekta-v2.1.0+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
  header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil?

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"OrdersApi.update_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(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrdersApi#update_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end