ssci_inc 0.1.20 → 0.1.21
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.
- checksums.yaml +4 -4
- data/README.md +0 -3
- data/lib/ssci_inc/configuration.rb +1 -7
- data/lib/ssci_inc/request.rb +0 -27
- data/lib/ssci_inc/response.rb +9 -21
- data/lib/ssci_inc/version.rb +1 -1
- data/test/test-updated.xml +0 -10
- data/test/test_helper.rb +27 -32
- data/test/unit/request_test.rb +0 -1
- data/test/unit/response_test.rb +12 -20
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: adadbe1a1f69e0fe15936437955ad0bdc559c49e
|
4
|
+
data.tar.gz: f07d79c42a3e21339c8a82b21c7b10a4315f22dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b41cf1b46fb6106eaf6a28e808962e2a640733b94a8b3d43e170b8c3007dac0c9ecc9bae87f6b8303b8abdfbaeab227a8cbc82dc5342586f1dfa04b774ec452f
|
7
|
+
data.tar.gz: 792a6e4530e65183b6c0a31b9c99cfd7c1ecb531b92729a0b4d30cf3930e917ae219d9dcd3a33994ecb7e1b397704a02d3d7f2c6720f652d4b6cf1ca9001e0c4
|
data/README.md
CHANGED
@@ -39,9 +39,6 @@ request = SsciInc::Request.new do |r|
|
|
39
39
|
r.municipality = "FANTASY ISLAND",
|
40
40
|
r.address_line = 899,
|
41
41
|
r.street_name = "LINCOLN RD",
|
42
|
-
r.postback_url = "http://127.0.0.1/listen.php",
|
43
|
-
r.postback_username = "user",
|
44
|
-
r.postback_password = "secret",
|
45
42
|
r.use_defaults = true
|
46
43
|
end
|
47
44
|
|
@@ -6,10 +6,7 @@ module SsciInc
|
|
6
6
|
:site_identifier,
|
7
7
|
:account_code,
|
8
8
|
:user_name,
|
9
|
-
:password
|
10
|
-
:postback_url,
|
11
|
-
:postback_username,
|
12
|
-
:postback_password
|
9
|
+
:password
|
13
10
|
|
14
11
|
def base_uri
|
15
12
|
@base_uri ||= 'https://linxml.com/bgcheck.asp'
|
@@ -39,9 +36,6 @@ module SsciInc
|
|
39
36
|
# account_code: ********
|
40
37
|
# user_name: ********
|
41
38
|
# password: ********
|
42
|
-
# postback_url: ********
|
43
|
-
# postback_username: ********
|
44
|
-
# postback_password: ********
|
45
39
|
# end
|
46
40
|
#
|
47
41
|
def self.configure
|
data/lib/ssci_inc/request.rb
CHANGED
@@ -2,10 +2,6 @@ module SsciInc
|
|
2
2
|
class Request
|
3
3
|
include DSL
|
4
4
|
|
5
|
-
ADDITIONAL_ITEMS = [:postback_url, :postback_username,
|
6
|
-
:postback_password, :embed_credentials, :ordernotes,
|
7
|
-
:interface, :monthly_income, :monthly_rent]
|
8
|
-
|
9
5
|
COURT_TYPES = {
|
10
6
|
bankruptcy: "Bankruptcy",
|
11
7
|
federal: "Federal",
|
@@ -61,9 +57,6 @@ module SsciInc
|
|
61
57
|
attr_reader :screenings
|
62
58
|
attr_accessor :use_defaults
|
63
59
|
|
64
|
-
# AdditionalItems
|
65
|
-
attr_accessor *ADDITIONAL_ITEMS
|
66
|
-
|
67
60
|
attr_reader :aliases
|
68
61
|
|
69
62
|
def initialize(h={})
|
@@ -77,14 +70,6 @@ module SsciInc
|
|
77
70
|
yield self if block_given?
|
78
71
|
end
|
79
72
|
|
80
|
-
def additional_items
|
81
|
-
ADDITIONAL_ITEMS.inject({}) do |h,a|
|
82
|
-
v = send(a)
|
83
|
-
h[a] = send(a) unless v.nil?
|
84
|
-
h
|
85
|
-
end
|
86
|
-
end
|
87
|
-
|
88
73
|
def as_xml
|
89
74
|
Nokogiri::XML::Builder.new do |xml|
|
90
75
|
xml.BackgroundCheck(:userId => user_name, :password => password) {
|
@@ -186,18 +171,6 @@ module SsciInc
|
|
186
171
|
@password || config.password
|
187
172
|
end
|
188
173
|
|
189
|
-
def postback_url
|
190
|
-
@postback_url || config.postback_url
|
191
|
-
end
|
192
|
-
|
193
|
-
def postback_username
|
194
|
-
@postback_username || config.postback_username
|
195
|
-
end
|
196
|
-
|
197
|
-
def postback_password
|
198
|
-
@postback_password || config.postback_password
|
199
|
-
end
|
200
|
-
|
201
174
|
def county
|
202
175
|
@county || "LOOKUP"
|
203
176
|
end
|
data/lib/ssci_inc/response.rb
CHANGED
@@ -1,43 +1,31 @@
|
|
1
1
|
module SsciInc
|
2
2
|
class Response
|
3
3
|
|
4
|
-
attr_reader :
|
5
|
-
attr_reader :result_status
|
4
|
+
attr_reader :data
|
6
5
|
|
7
6
|
# ErrorReport
|
8
7
|
attr_reader :error_code, :error_description
|
9
8
|
|
10
9
|
# postback
|
11
|
-
attr_reader :result_status,
|
12
|
-
:
|
13
|
-
:screening_results_type,
|
14
|
-
:screening_results_media_type,
|
15
|
-
:screening_results_result_type,
|
16
|
-
:result_url
|
17
|
-
|
18
|
-
attr_reader :data
|
10
|
+
attr_reader :screening_status, :order_status, :result_status, :date_order_received, :result_url,
|
11
|
+
:order_id, :reference_id
|
19
12
|
|
20
13
|
def initialize(data)
|
21
14
|
@data = data
|
22
15
|
document = Nokogiri::XML.parse(data)
|
23
|
-
@user_id = document.at("//@userId").try(:value)
|
24
|
-
@password = document.at("//@password").try(:value)
|
25
|
-
@reference_id = document.at("//ReferenceId").try(:text)
|
26
|
-
@reference = document.at("//Reference").try(:text)
|
27
|
-
@order_id = document.at("//Receipt").try(:text)
|
28
|
-
@order_status = document.at("//OrderStatus").try(:text)
|
29
16
|
|
30
17
|
# errors
|
31
18
|
@error_code = document.at("//ErrorCode").try(:text)
|
32
19
|
@error_description = document.at("//ErrorDescription").try(:text)
|
33
20
|
|
34
21
|
# completed postback response
|
22
|
+
@screening_results_type = document.at("//BackgroundReportPackage//@type").try(:text)
|
23
|
+
@order_status = document.at("//OrderStatus").try(:text)
|
35
24
|
@result_status = document.at("//ResultStatus").try(:text)
|
36
|
-
@
|
37
|
-
@
|
38
|
-
@
|
39
|
-
@
|
40
|
-
@result_url = document.at("//InternetWebAddress").try(:text)
|
25
|
+
@date_order_received = document.at("//DateOrderReceived").try(:text)
|
26
|
+
@result_url = document.at("//InternetAddress//CDATA").try(:text)
|
27
|
+
@reference_id = @order_id = document.at("//Receipt").try(:text)
|
28
|
+
# @reference_id = document.at("//ExtraIdentifier").try(:text) TODO: uncomment this and delete reference_id from line above
|
41
29
|
end
|
42
30
|
|
43
31
|
end
|
data/lib/ssci_inc/version.rb
CHANGED
data/test/test-updated.xml
CHANGED
@@ -98,16 +98,6 @@
|
|
98
98
|
</License>
|
99
99
|
</SearchLicense>
|
100
100
|
</Screening>
|
101
|
-
|
102
|
-
<AdditionalItems type="x:postback_username">
|
103
|
-
<Text>user</Text>
|
104
|
-
</AdditionalItems>
|
105
|
-
<AdditionalItems type="x:postback_password">
|
106
|
-
<Text>secret</Text>
|
107
|
-
</AdditionalItems>
|
108
|
-
<AdditionalItems type="x:postback_url">
|
109
|
-
<Text>http://127.0.0.1/listen.php</Text>
|
110
|
-
</AdditionalItems>
|
111
101
|
</Screenings>
|
112
102
|
</BackgroundSearchPackage>
|
113
103
|
</BackgroundCheck>
|
data/test/test_helper.rb
CHANGED
@@ -79,39 +79,34 @@ class Test::Unit::TestCase
|
|
79
79
|
# }
|
80
80
|
|
81
81
|
TEST_PENDING_RESPONSE = %Q{
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
</
|
93
|
-
|
82
|
+
<?xml version = "1.0" encoding="Windows-1252" standalone="yes"?>
|
83
|
+
<VFPData>
|
84
|
+
<Response>
|
85
|
+
<status>0</status>
|
86
|
+
<message>Background Check successfully received and routed for delivery</message>
|
87
|
+
<DestSiteIdentifier>SOUTHEASTERN</DestSiteIdentifier>
|
88
|
+
<SourceSiteIdentifier>SOU157579718</SourceSiteIdentifier>
|
89
|
+
<AcctCode>SERP00</AcctCode>
|
90
|
+
<BatchID>1</BatchID>
|
91
|
+
<datestamp>04/12/17 02:16:10 PM</datestamp>
|
92
|
+
<Receipt>receipt_id</Receipt>
|
93
|
+
<ExtraIdentifier>order_id</ExtraIdentifier>
|
94
|
+
</Response>
|
95
|
+
</VFPData>
|
94
96
|
}
|
95
97
|
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
# <InternetWebAddress>display.php</InternetWebAddress>
|
110
|
-
# </ScreeningResults>
|
111
|
-
# </Screening>
|
112
|
-
# </Screenings>
|
113
|
-
# </BackgroundReportPackage>
|
114
|
-
# </BackgroundReports>
|
115
|
-
# }
|
98
|
+
TEST_CALLBACK_RESPONSE = %Q{
|
99
|
+
<BackgroundReportPackage type="report">
|
100
|
+
<ScreeningStatus>
|
101
|
+
<ExtraIdentifier>order_id</ExtraIdentifier>
|
102
|
+
<OrderStatus>COMPLETE</OrderStatus>
|
103
|
+
<ResultStatus>PASS</ResultStatus>
|
104
|
+
<DateOrderReceived>01/13/2004 @ 12:24</DateOrderReceived>
|
105
|
+
<InternetAddress><CDATA>https://linxml.com/bgcheck/12345</CDATA></InternetAddress>
|
106
|
+
<Receipt>receipt_id</Receipt>
|
107
|
+
<ExtraIdentifier>order_id</ExtraIdentifier>
|
108
|
+
</ScreeningStatus>
|
109
|
+
</BackgroundReportPackage>
|
110
|
+
}
|
116
111
|
|
117
112
|
end
|
data/test/unit/request_test.rb
CHANGED
@@ -71,7 +71,6 @@ module SsciInc
|
|
71
71
|
should_have_attr_accessor :ssn, :date_of_birth, :country_code, :postal_code, :region, :municipality,
|
72
72
|
:address_line, :street_name
|
73
73
|
should_have_attr_accessor :use_defaults
|
74
|
-
should_have_attr_accessor *Request::ADDITIONAL_ITEMS
|
75
74
|
|
76
75
|
end
|
77
76
|
end
|
data/test/unit/response_test.rb
CHANGED
@@ -35,29 +35,21 @@ module SsciInc
|
|
35
35
|
|
36
36
|
should "have populated order id" do
|
37
37
|
assert_equal "receipt_id", subject.order_id
|
38
|
+
# assert_equal "order_id", subject.order_id TODO: uncomment this and delete line above when SSCI delivers integration
|
38
39
|
end
|
39
40
|
end
|
40
41
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
#
|
53
|
-
# assert_equal "username", subject.user_id
|
54
|
-
# assert_equal "password", subject.password
|
55
|
-
#
|
56
|
-
# assert_equal "12358", subject.order_id
|
57
|
-
# assert_equal "some_id_value", subject.reference_id
|
58
|
-
# assert_equal "ABC Company Inc.", subject.reference
|
59
|
-
# end
|
60
|
-
# end
|
42
|
+
context "callback response" do
|
43
|
+
subject { Response.new(TEST_CALLBACK_RESPONSE) }
|
44
|
+
|
45
|
+
should "have a result status and result info" do
|
46
|
+
assert_equal "COMPLETE", subject.order_status
|
47
|
+
assert_equal "PASS", subject.result_status
|
48
|
+
assert_equal "https://linxml.com/bgcheck/12345", subject.result_url
|
49
|
+
assert_equal "receipt_id", subject.order_id
|
50
|
+
# assert_equal "order_id", subject.order_id TODO: uncomment this and delete line above when SSCI delivers integration
|
51
|
+
end
|
52
|
+
end
|
61
53
|
end
|
62
54
|
|
63
55
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ssci_inc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.21
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jon Alme
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-05-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|