deltavista_crif_dva_interface 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
@@ -2,9 +2,11 @@ require 'nokogiri'
|
|
2
2
|
|
3
3
|
module DeltavistaCrifDvaInterface
|
4
4
|
class DeltaVistaService < RestfulService
|
5
|
+
attr_reader :url, :logger, :config
|
5
6
|
|
6
7
|
def initialize(config)
|
7
8
|
@url = config.deltavista_service_url
|
9
|
+
@logger = config.logger || Logger.new(STDOUT)
|
8
10
|
@config = config
|
9
11
|
end
|
10
12
|
|
@@ -41,7 +43,7 @@ module DeltavistaCrifDvaInterface
|
|
41
43
|
@parser = CreditCheckShortV02.new @config
|
42
44
|
request_body = @parser.to_xml(address)
|
43
45
|
headers = {'Content-Type' => 'text/xml'}
|
44
|
-
post_http_request(
|
46
|
+
post_http_request(url, request_body, headers) do |data|
|
45
47
|
extract_response data
|
46
48
|
end
|
47
49
|
end
|
@@ -57,8 +59,10 @@ module DeltavistaCrifDvaInterface
|
|
57
59
|
def verify_address(address)
|
58
60
|
@parser = AddressUpdate.new @config
|
59
61
|
request_body = @parser.to_xml(address)
|
62
|
+
logger.debug request_body.inspect
|
60
63
|
headers = {'Content-Type' => 'text/xml'}
|
61
|
-
post_http_request(
|
64
|
+
post_http_request(url, request_body, headers) do |data|
|
65
|
+
logger.debug data.inspect
|
62
66
|
extract_response data
|
63
67
|
end
|
64
68
|
end
|
@@ -76,7 +80,7 @@ module DeltavistaCrifDvaInterface
|
|
76
80
|
@parser = CollectionCheck.new @config
|
77
81
|
request_body = @parser.to_xml(address, collection)
|
78
82
|
headers = {'Content-Type' => 'text/xml'}
|
79
|
-
post_http_request(
|
83
|
+
post_http_request(url, request_body, headers) do |data|
|
80
84
|
extract_response data
|
81
85
|
end
|
82
86
|
end
|
@@ -26,10 +26,16 @@ module DeltavistaCrifDvaInterface
|
|
26
26
|
yield resp.body
|
27
27
|
end
|
28
28
|
|
29
|
+
# Generates URI depending on URI string
|
30
|
+
# @param url_string [String] URI string
|
31
|
+
# @return [URI] URI object
|
29
32
|
def to_url(url_string)
|
30
33
|
URI.parse(url_string)
|
31
34
|
end
|
32
35
|
|
36
|
+
# Generates new HTTP request
|
37
|
+
# @param url [URI] request URI
|
38
|
+
# @return [Net::HTTP] HTTP request
|
33
39
|
def create_http_request(url)
|
34
40
|
http = Net::HTTP.new(url.host, url.port)
|
35
41
|
if url.scheme == 'https'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deltavista_crif_dva_interface
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2014-
|
14
|
+
date: 2014-12-23 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rspec
|