Class: IntuitIdsAggcat::InstitutionLogin

Inherits:
Object
  • Object
show all
Includes:
XML::Mapping
Defined in:
lib/intuit_ids_aggcat/client/intuit_xml_mappings.rb

Instance Method Summary collapse

Instance Method Details

#post_save(xml, options = {:mapping=>:_default}) ⇒ Object

added namespaces to make root element compliant with Intuit’s expectation



112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# File 'lib/intuit_ids_aggcat/client/intuit_xml_mappings.rb', line 112

def post_save xml, options={:mapping=>:_default}
  # using REXML's element namespace method doesn't seem to set the namespace correctly...?
  xml.root.add_attributes("xmlns"=>"http://schema.intuit.com/platform/fdatafeed/institutionlogin/v1")
  xml.root.add_namespace "xsi", "http://www.w3.org/2001/XMLSchema-instance"
  xml.root.add_namespace "xsd", "http://www.w3.org/2001/XMLSchema"
  # for challengeResponses/response
  xml.each_element("//response") do |x| 
    x.add_namespace "v11", "http://schema.intuit.com/platform/fdatafeed/challenge/v1"
    x.name = "v11:response"
  end
  # for challengeResponses root
  xml.each_element("//challengeResponses") do |x| 
    x.add_namespace "v1", "http://schema.intuit.com/platform/fdatafeed/institutionlogin/v1"
    x.name = "challengeResponses"
  end
end