Sha256: 4c24f32e0fd5ff62f23990f327fa00264ea62eeabaed82c64dec04817db3a05d

Contents?: true

Size: 854 Bytes

Versions: 1

Compression:

Stored size: 854 Bytes

Contents

module Orbital
  module Gateway
    class Api::Inquiry < Api
      class << self
        def find_request(retry_trace_number)
          gateway = new
          xml_data = gateway.xml_body({retry_trace_number: retry_trace_number})
          response = gateway.post(xml_data)
          OrbitalResponse::InquiryResponse.new(response)
        end
      end

      def xml_body(parameters)
        xml = xml_envelope
        xml.tag! :Request do
          xml.tag! :Inquiry do
            add_xml_credentials(xml)
            add_bin_merchant_and_terminal(xml)
            add_data(xml, parameters)
          end
        end
      end

      def add_data(xml, parameters)
        xml.tag! :OrderID,                          parameters[:order_id]
        xml.tag! :InquiryRetryNumber,               parameters[:retry_trace_number]
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
orbital-gateway-1.0.0 lib/orbital/gateway/api/inquiry.rb