class Yapstone::PaymentsApi

Attributes

api_client[RW]

Public Class Methods

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

Public Instance Methods

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

Cancel Payment by payment Id Use a DELETE request to send a payment ID to this endpoint in order to cancel the payment. @param authorization [String] Authorization @param x_yapstone_ip_address [String] Ip Address of the client @param payment_id [String] paymentId @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. @option opts [String] :x_yapstone_fpsid Device Finger Print Id @return [PaymentCancelResponse]

# File lib/yapstone-payments/api/payments_api.rb, line 31
def cancel_payment(authorization, x_yapstone_ip_address, payment_id, opts = {})
  data, _status_code, _headers = cancel_payment_with_http_info(authorization, x_yapstone_ip_address, payment_id, opts)
  data
end
cancel_payment_with_http_info(authorization, x_yapstone_ip_address, payment_id, opts = {}) click to toggle source

Cancel Payment by payment Id Use a DELETE request to send a payment ID to this endpoint in order to cancel the payment. @param authorization [String] Authorization @param x_yapstone_ip_address [String] Ip Address of the client @param payment_id [String] paymentId @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. @option opts [String] :x_yapstone_fpsid Device Finger Print Id @return [Array<(PaymentCancelResponse, Integer, Hash)>] PaymentCancelResponse data, response status code and response headers

# File lib/yapstone-payments/api/payments_api.rb, line 45
def cancel_payment_with_http_info(authorization, x_yapstone_ip_address, payment_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PaymentsApi.cancel_payment ...'
  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 PaymentsApi.cancel_payment"
  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 PaymentsApi.cancel_payment"
  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 PaymentsApi.cancel_payment"
  end
  # resource path
  local_var_path = '/v2/payments/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?
  header_params[:'X-Yapstone-fpsid'] = opts[:'x_yapstone_fpsid'] if !opts[:'x_yapstone_fpsid'].nil?

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

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

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

  # 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(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PaymentsApi#cancel_payment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
cancel_transaction(authorization, x_yapstone_ip_address, transaction_id, opts = {}) click to toggle source

Cancel Transaction by TransactionId Use a transaction identifier to cancel a transaction. @param authorization [String] Authorization @param x_yapstone_ip_address [String] Ip Address of the client @param transaction_id [String] The transaction ID for the transaction you would like to cancel. @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. @option opts [String] :x_yapstone_fpsid Device Finger Print Id @return [PaymentCancelTransactionResponse]

# File lib/yapstone-payments/api/payments_api.rb, line 113
def cancel_transaction(authorization, x_yapstone_ip_address, transaction_id, opts = {})
  data, _status_code, _headers = cancel_transaction_with_http_info(authorization, x_yapstone_ip_address, transaction_id, opts)
  data
end
cancel_transaction_with_http_info(authorization, x_yapstone_ip_address, transaction_id, opts = {}) click to toggle source

Cancel Transaction by TransactionId Use a transaction identifier to cancel a transaction. @param authorization [String] Authorization @param x_yapstone_ip_address [String] Ip Address of the client @param transaction_id [String] The transaction ID for the transaction you would like to cancel. @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. @option opts [String] :x_yapstone_fpsid Device Finger Print Id @return [Array<(PaymentCancelTransactionResponse, Integer, Hash)>] PaymentCancelTransactionResponse data, response status code and response headers

# File lib/yapstone-payments/api/payments_api.rb, line 127
def cancel_transaction_with_http_info(authorization, x_yapstone_ip_address, transaction_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PaymentsApi.cancel_transaction ...'
  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 PaymentsApi.cancel_transaction"
  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 PaymentsApi.cancel_transaction"
  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 PaymentsApi.cancel_transaction"
  end
  # resource path
  local_var_path = '/v2/payments/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-IPAddress'] = x_yapstone_ip_address
  header_params[:'X-Yapstone-Trace-Id'] = opts[:'x_yapstone_trace_id'] if !opts[:'x_yapstone_trace_id'].nil?
  header_params[:'X-Yapstone-fpsid'] = opts[:'x_yapstone_fpsid'] if !opts[:'x_yapstone_fpsid'].nil?

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

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

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

  # 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(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PaymentsApi#cancel_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
capture_payment(authorization, x_yapstone_ip_address, payment_id, opts = {}) click to toggle source

Capture a prior authorized payment Capture a prior authorized payment. This endpoint is used after a payment is authorized. Once a payment is authorized, you must capture it so that money can be transferred from the customer's account to the merchant's account. @param authorization [String] Authorization @param x_yapstone_ip_address [String] Ip Address of the client @param payment_id [String] The payment ID associated with the payment. You can use this to retrieve a payment or chance its status. @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. @option opts [String] :x_yapstone_fpsid Device Finger Print Id @option opts [CapturePaymentRequest] :capture_payment_request @return [PaymentResponse]

# File lib/yapstone-payments/api/payments_api.rb, line 196
def capture_payment(authorization, x_yapstone_ip_address, payment_id, opts = {})
  data, _status_code, _headers = capture_payment_with_http_info(authorization, x_yapstone_ip_address, payment_id, opts)
  data
end
capture_payment_with_http_info(authorization, x_yapstone_ip_address, payment_id, opts = {}) click to toggle source

Capture a prior authorized payment Capture a prior authorized payment. This endpoint is used after a payment is authorized. Once a payment is authorized, you must capture it so that money can be transferred from the customer&#39;s account to the merchant&#39;s account. @param authorization [String] Authorization @param x_yapstone_ip_address [String] Ip Address of the client @param payment_id [String] The payment ID associated with the payment. You can use this to retrieve a payment or chance its status. @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. @option opts [String] :x_yapstone_fpsid Device Finger Print Id @option opts [CapturePaymentRequest] :capture_payment_request @return [Array<(PaymentResponse, Integer, Hash)>] PaymentResponse data, response status code and response headers

# File lib/yapstone-payments/api/payments_api.rb, line 211
def capture_payment_with_http_info(authorization, x_yapstone_ip_address, payment_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PaymentsApi.capture_payment ...'
  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 PaymentsApi.capture_payment"
  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 PaymentsApi.capture_payment"
  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 PaymentsApi.capture_payment"
  end
  # resource path
  local_var_path = '/v2/payments/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'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['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?
  header_params[:'X-Yapstone-fpsid'] = opts[:'x_yapstone_fpsid'] if !opts[:'x_yapstone_fpsid'].nil?

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

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

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

  # 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(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PaymentsApi#capture_payment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
create_payment(authorization, x_yapstone_ip_address, process_payment, opts = {}) click to toggle source

Process Payment The payment endpoint lets you create a payment and send information identifying the customer device the payment comes from. @param authorization [String] Authorization @param x_yapstone_ip_address [String] This is the IP address of the client. @param process_payment [ProcessPayment] processPayment @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. @option opts [String] :x_yapstone_fpsid A device fingerprint is information gathered about the hardware and software of a website visitor combined with browser information. The fingerprint can be used to help retrieve particular sessions later, and it provides details about whoever is making a payment. @return [PaymentResponse]

# File lib/yapstone-payments/api/payments_api.rb, line 281
def create_payment(authorization, x_yapstone_ip_address, process_payment, opts = {})
  data, _status_code, _headers = create_payment_with_http_info(authorization, x_yapstone_ip_address, process_payment, opts)
  data
end
create_payment_with_http_info(authorization, x_yapstone_ip_address, process_payment, opts = {}) click to toggle source

Process Payment The payment endpoint lets you create a payment and send information identifying the customer device the payment comes from. @param authorization [String] Authorization @param x_yapstone_ip_address [String] This is the IP address of the client. @param process_payment [ProcessPayment] processPayment @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. @option opts [String] :x_yapstone_fpsid A device fingerprint is information gathered about the hardware and software of a website visitor combined with browser information. The fingerprint can be used to help retrieve particular sessions later, and it provides details about whoever is making a payment. @return [Array<(PaymentResponse, Integer, Hash)>] PaymentResponse data, response status code and response headers

# File lib/yapstone-payments/api/payments_api.rb, line 295
def create_payment_with_http_info(authorization, x_yapstone_ip_address, process_payment, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PaymentsApi.create_payment ...'
  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 PaymentsApi.create_payment"
  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 PaymentsApi.create_payment"
  end
  # verify the required parameter 'process_payment' is set
  if @api_client.config.client_side_validation && process_payment.nil?
    fail ArgumentError, "Missing the required parameter 'process_payment' when calling PaymentsApi.create_payment"
  end
  # resource path
  local_var_path = '/v2/payments/payment'

  # 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'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['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?
  header_params[:'X-Yapstone-fpsid'] = opts[:'x_yapstone_fpsid'] if !opts[:'x_yapstone_fpsid'].nil?

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

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

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

  # 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(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PaymentsApi#create_payment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_payment(authorization, x_yapstone_ip_address, payment_id, opts = {}) click to toggle source

Get with Payment Id This endpoint lets you send a GET request containing a payment ID. The associated payment is returned to you in the response. @param authorization [String] Authorization @param x_yapstone_ip_address [String] IP Address of the client @param payment_id [String] paymentId @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 [PaymentResponse]

# File lib/yapstone-payments/api/payments_api.rb, line 364
def get_payment(authorization, x_yapstone_ip_address, payment_id, opts = {})
  data, _status_code, _headers = get_payment_with_http_info(authorization, x_yapstone_ip_address, payment_id, opts)
  data
end
get_payment_with_http_info(authorization, x_yapstone_ip_address, payment_id, opts = {}) click to toggle source

Get with Payment Id This endpoint lets you send a GET request containing a payment ID. The associated payment is returned to you in the response. @param authorization [String] Authorization @param x_yapstone_ip_address [String] IP Address of the client @param payment_id [String] paymentId @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<(PaymentResponse, Integer, Hash)>] PaymentResponse data, response status code and response headers

# File lib/yapstone-payments/api/payments_api.rb, line 377
def get_payment_with_http_info(authorization, x_yapstone_ip_address, payment_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PaymentsApi.get_payment ...'
  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 PaymentsApi.get_payment"
  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 PaymentsApi.get_payment"
  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 PaymentsApi.get_payment"
  end
  # resource path
  local_var_path = '/v2/payments/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] || 'PaymentResponse' 

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

Get Transaction by Transaction Id Retrieve information about a specific transaction. @param authorization [String] Authorization @param x_yapstone_ip_address [String] IP Address of the client @param transaction_id [String] The transaction identifier for the transaction you want to retrieve details about. @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 [OrderTransactions]

# File lib/yapstone-payments/api/payments_api.rb, line 443
def get_transaction(authorization, x_yapstone_ip_address, transaction_id, opts = {})
  data, _status_code, _headers = get_transaction_with_http_info(authorization, x_yapstone_ip_address, transaction_id, opts)
  data
end
get_transaction_with_http_info(authorization, x_yapstone_ip_address, transaction_id, opts = {}) click to toggle source

Get Transaction by Transaction Id Retrieve information about a specific transaction. @param authorization [String] Authorization @param x_yapstone_ip_address [String] IP Address of the client @param transaction_id [String] The transaction identifier for the transaction you want to retrieve details about. @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<(OrderTransactions, Integer, Hash)>] OrderTransactions data, response status code and response headers

# File lib/yapstone-payments/api/payments_api.rb, line 456
def get_transaction_with_http_info(authorization, x_yapstone_ip_address, transaction_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PaymentsApi.get_transaction ...'
  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 PaymentsApi.get_transaction"
  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 PaymentsApi.get_transaction"
  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 PaymentsApi.get_transaction"
  end
  # resource path
  local_var_path = '/v2/payments/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-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] || 'OrderTransactions' 

  # 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: PaymentsApi#get_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
verify_payment_instrument(authorization, x_yapstone_ip_address, verify_instrument_request, opts = {}) click to toggle source

Verify payment instrument Use this endpoint to verify that a customer's payment instrument is valid and associated with them. @param authorization [String] Authorization @param x_yapstone_ip_address [String] IP Address of the client @param verify_instrument_request [VerifyInstrumentRequest] verifyInstrumentRequest @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. @option opts [String] :x_yapstone_fpsid Device Finger Print Id @return [InstrumentVerificationResponse]

# File lib/yapstone-payments/api/payments_api.rb, line 523
def verify_payment_instrument(authorization, x_yapstone_ip_address, verify_instrument_request, opts = {})
  data, _status_code, _headers = verify_payment_instrument_with_http_info(authorization, x_yapstone_ip_address, verify_instrument_request, opts)
  data
end
verify_payment_instrument_with_http_info(authorization, x_yapstone_ip_address, verify_instrument_request, opts = {}) click to toggle source

Verify payment instrument Use this endpoint to verify that a customer&#39;s payment instrument is valid and associated with them. @param authorization [String] Authorization @param x_yapstone_ip_address [String] IP Address of the client @param verify_instrument_request [VerifyInstrumentRequest] verifyInstrumentRequest @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. @option opts [String] :x_yapstone_fpsid Device Finger Print Id @return [Array<(InstrumentVerificationResponse, Integer, Hash)>] InstrumentVerificationResponse data, response status code and response headers

# File lib/yapstone-payments/api/payments_api.rb, line 537
def verify_payment_instrument_with_http_info(authorization, x_yapstone_ip_address, verify_instrument_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PaymentsApi.verify_payment_instrument ...'
  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 PaymentsApi.verify_payment_instrument"
  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 PaymentsApi.verify_payment_instrument"
  end
  # verify the required parameter 'verify_instrument_request' is set
  if @api_client.config.client_side_validation && verify_instrument_request.nil?
    fail ArgumentError, "Missing the required parameter 'verify_instrument_request' when calling PaymentsApi.verify_payment_instrument"
  end
  # resource path
  local_var_path = '/v2/payments/instrument/verify'

  # 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'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['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?
  header_params[:'X-Yapstone-fpsid'] = opts[:'x_yapstone_fpsid'] if !opts[:'x_yapstone_fpsid'].nil?

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

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

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

  # 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(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PaymentsApi#verify_payment_instrument\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end