class Yapstone::SearchApi

Attributes

api_client[RW]

Public Class Methods

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

Public Instance Methods

search_by_payment_id(authorization, x_yapstone_ip_address, payment_id, opts = {}) click to toggle source

Search with Payment Id Use this endpoint to search for a payment by payment ID. @param authorization [String] Authorization @param x_yapstone_ip_address [String] IP Address of the client @param payment_id [String] @param [Hash] opts the optional parameters @option opts [String] :x_yapstone_trace_id Optionally provide a unique identifier for this request, for use later if you need to debug this request with Yapstone support. Can be any arbitrary string. @return [SearchPaymentResponse]

# File lib/yapstone-payments/api/search_api.rb, line 30
def search_by_payment_id(authorization, x_yapstone_ip_address, payment_id, opts = {})
  data, _status_code, _headers = search_by_payment_id_with_http_info(authorization, x_yapstone_ip_address, payment_id, opts)
  data
end
search_by_payment_id_with_http_info(authorization, x_yapstone_ip_address, payment_id, opts = {}) click to toggle source

Search with Payment Id Use this endpoint to search for a payment by payment ID. @param authorization [String] Authorization @param x_yapstone_ip_address [String] IP Address of the client @param payment_id [String] @param [Hash] opts the optional parameters @option opts [String] :x_yapstone_trace_id Optionally provide a unique identifier for this request, for use later if you need to debug this request with Yapstone support. Can be any arbitrary string. @return [Array<(SearchPaymentResponse, Integer, Hash)>] SearchPaymentResponse data, response status code and response headers

# File lib/yapstone-payments/api/search_api.rb, line 43
def search_by_payment_id_with_http_info(authorization, x_yapstone_ip_address, payment_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SearchApi.search_by_payment_id ...'
  end
  # verify the required parameter 'authorization' is set
  if @api_client.config.client_side_validation && authorization.nil?
    fail ArgumentError, "Missing the required parameter 'authorization' when calling SearchApi.search_by_payment_id"
  end
  # verify the required parameter 'x_yapstone_ip_address' is set
  if @api_client.config.client_side_validation && x_yapstone_ip_address.nil?
    fail ArgumentError, "Missing the required parameter 'x_yapstone_ip_address' when calling SearchApi.search_by_payment_id"
  end
  # verify the required parameter 'payment_id' is set
  if @api_client.config.client_side_validation && payment_id.nil?
    fail ArgumentError, "Missing the required parameter 'payment_id' when calling SearchApi.search_by_payment_id"
  end
  # resource path
  local_var_path = '/v2/search/payment/{paymentId}'.sub('{' + 'paymentId' + '}', CGI.escape(payment_id.to_s).gsub('%2F', '/'))

  # 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/json'])
  header_params[:'Authorization'] = authorization
  header_params[:'X-Yapstone-IPAddress'] = x_yapstone_ip_address
  header_params[:'X-Yapstone-Trace-Id'] = opts[:'x_yapstone_trace_id'] if !opts[:'x_yapstone_trace_id'].nil?

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

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

  # return_type
  return_type = opts[:return_type] || 'SearchPaymentResponse' 

  # auth_names
  auth_names = opts[:auth_names] || ['Bearer']

  new_options = opts.merge(
    :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: SearchApi#search_by_payment_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
search_by_transaction_id(authorization, x_yapstone_fpsid, x_yapstone_ip_address, transaction_id, opts = {}) click to toggle source

Search with transaction id Use this endpoint to search for particular transactions using their transaction ID. @param authorization [String] Authorization @param x_yapstone_fpsid [String] Device Finger Print Id @param x_yapstone_ip_address [String] IP Address of the client @param transaction_id [String] @param [Hash] opts the optional parameters @option opts [String] :x_yapstone_trace_id Optionally provide a unique identifier for this request, for use later if you need to debug this request with Yapstone support. Can be any arbitrary string. @return [SearchPaymentResponse]

# File lib/yapstone-payments/api/search_api.rb, line 110
def search_by_transaction_id(authorization, x_yapstone_fpsid, x_yapstone_ip_address, transaction_id, opts = {})
  data, _status_code, _headers = search_by_transaction_id_with_http_info(authorization, x_yapstone_fpsid, x_yapstone_ip_address, transaction_id, opts)
  data
end
search_by_transaction_id_with_http_info(authorization, x_yapstone_fpsid, x_yapstone_ip_address, transaction_id, opts = {}) click to toggle source

Search with transaction id Use this endpoint to search for particular transactions using their transaction ID. @param authorization [String] Authorization @param x_yapstone_fpsid [String] Device Finger Print Id @param x_yapstone_ip_address [String] IP Address of the client @param transaction_id [String] @param [Hash] opts the optional parameters @option opts [String] :x_yapstone_trace_id Optionally provide a unique identifier for this request, for use later if you need to debug this request with Yapstone support. Can be any arbitrary string. @return [Array<(SearchPaymentResponse, Integer, Hash)>] SearchPaymentResponse data, response status code and response headers

# File lib/yapstone-payments/api/search_api.rb, line 124
def search_by_transaction_id_with_http_info(authorization, x_yapstone_fpsid, x_yapstone_ip_address, transaction_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SearchApi.search_by_transaction_id ...'
  end
  # verify the required parameter 'authorization' is set
  if @api_client.config.client_side_validation && authorization.nil?
    fail ArgumentError, "Missing the required parameter 'authorization' when calling SearchApi.search_by_transaction_id"
  end
  # verify the required parameter 'x_yapstone_fpsid' is set
  if @api_client.config.client_side_validation && x_yapstone_fpsid.nil?
    fail ArgumentError, "Missing the required parameter 'x_yapstone_fpsid' when calling SearchApi.search_by_transaction_id"
  end
  # verify the required parameter 'x_yapstone_ip_address' is set
  if @api_client.config.client_side_validation && x_yapstone_ip_address.nil?
    fail ArgumentError, "Missing the required parameter 'x_yapstone_ip_address' when calling SearchApi.search_by_transaction_id"
  end
  # verify the required parameter 'transaction_id' is set
  if @api_client.config.client_side_validation && transaction_id.nil?
    fail ArgumentError, "Missing the required parameter 'transaction_id' when calling SearchApi.search_by_transaction_id"
  end
  # resource path
  local_var_path = '/v2/search/transaction/{transactionId}'.sub('{' + 'transactionId' + '}', CGI.escape(transaction_id.to_s).gsub('%2F', '/'))

  # 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/json'])
  header_params[:'Authorization'] = authorization
  header_params[:'X-Yapstone-fpsid'] = x_yapstone_fpsid
  header_params[:'X-Yapstone-IPAddress'] = x_yapstone_ip_address
  header_params[:'X-Yapstone-Trace-Id'] = opts[:'x_yapstone_trace_id'] if !opts[:'x_yapstone_trace_id'].nil?

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

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

  # return_type
  return_type = opts[:return_type] || 'SearchPaymentResponse' 

  # auth_names
  auth_names = opts[:auth_names] || ['Bearer']

  new_options = opts.merge(
    :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: SearchApi#search_by_transaction_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end