127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
|
# File 'lib/razor_risk/razor/connectivity/razor_3/response.rb', line 127
def initialize node
trace ParamNames[ :node ], node
check_parameter node, 'node', types: [ ::Nokogiri::XML::Node ]
razor_outbound = node.xpath('/razorOutbound')
if razor_outbound.nil? || razor_outbound.empty?
log :failure, "node(#{node.class})='#{node.to_xml}'"
raise ArgumentError, "node does not contain a recognised Razor 3 response"
end
@s = node.to_s
@body = obtain_ razor_outbound, 'body', no_text: true
if @body
@body = ::Nokogiri.XML(@body.to_s).root
end
@errors = obtain_ razor_outbound, 'errors', no_text: true
@caller = obtain_ razor_outbound, 'caller'
@request_received_time = to_time_ obtain_ razor_outbound, 'requestReceivedTime', nil: true
@response_sent_time = to_time_ obtain_ razor_outbound, 'responseSentTime', nil: true
@response_received_time = to_time_ obtain_ razor_outbound, 'responseReceivedTime', nil: true
@result_code = obtain_ razor_outbound, 'returnCode'
@reasons = obtain_reasons_ @errors
e_c = @errors ? @errors.xpath('error/code') : nil
@razor_code = e_c ? e_c.text.chomp.strip : ''
end
|