Sha256: b97ed0451f00db7f156fcdf3313104089d871f9b5ab116e444566e7c13502e26

Contents?: true

Size: 791 Bytes

Versions: 3

Compression:

Stored size: 791 Bytes

Contents

module EgovUtils
  module Iszr
    class Request < ActiveInteraction::Base
      def execute
        envelope.to_xml
      end

      private

      def envelope
        Nokogiri::XML::Builder.new do |xml|
          xml.GateMessage {
            xml.Version '2.0'
            xml.Header {
              xml.MessageDetails(type: 'request') {
                xml.Class(mode: 'sync') {
                  xml.text service_id
                }
              }
              xml.SenderDetails {
                xml.Authentication(type: 'clear') {
                  xml.ISId '124'
                }
              }
            }
            xml.Body encoded_body(body)
          }
        end
      end

      def encoded_body(body)
        Base64.encode64(body.to_xml)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
egov_utils-1.5.0.alpha3 app/services/egov_utils/iszr/request.rb
egov_utils-1.5.0.alpha2 app/services/egov_utils/iszr/request.rb
egov_utils-1.5.0.alpha1 app/services/egov_utils/iszr/request.rb