deltavista_crif_dva_interface 0.0.10 → 0.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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 title lastName firstName maidenName street house poBox zip city country phone birthDate sex).each do |key|
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!"
@@ -1,3 +1,3 @@
1
1
  module DeltavistaCrifDvaInterface
2
- VERSION = "0.0.10"
2
+ VERSION = "0.0.11"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: deltavista_crif_dva_interface
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.10
5
+ version: 0.0.11
6
6
  platform: ruby
7
7
  authors:
8
8
  - Marc Cadalbert