jumio_rock 0.0.5 → 0.0.7
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/lib/jumio_rock/client.rb +12 -2
- data/lib/jumio_rock/redirect_netverify_params.rb +1 -1
- data/lib/jumio_rock/version.rb +1 -1
- data/test/lib/jumio_rock/jumio_rock_test.rb +10 -0
- data/test/minitest_helper.rb +16 -0
- 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: deef3f3ff89f1d99760df2fc97b13ac304c9844c
|
4
|
+
data.tar.gz: 68148fc68cf12aa3afc21b8269e3ca2377142a2f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ae4f39ba9ea25d11bc2b2da3299f93dd9b2457b89dfb4d91562be1563d4da56fd38dd6bef787c3f7be43d6b0ed4e5899352bd3034daf49131eef20787cc8edc
|
7
|
+
data.tar.gz: 61b8fa2d3e4db8df3389926fe8c448cf811bc696a2e8172ba098cba5319492610776a9539df4fd5716c15bc590158feb7074333eaf558fe4f5a6aa89d8213d77
|
data/lib/jumio_rock/client.rb
CHANGED
@@ -44,11 +44,21 @@ module JumioRock
|
|
44
44
|
end
|
45
45
|
|
46
46
|
def retrieve(scan_reference)
|
47
|
-
@initialization_type = :
|
48
|
-
url =
|
47
|
+
@initialization_type = :retrieve
|
48
|
+
url = retrieval_url_base(scan_reference)
|
49
49
|
get(url)
|
50
50
|
end
|
51
51
|
|
52
|
+
def retrieve_document_data(scan_reference)
|
53
|
+
@initialization_type = :retrieve_document_data
|
54
|
+
url = File.join(retrieval_url_base(scan_reference), 'data/document')
|
55
|
+
get(url)
|
56
|
+
end
|
57
|
+
|
58
|
+
def retrieval_url_base(scan_reference)
|
59
|
+
File.join(retrieval_url, scan_reference.to_s)
|
60
|
+
end
|
61
|
+
|
52
62
|
def iframe(locale = "en")
|
53
63
|
iframe_html(locale, js_type)
|
54
64
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module JumioRock
|
2
2
|
class RedirectNetverifyParams < NetverifyParams
|
3
3
|
attr_reader :merchantIdScanReference, :customerId
|
4
|
-
attr_accessor :authorizationTokenLifetime
|
4
|
+
attr_accessor :authorizationTokenLifetime, :locale
|
5
5
|
|
6
6
|
def initialize(scan_reference, customer_id)
|
7
7
|
@merchantIdScanReference = scan_reference
|
data/lib/jumio_rock/version.rb
CHANGED
@@ -66,6 +66,16 @@ describe JumioRock::Client do
|
|
66
66
|
assert_equal response.status, "DONE"
|
67
67
|
end
|
68
68
|
|
69
|
+
it 'retrieve document data' do
|
70
|
+
stub_document_data_retrieval_request
|
71
|
+
|
72
|
+
client = JumioRock::Client.new
|
73
|
+
response = client.retrieve_document_data("scan_id")
|
74
|
+
|
75
|
+
assert_equal response.scanReference, "scan_id"
|
76
|
+
assert_equal response.status, "APPROVED_VERIFIED"
|
77
|
+
end
|
78
|
+
|
69
79
|
it "success response" do
|
70
80
|
params = parse_post(success_api_response)
|
71
81
|
pp = JumioRock::PostParser.new(params)
|
data/test/minitest_helper.rb
CHANGED
@@ -52,6 +52,12 @@ def stub_retrieval_request
|
|
52
52
|
to_return(:status => 200, :body => json_retrieval_response, :headers => {})
|
53
53
|
end
|
54
54
|
|
55
|
+
def stub_document_data_retrieval_request
|
56
|
+
stub_request(:get, "https://username:password@netverify.com/api/netverify/v2/scans/scan_id/data/document").
|
57
|
+
with(headers: {'Accept'=>'application/json', 'Authorization'=>'Basic dXNlcm5hbWU6cGFzc3dvcmQ=', 'Content-Type'=>'application/json', 'Host'=>'netverify.com:443', 'User-Agent'=>"YOURCOMPANYNAME YOURAPPLICATIONNAME/#{JumioRock::VERSION}"}).
|
58
|
+
to_return(:status => 200, :body => json_data_document_retrieval_response, :headers => {})
|
59
|
+
end
|
60
|
+
|
55
61
|
def jumio_conf
|
56
62
|
JumioRock::Configuration.configuration
|
57
63
|
end
|
@@ -106,6 +112,16 @@ def json_retrieval_response
|
|
106
112
|
EOF
|
107
113
|
end
|
108
114
|
|
115
|
+
def json_data_document_retrieval_response
|
116
|
+
<<-EOF
|
117
|
+
{
|
118
|
+
"status": "APPROVED_VERIFIED",
|
119
|
+
"scanReference": "scan_id",
|
120
|
+
"timestamp": "2014-08-14T09:05:47.394Z"
|
121
|
+
}
|
122
|
+
EOF
|
123
|
+
end
|
124
|
+
|
109
125
|
def success_api_response
|
110
126
|
"idExpiry=2022-12-31&idType=PASSPORT&idDob=1990-01-01&idCheckSignature=OK&idCheckDataPositions=OK&idCheckHologram=OK&idCheckMicroprint=OK&idCheckDocumentValidation=OK&idCountry=USA&idScanSource=WEB_UPLOAD&idFirstName=FIRSTNAME&verificationStatus=APPROVED_VERIFIED&jumioIdScanReference=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx&personalNumber=N%2FA&merchantIdScanReference=YOURIDSCANREFERENCE&idCheckSecurityFeatures=OK&idCheckMRZcode=OK&idScanImage=https%3A%2F%2Fnetverify.com%2Frecognition%2Fv1%2Fidscan%2Fxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx%2Ffront&callBackType=NETVERIFYID&clientIp=xxx.xxx.xxx.xxx&idLastName=LASTNAME&idAddress=%7B%22country%22%3A%22USA%22%2C%22state%22%3A%22OH%22%7D&idScanStatus=SUCCESS&idNumber=P1234"
|
111
127
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jumio_rock
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michele Minazzato
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-09-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: excon
|