class OrderCloud::PaymentApi

Attributes

api_client[RW]

Public Class Methods

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

Public Instance Methods

create(direction, order_id, payment, opts = {}) click to toggle source

@param direction Direction of the payment. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param payment @param [Hash] opts the optional parameters @return [Payment]

# File lib/order_cloud/api/payment_api.rb, line 41
def create(direction, order_id, payment, opts = {})
  data, _status_code, _headers = create_with_http_info(direction, order_id, payment, opts)
  return data
end
create_transaction(direction, order_id, payment_id, transaction, opts = {}) click to toggle source

@param direction Direction of the payment. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param payment_id ID of the payment. @param transaction @param [Hash] opts the optional parameters @return [Payment]

# File lib/order_cloud/api/payment_api.rb, line 107
def create_transaction(direction, order_id, payment_id, transaction, opts = {})
  data, _status_code, _headers = create_transaction_with_http_info(direction, order_id, payment_id, transaction, opts)
  return data
end
create_transaction_with_http_info(direction, order_id, payment_id, transaction, opts = {}) click to toggle source

@param direction Direction of the payment. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param payment_id ID of the payment. @param transaction @param [Hash] opts the optional parameters @return [Array<(Payment, Fixnum, Hash)>] Payment data, response status code and response headers

# File lib/order_cloud/api/payment_api.rb, line 120
def create_transaction_with_http_info(direction, order_id, payment_id, transaction, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: PaymentApi.create_transaction ..."
  end
  # verify the required parameter 'direction' is set
  fail ArgumentError, "Missing the required parameter 'direction' when calling PaymentApi.create_transaction" if direction.nil?
  # verify the required parameter 'order_id' is set
  fail ArgumentError, "Missing the required parameter 'order_id' when calling PaymentApi.create_transaction" if order_id.nil?
  # verify the required parameter 'payment_id' is set
  fail ArgumentError, "Missing the required parameter 'payment_id' when calling PaymentApi.create_transaction" if payment_id.nil?
  # verify the required parameter 'transaction' is set
  fail ArgumentError, "Missing the required parameter 'transaction' when calling PaymentApi.create_transaction" if transaction.nil?
  # resource path
  local_var_path = "/orders/{direction}/{orderID}/payments/{paymentID}/transactions".sub('{format}','json').sub('{' + 'direction' + '}', direction.to_s).sub('{' + 'orderID' + '}', order_id.to_s).sub('{' + 'paymentID' + '}', payment_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(transaction)
  auth_names = ['oauth2']
  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 => 'Payment')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PaymentApi#create_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
create_with_http_info(direction, order_id, payment, opts = {}) click to toggle source

@param direction Direction of the payment. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param payment @param [Hash] opts the optional parameters @return [Array<(Payment, Fixnum, Hash)>] Payment data, response status code and response headers

# File lib/order_cloud/api/payment_api.rb, line 53
def create_with_http_info(direction, order_id, payment, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: PaymentApi.create ..."
  end
  # verify the required parameter 'direction' is set
  fail ArgumentError, "Missing the required parameter 'direction' when calling PaymentApi.create" if direction.nil?
  # verify the required parameter 'order_id' is set
  fail ArgumentError, "Missing the required parameter 'order_id' when calling PaymentApi.create" if order_id.nil?
  # verify the required parameter 'payment' is set
  fail ArgumentError, "Missing the required parameter 'payment' when calling PaymentApi.create" if payment.nil?
  # resource path
  local_var_path = "/orders/{direction}/{orderID}/payments".sub('{format}','json').sub('{' + 'direction' + '}', direction.to_s).sub('{' + 'orderID' + '}', order_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(payment)
  auth_names = ['oauth2']
  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 => 'Payment')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PaymentApi#create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
delete(direction, order_id, payment_id, opts = {}) click to toggle source

@param direction Direction of the payment. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param payment_id ID of the payment. @param [Hash] opts the optional parameters @return [nil]

# File lib/order_cloud/api/payment_api.rb, line 175
def delete(direction, order_id, payment_id, opts = {})
  delete_with_http_info(direction, order_id, payment_id, opts)
  return nil
end
delete_transaction(direction, order_id, payment_id, transaction_id, opts = {}) click to toggle source

@param direction Direction of the payment. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param payment_id ID of the payment. @param transaction_id ID of the transaction. @param [Hash] opts the optional parameters @return [nil]

# File lib/order_cloud/api/payment_api.rb, line 240
def delete_transaction(direction, order_id, payment_id, transaction_id, opts = {})
  delete_transaction_with_http_info(direction, order_id, payment_id, transaction_id, opts)
  return nil
end
delete_transaction_with_http_info(direction, order_id, payment_id, transaction_id, opts = {}) click to toggle source

@param direction Direction of the payment. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param payment_id ID of the payment. @param transaction_id ID of the transaction. @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers

# File lib/order_cloud/api/payment_api.rb, line 253
def delete_transaction_with_http_info(direction, order_id, payment_id, transaction_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: PaymentApi.delete_transaction ..."
  end
  # verify the required parameter 'direction' is set
  fail ArgumentError, "Missing the required parameter 'direction' when calling PaymentApi.delete_transaction" if direction.nil?
  # verify the required parameter 'order_id' is set
  fail ArgumentError, "Missing the required parameter 'order_id' when calling PaymentApi.delete_transaction" if order_id.nil?
  # verify the required parameter 'payment_id' is set
  fail ArgumentError, "Missing the required parameter 'payment_id' when calling PaymentApi.delete_transaction" if payment_id.nil?
  # verify the required parameter 'transaction_id' is set
  fail ArgumentError, "Missing the required parameter 'transaction_id' when calling PaymentApi.delete_transaction" if transaction_id.nil?
  # resource path
  local_var_path = "/orders/{direction}/{orderID}/payments/{paymentID}/transactions/{transactionID}".sub('{format}','json').sub('{' + 'direction' + '}', direction.to_s).sub('{' + 'orderID' + '}', order_id.to_s).sub('{' + 'paymentID' + '}', payment_id.to_s).sub('{' + 'transactionID' + '}', transaction_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PaymentApi#delete_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
delete_with_http_info(direction, order_id, payment_id, opts = {}) click to toggle source

@param direction Direction of the payment. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param payment_id ID of the payment. @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers

# File lib/order_cloud/api/payment_api.rb, line 187
def delete_with_http_info(direction, order_id, payment_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: PaymentApi.delete ..."
  end
  # verify the required parameter 'direction' is set
  fail ArgumentError, "Missing the required parameter 'direction' when calling PaymentApi.delete" if direction.nil?
  # verify the required parameter 'order_id' is set
  fail ArgumentError, "Missing the required parameter 'order_id' when calling PaymentApi.delete" if order_id.nil?
  # verify the required parameter 'payment_id' is set
  fail ArgumentError, "Missing the required parameter 'payment_id' when calling PaymentApi.delete" if payment_id.nil?
  # resource path
  local_var_path = "/orders/{direction}/{orderID}/payments/{paymentID}".sub('{format}','json').sub('{' + 'direction' + '}', direction.to_s).sub('{' + 'orderID' + '}', order_id.to_s).sub('{' + 'paymentID' + '}', payment_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PaymentApi#delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get(direction, order_id, payment_id, opts = {}) click to toggle source

@param direction Direction of the payment. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param payment_id ID of the payment. @param [Hash] opts the optional parameters @return [Payment]

# File lib/order_cloud/api/payment_api.rb, line 307
def get(direction, order_id, payment_id, opts = {})
  data, _status_code, _headers = get_with_http_info(direction, order_id, payment_id, opts)
  return data
end
get_with_http_info(direction, order_id, payment_id, opts = {}) click to toggle source

@param direction Direction of the payment. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param payment_id ID of the payment. @param [Hash] opts the optional parameters @return [Array<(Payment, Fixnum, Hash)>] Payment data, response status code and response headers

# File lib/order_cloud/api/payment_api.rb, line 319
def get_with_http_info(direction, order_id, payment_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: PaymentApi.get ..."
  end
  # verify the required parameter 'direction' is set
  fail ArgumentError, "Missing the required parameter 'direction' when calling PaymentApi.get" if direction.nil?
  # verify the required parameter 'order_id' is set
  fail ArgumentError, "Missing the required parameter 'order_id' when calling PaymentApi.get" if order_id.nil?
  # verify the required parameter 'payment_id' is set
  fail ArgumentError, "Missing the required parameter 'payment_id' when calling PaymentApi.get" if payment_id.nil?
  # resource path
  local_var_path = "/orders/{direction}/{orderID}/payments/{paymentID}".sub('{format}','json').sub('{' + 'direction' + '}', direction.to_s).sub('{' + 'orderID' + '}', order_id.to_s).sub('{' + 'paymentID' + '}', payment_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  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 => 'Payment')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PaymentApi#get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
list(direction, order_id, opts = {}) click to toggle source

@param direction Direction of the payment. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param [Hash] opts the optional parameters @option opts [String] :search Search of the payment. @option opts [Array<String>] :search_on Search on of the payment. @option opts [Array<String>] :sort_by Sort by of the payment. @option opts [Integer] :page Page of the payment. @option opts [Integer] :page_size Page size of the payment. @option opts [Hash<String, String>] :filters Filters of the payment. @return [ListPayment]

# File lib/order_cloud/api/payment_api.rb, line 377
def list(direction, order_id, opts = {})
  data, _status_code, _headers = list_with_http_info(direction, order_id, opts)
  return data
end
list_with_http_info(direction, order_id, opts = {}) click to toggle source

@param direction Direction of the payment. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param [Hash] opts the optional parameters @option opts [String] :search Search of the payment. @option opts [Array<String>] :search_on Search on of the payment. @option opts [Array<String>] :sort_by Sort by of the payment. @option opts [Integer] :page Page of the payment. @option opts [Integer] :page_size Page size of the payment. @option opts [Hash<String, String>] :filters Filters of the payment. @return [Array<(ListPayment, Fixnum, Hash)>] ListPayment data, response status code and response headers

# File lib/order_cloud/api/payment_api.rb, line 394
def list_with_http_info(direction, order_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: PaymentApi.list ..."
  end
  # verify the required parameter 'direction' is set
  fail ArgumentError, "Missing the required parameter 'direction' when calling PaymentApi.list" if direction.nil?
  # verify the required parameter 'order_id' is set
  fail ArgumentError, "Missing the required parameter 'order_id' when calling PaymentApi.list" if order_id.nil?
  # resource path
  local_var_path = "/orders/{direction}/{orderID}/payments".sub('{format}','json').sub('{' + 'direction' + '}', direction.to_s).sub('{' + 'orderID' + '}', order_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?
  query_params[:'searchOn'] = @api_client.build_collection_param(opts[:'search_on'], :csv) if !opts[:'search_on'].nil?
  query_params[:'sortBy'] = @api_client.build_collection_param(opts[:'sort_by'], :csv) if !opts[:'sort_by'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'filters'] = opts[:'filters'] if !opts[:'filters'].nil?

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2']
  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 => 'ListPayment')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PaymentApi#list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
patch(direction, order_id, payment_id, partial_payment, opts = {}) click to toggle source

@param direction Direction of the payment. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param payment_id ID of the payment. @param partial_payment @param [Hash] opts the optional parameters @return [Payment]

# File lib/order_cloud/api/payment_api.rb, line 452
def patch(direction, order_id, payment_id, partial_payment, opts = {})
  data, _status_code, _headers = patch_with_http_info(direction, order_id, payment_id, partial_payment, opts)
  return data
end
patch_with_http_info(direction, order_id, payment_id, partial_payment, opts = {}) click to toggle source

@param direction Direction of the payment. Possible values: Incoming, Outgoing. @param order_id ID of the order. @param payment_id ID of the payment. @param partial_payment @param [Hash] opts the optional parameters @return [Array<(Payment, Fixnum, Hash)>] Payment data, response status code and response headers

# File lib/order_cloud/api/payment_api.rb, line 465
def patch_with_http_info(direction, order_id, payment_id, partial_payment, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: PaymentApi.patch ..."
  end
  # verify the required parameter 'direction' is set
  fail ArgumentError, "Missing the required parameter 'direction' when calling PaymentApi.patch" if direction.nil?
  # verify the required parameter 'order_id' is set
  fail ArgumentError, "Missing the required parameter 'order_id' when calling PaymentApi.patch" if order_id.nil?
  # verify the required parameter 'payment_id' is set
  fail ArgumentError, "Missing the required parameter 'payment_id' when calling PaymentApi.patch" if payment_id.nil?
  # verify the required parameter 'partial_payment' is set
  fail ArgumentError, "Missing the required parameter 'partial_payment' when calling PaymentApi.patch" if partial_payment.nil?
  # resource path
  local_var_path = "/orders/{direction}/{orderID}/payments/{paymentID}".sub('{format}','json').sub('{' + 'direction' + '}', direction.to_s).sub('{' + 'orderID' + '}', order_id.to_s).sub('{' + 'paymentID' + '}', payment_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json', 'text/plain; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(partial_payment)
  auth_names = ['oauth2']
  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Payment')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PaymentApi#patch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end