jumio_rock 0.0.5 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a60671a450c3f4fd1c97074fb54e6a8d8f2980ca
4
- data.tar.gz: 56bb957d129d3798962785b96017fb7af10d96bd
3
+ metadata.gz: deef3f3ff89f1d99760df2fc97b13ac304c9844c
4
+ data.tar.gz: 68148fc68cf12aa3afc21b8269e3ca2377142a2f
5
5
  SHA512:
6
- metadata.gz: 124232aacd54ce5c04eeab823d63c56e6f6842cdedf02d23d111f453e929685d31ca69e456a4e705799685bd83f6f6d36e697592e21e4ec42dabf2323b1ca114
7
- data.tar.gz: a5c31725e6924ad5e3e8bbd85e68ba5f8caa150fba77a126c8d6e57ab8747d4620bc8403db9fe2a9797353d6bc4bc99752f6a5183c34f7627cd2175011e436a0
6
+ metadata.gz: 0ae4f39ba9ea25d11bc2b2da3299f93dd9b2457b89dfb4d91562be1563d4da56fd38dd6bef787c3f7be43d6b0ed4e5899352bd3034daf49131eef20787cc8edc
7
+ data.tar.gz: 61b8fa2d3e4db8df3389926fe8c448cf811bc696a2e8172ba098cba5319492610776a9539df4fd5716c15bc590158feb7074333eaf558fe4f5a6aa89d8213d77
@@ -44,11 +44,21 @@ module JumioRock
44
44
  end
45
45
 
46
46
  def retrieve(scan_reference)
47
- @initialization_type = :retrieveirb
48
- url = File.join(retrieval_url, scan_reference.to_s).to_s
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
@@ -1,3 +1,3 @@
1
1
  module JumioRock
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.7"
3
3
  end
@@ -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)
@@ -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.5
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-05-09 00:00:00.000000000 Z
11
+ date: 2016-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: excon