Module: Envelope

Defined in:
app/modules/envelope.rb

Class Method Summary collapse

Class Method Details

.build_envelope(mode, service, encoded_body) ⇒ Object



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'app/modules/envelope.rb', line 2

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