deltavista_crif_dva_interface 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
@@ -13,6 +13,7 @@ module DeltavistaCrifDvaInterface
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def to_xml(address)
|
16
|
+
puts address.inspect
|
16
17
|
builder = Nokogiri::XML::Builder.new(:encoding => @@encoding) do |xml|
|
17
18
|
xml.dvaCheckRequest {
|
18
19
|
xml.identity {
|
@@ -34,12 +35,19 @@ module DeltavistaCrifDvaInterface
|
|
34
35
|
end
|
35
36
|
|
36
37
|
def to_hash(xml_body)
|
38
|
+
puts xml_body
|
37
39
|
xml_doc = Nokogiri::XML(xml_body, @@encoding)
|
38
40
|
if valid_response? xml_doc
|
39
41
|
# private tag
|
40
42
|
address = {}
|
41
43
|
xml_doc.xpath("//private").each do |private_node|
|
42
|
-
%w(addressId
|
44
|
+
%w(addressId birthDate sex).each do |key|
|
45
|
+
address[key.downcase] = get_value(private_node, key)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
xml_doc.xpath("//private/payLoad/highestAddress/private").each do |private_node|
|
50
|
+
%w(title lastName firstName maidenName street house poBox zip city country phone).each do |key|
|
43
51
|
if key == "country"
|
44
52
|
address[key.downcase] = convert_country(get_value(private_node, key))
|
45
53
|
else
|
@@ -59,6 +67,7 @@ module DeltavistaCrifDvaInterface
|
|
59
67
|
address[key.downcase] = get_value(highestaddress_node, key)
|
60
68
|
end
|
61
69
|
end
|
70
|
+
|
62
71
|
address
|
63
72
|
else
|
64
73
|
puts "Response not valid!"
|