lib/biro/gateways/midia100/request.rb in biro-0.4.1 vs lib/biro/gateways/midia100/request.rb in biro-0.5.1
- old
+ new
@@ -29,9 +29,13 @@
Response.new(responses)
end
private
+ def savon_options
+ { strip_namespaces: false }
+ end
+
def verify_response responses
raise AuthenticationError.new("Error at Midia100 request: #{responses[:registration].body[:consultar_response][:consultar_result]}") if responses[:registration]&.body[:consultar_response][:consultar_result]&.include? "Usuário ou Senha Estão Incorretos"
raise DocumentNotFoundError.new("Error at Midia100 request: #{responses[:registration].body[:consultar_response][:consultar_result]}") if responses[:registration]&.body[:consultar_response][:consultar_result]&.include? "Cpf Inválido"
raise StandardError.new("Error at Midia100 request: #{responses[:registration].body[:consultar_response][:consultar_result]}") if responses[:registration]&.body[:consultar_response][:consultar_result]&.include? "<ERRO>"
end