deltavista_crif_dva_interface 0.0.14 → 0.0.15

Sign up to get free protection for your applications and to get access to all the features.
@@ -20,7 +20,6 @@ module DeltavistaCrifDvaInterface
20
20
  end
21
21
 
22
22
  def to_xml(address)
23
- puts address.inspect
24
23
  builder = Nokogiri::XML::Builder.new(:encoding => @config[:encoding]) do |xml|
25
24
  xml.dvaCheckRequest {
26
25
  xml.identity {
@@ -46,8 +45,8 @@ module DeltavistaCrifDvaInterface
46
45
  if valid_response? xml_doc
47
46
  address = {}
48
47
  metadata = {}
49
- xml_doc.xpath("//private").each do |private_node|
50
- %w(addressId birthDate sex title lastName firstName maidenName street house poBox zip city country phone).each do |key|
48
+ xml_doc.xpath("//dvaCheckResponse/private").each do |private_node|
49
+ %w(addressId birthDate sex lastName firstName maidenName street house poBox zip city country phone).each do |key|
51
50
  if key == "country"
52
51
  address[key.downcase.to_sym] = convert_country(get_value(private_node, key))
53
52
  else
@@ -56,8 +55,8 @@ module DeltavistaCrifDvaInterface
56
55
  end
57
56
  end
58
57
 
59
- xml_doc.xpath("//private/payLoad/highestAddress/private").each do |private_node|
60
- %w(title lastName firstName maidenName street house poBox zip city country phone).each do |key|
58
+ xml_doc.xpath("//dvaCheckResponse/private/payLoad/highestAddress/private").each do |private_node|
59
+ %w(lastName firstName maidenName street house poBox zip city country phone).each do |key|
61
60
  if key == "country"
62
61
  address[key.downcase.to_sym] = convert_country(get_value(private_node, key))
63
62
  else
@@ -80,7 +79,7 @@ module DeltavistaCrifDvaInterface
80
79
 
81
80
  [address, metadata]
82
81
  else
83
- raise NotFoundError
82
+ raise NotFoundError.new(2, "Test")
84
83
  end
85
84
  end
86
85
 
@@ -32,7 +32,6 @@ module DeltavistaCrifDvaInterface
32
32
  end
33
33
 
34
34
  def extract_response(xml_body)
35
- puts "XML-Body #{xml_body.class}"
36
35
  puts xml_body
37
36
  @parser.to_hash(xml_body)
38
37
  end
@@ -4,6 +4,11 @@ module DeltavistaCrifDvaInterface
4
4
  end
5
5
 
6
6
  class NotFoundError < StandardError
7
+ attr_reader :error_code, :error_text
7
8
 
9
+ def initialize(error_code, error_text)
10
+ @error_code = error_code
11
+ @error_text = error_text
12
+ end
8
13
  end
9
14
  end
@@ -1,3 +1,3 @@
1
1
  module DeltavistaCrifDvaInterface
2
- VERSION = "0.0.14"
2
+ VERSION = "0.0.15"
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.14
5
+ version: 0.0.15
6
6
  platform: ruby
7
7
  authors:
8
8
  - Marc Cadalbert