onfido 0.7.1 → 0.8.1
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/.rubocop.yml +1 -1
- data/CHANGELOG.md +16 -0
- data/README.md +25 -8
- data/lib/onfido.rb +1 -0
- data/lib/onfido/resource.rb +9 -3
- data/lib/onfido/resources/applicant.rb +8 -0
- data/lib/onfido/resources/check.rb +4 -0
- data/lib/onfido/resources/document.rb +12 -0
- data/lib/onfido/resources/report.rb +8 -0
- data/lib/onfido/resources/report_type_group.rb +11 -0
- data/lib/onfido/version.rb +1 -1
- data/onfido.gemspec +2 -2
- data/spec/integrations/applicant_spec.rb +17 -0
- data/spec/integrations/check_spec.rb +8 -0
- data/spec/integrations/document_spec.rb +29 -0
- data/spec/integrations/report_spec.rb +18 -0
- data/spec/integrations/report_type_group_spec.rb +19 -0
- data/spec/onfido/resource_spec.rb +23 -20
- data/spec/support/fake_onfido_api.rb +43 -1
- data/spec/support/fixtures/documents.json +23 -0
- data/spec/support/fixtures/report_type_group.json +25 -0
- data/spec/support/fixtures/report_type_groups.json +30 -0
- metadata +17 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b8b358fae56d85b7d3baa6a930265a24b20fcb3b
|
4
|
+
data.tar.gz: 79f85ef2cd0f133e8a4d211d307b45fabbc6efb2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 780b609e4f6d36b20c7d72e4b1b90a3a47bd6b036a49ad30aa30cd42eac15563e79d1925b3d37e9fbaf98dc3603e4a42080088ab92c33796635f0011a7891ee6
|
7
|
+
data.tar.gz: 864bdc7e5b8f041f0335cc823692bd5d0b7e3a94b1f573c73672f77335448667be606f5cf023da4105390aee8068c144c338a8a2fdc080cd44b496f49587eea3
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,19 @@
|
|
1
|
+
## v0.8.1, 5 April 2017
|
2
|
+
|
3
|
+
- Fix `Content-Type` header handling to be more permissive when detecting JSON (e.g. still recognise the type as JSON when the charset is appended to the header) (@sponomarev)
|
4
|
+
- Update [`rest-client`](https://github.com/rest-client/rest-client) dependency to 2.x (@timrogers)
|
5
|
+
- Update [`WebMock`](https://github.com/bblimke/webmock) dependendency to 2.x (@timrogers)
|
6
|
+
|
7
|
+
## v0.8.0, 16 November 2016
|
8
|
+
|
9
|
+
- Add support for `put` and `delete` http methods to `Onfido::Resource`
|
10
|
+
- Support no content and binary responses at `Onfido::Resource`
|
11
|
+
- Add support for `Onfido::ReportTypeGroup` resource
|
12
|
+
- Add support for update and destroy applicant resource
|
13
|
+
- Add support for download, find and retrieve all for document resource
|
14
|
+
- Add support for resume checks
|
15
|
+
- Add support for resume and cancel report
|
16
|
+
|
1
17
|
## v0.7.1, 5 September 2016
|
2
18
|
|
3
19
|
- Fix creation of live photos through `Onfido::LivePhoto` resource
|
data/README.md
CHANGED
@@ -12,7 +12,7 @@ This gem supports both `v1` and `v2` of the Onfido API. Refer to Onfido's [API d
|
|
12
12
|
Add this line to your application's Gemfile:
|
13
13
|
|
14
14
|
```ruby
|
15
|
-
gem 'onfido'
|
15
|
+
gem 'onfido', '~> 0.8.1'
|
16
16
|
```
|
17
17
|
|
18
18
|
## Configuration
|
@@ -54,18 +54,22 @@ All resources share the same interface when making API calls. Use `.create` to c
|
|
54
54
|
Applicants are the object upon which Onfido checks are performed.
|
55
55
|
|
56
56
|
```ruby
|
57
|
-
api.applicant.create(params)
|
58
|
-
api.applicant.
|
59
|
-
api.applicant.
|
57
|
+
api.applicant.create(params) # => Creates an applicant
|
58
|
+
api.applicant.update('applicant_id', params) # => Updates an applicant
|
59
|
+
api.applicant.destroy('applicant_id') # => Destroy an applicant
|
60
|
+
api.applicant.find('applicant_id') # => Finds a single applicant
|
61
|
+
api.applicant.all # => Returns all applicants
|
60
62
|
```
|
61
63
|
|
62
64
|
#### Documents
|
63
65
|
|
64
|
-
Documents provide supporting evidence for Onfido checks.
|
65
|
-
created - the Onfido does not support finding or listing them.
|
66
|
+
Documents provide supporting evidence for Onfido checks.
|
66
67
|
|
67
68
|
```ruby
|
68
|
-
api.document.create('applicant_id', file: 'http://example.com', type: 'passport')
|
69
|
+
api.document.create('applicant_id', file: 'http://example.com', type: 'passport') # => Creates a document
|
70
|
+
api.document.find('applicant_id', 'document_id') # => Finds a document
|
71
|
+
api.document.download('applicant_id', 'document_id') # => Downloads a document as a binary data
|
72
|
+
api.document.all('applicant_id') # => Returns all applicant's documents
|
69
73
|
```
|
70
74
|
|
71
75
|
**Note:** The file parameter can be either a `File` object or a link to an image.
|
@@ -89,6 +93,7 @@ more "reports" on them.
|
|
89
93
|
```ruby
|
90
94
|
api.check.create('applicant_id', type: 'express', reports: [{ name: 'identity' }])
|
91
95
|
api.check.find('applicant_id', 'check_id')
|
96
|
+
api.check.resume('check_id')
|
92
97
|
api.check.all('applicant_id')
|
93
98
|
```
|
94
99
|
|
@@ -96,11 +101,23 @@ api.check.all('applicant_id')
|
|
96
101
|
|
97
102
|
Reports provide details of the results of some part of a "check". They are
|
98
103
|
created when a check is created, so the Onfido API only provides support for
|
99
|
-
finding and listing them.
|
104
|
+
finding and listing them. For paused reports specifically, additional support for resuming and
|
105
|
+
cancelling reports is also available.
|
100
106
|
|
101
107
|
```ruby
|
102
108
|
api.report.find('check_id', 'report_id')
|
103
109
|
api.report.all('check_id')
|
110
|
+
api.report.resume('check_id', 'report_id')
|
111
|
+
api.report.cancel('check_id', 'report_id')
|
112
|
+
```
|
113
|
+
|
114
|
+
#### Report Type Groups
|
115
|
+
Report type groups provide a convenient way to group and organize different types of reports.
|
116
|
+
The Onfido API only provides support for finding and listing them.
|
117
|
+
|
118
|
+
```ruby
|
119
|
+
api.report_type_group.find('report_type_group_id')
|
120
|
+
api.report_type_group.all()
|
104
121
|
```
|
105
122
|
|
106
123
|
#### Address Lookups
|
data/lib/onfido.rb
CHANGED
data/lib/onfido/resource.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module Onfido
|
2
2
|
class Resource
|
3
|
-
VALID_HTTP_METHODS = %i(get post).freeze
|
3
|
+
VALID_HTTP_METHODS = %i(get post put delete).freeze
|
4
4
|
REQUEST_TIMEOUT_HTTP_CODE = 408
|
5
5
|
|
6
6
|
def initialize(api_key = nil)
|
@@ -39,7 +39,8 @@ module Onfido
|
|
39
39
|
|
40
40
|
response = RestClient::Request.execute(request_options)
|
41
41
|
|
42
|
-
|
42
|
+
# response should be parsed only when there is a response expected
|
43
|
+
parse(response) unless response.code == 204 # no_content
|
43
44
|
rescue RestClient::ExceptionWithResponse => error
|
44
45
|
if error.response && !timeout_response?(error.response)
|
45
46
|
handle_api_error(error.response)
|
@@ -51,7 +52,12 @@ module Onfido
|
|
51
52
|
end
|
52
53
|
|
53
54
|
def parse(response)
|
54
|
-
|
55
|
+
content_type = response.headers[:content_type]
|
56
|
+
if content_type && content_type.include?("application/json")
|
57
|
+
JSON.parse(response.body.to_s)
|
58
|
+
else
|
59
|
+
response.body
|
60
|
+
end
|
55
61
|
rescue JSON::ParserError
|
56
62
|
general_api_error(response.code, response.body)
|
57
63
|
end
|
@@ -4,6 +4,14 @@ module Onfido
|
|
4
4
|
post(url: url_for('applicants'), payload: payload)
|
5
5
|
end
|
6
6
|
|
7
|
+
def update(applicant_id, payload)
|
8
|
+
put(url: url_for("applicants/#{applicant_id}"), payload: payload)
|
9
|
+
end
|
10
|
+
|
11
|
+
def destroy(applicant_id)
|
12
|
+
delete(url: url_for("applicants/#{applicant_id}"))
|
13
|
+
end
|
14
|
+
|
7
15
|
def find(applicant_id)
|
8
16
|
get(url: url_for("applicants/#{applicant_id}"))
|
9
17
|
end
|
@@ -9,5 +9,17 @@ module Onfido
|
|
9
9
|
payload: payload
|
10
10
|
)
|
11
11
|
end
|
12
|
+
|
13
|
+
def find(applicant_id, document_id)
|
14
|
+
get(url: url_for("applicants/#{applicant_id}/documents/#{document_id}"))
|
15
|
+
end
|
16
|
+
|
17
|
+
def download(applicant_id, document_id)
|
18
|
+
get(url: url_for("applicants/#{applicant_id}/documents/#{document_id}/download"))
|
19
|
+
end
|
20
|
+
|
21
|
+
def all(applicant_id)
|
22
|
+
get(url: url_for("applicants/#{applicant_id}/documents"))
|
23
|
+
end
|
12
24
|
end
|
13
25
|
end
|
@@ -8,5 +8,13 @@ module Onfido
|
|
8
8
|
querystring = "page=#{page}&per_page=#{per_page}"
|
9
9
|
get(url: url_for("checks/#{check_id}/reports?#{querystring}"))
|
10
10
|
end
|
11
|
+
|
12
|
+
def resume(check_id, report_id)
|
13
|
+
post(url: url_for("checks/#{check_id}/reports/#{report_id}/resume"))
|
14
|
+
end
|
15
|
+
|
16
|
+
def cancel(check_id, report_id)
|
17
|
+
post(url: url_for("checks/#{check_id}/reports/#{report_id}/cancel"))
|
18
|
+
end
|
11
19
|
end
|
12
20
|
end
|
data/lib/onfido/version.rb
CHANGED
data/onfido.gemspec
CHANGED
@@ -20,12 +20,12 @@ Gem::Specification.new do |spec|
|
|
20
20
|
|
21
21
|
spec.add_development_dependency 'bundler', '~> 1.7'
|
22
22
|
spec.add_development_dependency 'rake', '~> 10.0'
|
23
|
-
spec.add_development_dependency 'webmock', '~>
|
23
|
+
spec.add_development_dependency 'webmock', '~> 2.3'
|
24
24
|
spec.add_development_dependency 'rubocop', '~> 0.37.0'
|
25
25
|
spec.add_development_dependency 'rspec', '~> 3.1'
|
26
26
|
spec.add_development_dependency 'rspec-its', '~> 1.2'
|
27
27
|
spec.add_development_dependency 'sinatra', '~> 1.4'
|
28
28
|
|
29
|
-
spec.add_dependency 'rest-client', '~>
|
29
|
+
spec.add_dependency 'rest-client', '~> 2.0'
|
30
30
|
spec.add_dependency 'rack', '~> 1.6'
|
31
31
|
end
|
@@ -56,6 +56,15 @@ describe Onfido::Applicant do
|
|
56
56
|
end
|
57
57
|
end
|
58
58
|
|
59
|
+
describe '#update' do
|
60
|
+
let(:applicant_id) { '61f659cb-c90b-4067-808a-6136b5c01351' }
|
61
|
+
|
62
|
+
it 'updates an applicant' do
|
63
|
+
response = applicant.update(applicant_id, params)
|
64
|
+
expect(response['id']).to eq(applicant_id)
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
59
68
|
describe '#find' do
|
60
69
|
let(:applicant_id) { '61f659cb-c90b-4067-808a-6136b5c01351' }
|
61
70
|
|
@@ -65,6 +74,14 @@ describe Onfido::Applicant do
|
|
65
74
|
end
|
66
75
|
end
|
67
76
|
|
77
|
+
describe '#destroy' do
|
78
|
+
let(:applicant_id) { '61f659cb-c90b-4067-808a-6136b5c01351' }
|
79
|
+
|
80
|
+
it 'returns success code' do
|
81
|
+
expect { applicant.destroy(applicant_id) }.not_to raise_error
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
68
85
|
describe '#all' do
|
69
86
|
context 'with the default page and per page params' do
|
70
87
|
it 'returns all the applicants' do
|
@@ -50,4 +50,12 @@ describe Onfido::Check do
|
|
50
50
|
expect(response['checks'].first['reports'].first).to be_a(Hash)
|
51
51
|
end
|
52
52
|
end
|
53
|
+
|
54
|
+
describe "#resume" do
|
55
|
+
let(:check_id) { '8546921-123123-123123' }
|
56
|
+
|
57
|
+
it 'returns success response' do
|
58
|
+
expect { check.resume(check_id) }.not_to raise_error
|
59
|
+
end
|
60
|
+
end
|
53
61
|
end
|
@@ -25,4 +25,33 @@ describe Onfido::Document do
|
|
25
25
|
expect(response['id']).not_to be_nil
|
26
26
|
end
|
27
27
|
end
|
28
|
+
|
29
|
+
describe '#find' do
|
30
|
+
let(:applicant_id) { '1030303-123123-123123' }
|
31
|
+
let(:document_id) { '7568415-123123-123123' }
|
32
|
+
|
33
|
+
it 'returns the expected document' do
|
34
|
+
response = document.find(applicant_id, document_id)
|
35
|
+
expect(response['id']).to eq(document_id)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
describe '#all' do
|
40
|
+
let(:applicant_id) { '1030303-123123-123123' }
|
41
|
+
|
42
|
+
it 'returns list of documents' do
|
43
|
+
response = document.all(applicant_id)
|
44
|
+
expect(response['documents']).not_to be_empty
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
describe '#download' do
|
49
|
+
let(:applicant_id) { '1030303-123123-123123' }
|
50
|
+
let(:document_id) { '1212121-123123-123123' }
|
51
|
+
|
52
|
+
it 'returns the file data' do
|
53
|
+
response = document.download(applicant_id, document_id)
|
54
|
+
expect(response).not_to be_nil
|
55
|
+
end
|
56
|
+
end
|
28
57
|
end
|
@@ -17,4 +17,22 @@ describe Onfido::Report do
|
|
17
17
|
expect(response['reports'].count).to eq(2)
|
18
18
|
end
|
19
19
|
end
|
20
|
+
|
21
|
+
describe '#resume' do
|
22
|
+
let(:report_id) { '6951786-123123-422221' }
|
23
|
+
let(:check_id) { '1212121-123123-422221' }
|
24
|
+
|
25
|
+
it 'returns a success response' do
|
26
|
+
expect { report.resume(check_id, report_id) }.not_to raise_error
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
describe '#cancel' do
|
31
|
+
let(:report_id) { '6951786-123123-422221' }
|
32
|
+
let(:check_id) { '1212121-123123-422221' }
|
33
|
+
|
34
|
+
it 'returns a success response' do
|
35
|
+
expect { report.cancel(check_id, report_id) }.not_to raise_error
|
36
|
+
end
|
37
|
+
end
|
20
38
|
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
describe Onfido::ReportTypeGroup do
|
2
|
+
subject(:report_type_group) { described_class.new }
|
3
|
+
|
4
|
+
describe '#find' do
|
5
|
+
let(:id) { '8546921-123123-123123' }
|
6
|
+
|
7
|
+
it 'return a retport type group' do
|
8
|
+
response = report_type_group.find(id)
|
9
|
+
expect(response['id']).not_to be_nil
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
describe '#all' do
|
14
|
+
it 'return a list of report type group' do
|
15
|
+
response = report_type_group.all
|
16
|
+
expect(response['report_type_groups']).not_to be_empty
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -32,11 +32,11 @@ describe Onfido::Resource do
|
|
32
32
|
end
|
33
33
|
|
34
34
|
describe '#method_missing' do
|
35
|
-
%i(
|
35
|
+
%i(patch).each do |method|
|
36
36
|
context "for unsupported HTTP method: #{method}" do
|
37
37
|
it 'raises an error' do
|
38
38
|
expect do
|
39
|
-
resource.public_send(method)
|
39
|
+
resource.public_send(method, url: endpoint)
|
40
40
|
end.to raise_error(NoMethodError)
|
41
41
|
end
|
42
42
|
end
|
@@ -47,14 +47,13 @@ describe Onfido::Resource do
|
|
47
47
|
subject(:resource) { described_class.new(specific_api_key) }
|
48
48
|
|
49
49
|
before do
|
50
|
-
expect(RestClient::Request).to receive(:execute).
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
timeout: 80
|
50
|
+
expect(RestClient::Request).to receive(:execute).with(
|
51
|
+
url: url,
|
52
|
+
payload: Rack::Utils.build_query(payload),
|
53
|
+
method: :get,
|
54
|
+
headers: resource.send(:headers),
|
55
|
+
open_timeout: 30,
|
56
|
+
timeout: 80
|
58
57
|
).and_call_original
|
59
58
|
|
60
59
|
WebMock.stub_request(:get, url).
|
@@ -67,10 +66,11 @@ describe Onfido::Resource do
|
|
67
66
|
it "uses that key when making the request" do
|
68
67
|
resource.get(url: url, payload: payload)
|
69
68
|
|
70
|
-
expect(WebMock).to have_requested(:get, url).with(
|
71
|
-
|
72
|
-
|
73
|
-
|
69
|
+
expect(WebMock).to have_requested(:get, url).with(
|
70
|
+
headers: {
|
71
|
+
'Authorization' => "Token token=#{specific_api_key}",
|
72
|
+
'Accept' => "application/json"
|
73
|
+
})
|
74
74
|
end
|
75
75
|
end
|
76
76
|
|
@@ -80,16 +80,17 @@ describe Onfido::Resource do
|
|
80
80
|
it "uses the general config key when making the request" do
|
81
81
|
resource.get(url: url, payload: payload)
|
82
82
|
|
83
|
-
expect(WebMock).to have_requested(:get, url).with(
|
84
|
-
|
85
|
-
|
86
|
-
|
83
|
+
expect(WebMock).to have_requested(:get, url).with(
|
84
|
+
headers: {
|
85
|
+
'Authorization' => "Token token=#{api_key}",
|
86
|
+
'Accept' => "application/json"
|
87
|
+
})
|
87
88
|
end
|
88
89
|
end
|
89
90
|
end
|
90
91
|
|
91
92
|
describe "valid http methods" do
|
92
|
-
%i(get post).each do |method|
|
93
|
+
%i(get post put delete).each do |method|
|
93
94
|
context "for supported HTTP method: #{method}" do
|
94
95
|
context "with a success response" do
|
95
96
|
before do
|
@@ -104,7 +105,9 @@ describe Onfido::Resource do
|
|
104
105
|
).and_call_original
|
105
106
|
|
106
107
|
WebMock.stub_request(method, url).
|
107
|
-
to_return(body: response.to_json,
|
108
|
+
to_return(body: response.to_json,
|
109
|
+
status: 200,
|
110
|
+
headers: { "Content-Type" => "application/json" })
|
108
111
|
end
|
109
112
|
|
110
113
|
it 'makes a request to an endpoint' do
|
@@ -9,6 +9,10 @@ class FakeOnfidoAPI < Sinatra::Base
|
|
9
9
|
json_response(201, 'applicant.json')
|
10
10
|
end
|
11
11
|
|
12
|
+
put '/v2/applicants/:id' do
|
13
|
+
json_response(200, 'applicant.json')
|
14
|
+
end
|
15
|
+
|
12
16
|
get '/v2/applicants/:id' do
|
13
17
|
json_response(200, 'applicant.json')
|
14
18
|
end
|
@@ -18,10 +22,28 @@ class FakeOnfidoAPI < Sinatra::Base
|
|
18
22
|
{ applicants: JSON.parse(response)['applicants'][pagination_range] }.to_json
|
19
23
|
end
|
20
24
|
|
25
|
+
delete '/v2/applicants/:id' do
|
26
|
+
status 204
|
27
|
+
end
|
28
|
+
|
21
29
|
post '/v2/applicants/:id/documents' do
|
22
30
|
json_response(201, 'document.json')
|
23
31
|
end
|
24
32
|
|
33
|
+
get '/v2/applicants/:id/documents/:id' do
|
34
|
+
json_response(200, 'document.json')
|
35
|
+
end
|
36
|
+
|
37
|
+
get '/v2/applicants/:id/documents' do
|
38
|
+
json_response(200, 'documents.json')
|
39
|
+
end
|
40
|
+
|
41
|
+
get '/v2/applicants/:id/documents/:id/download' do
|
42
|
+
status 200
|
43
|
+
content_type 'application/octet-stream'
|
44
|
+
"\x01\x02\x03" # acts as binary file data
|
45
|
+
end
|
46
|
+
|
25
47
|
post '/v2/live_photos' do
|
26
48
|
json_response(201, 'live_photo.json')
|
27
49
|
end
|
@@ -48,6 +70,10 @@ class FakeOnfidoAPI < Sinatra::Base
|
|
48
70
|
{ checks: JSON.parse(response)['checks'][pagination_range] }.to_json
|
49
71
|
end
|
50
72
|
|
73
|
+
post '/v2/checks/:id/resume' do
|
74
|
+
status 204 # no_content
|
75
|
+
end
|
76
|
+
|
51
77
|
get '/v2/checks/:id/reports' do
|
52
78
|
json_response(200, 'reports.json')
|
53
79
|
end
|
@@ -56,6 +82,22 @@ class FakeOnfidoAPI < Sinatra::Base
|
|
56
82
|
json_response(200, 'report.json')
|
57
83
|
end
|
58
84
|
|
85
|
+
post '/v2/checks/:id/reports/:id/resume' do
|
86
|
+
status 204
|
87
|
+
end
|
88
|
+
|
89
|
+
post '/v2/checks/:id/reports/:id/cancel' do
|
90
|
+
status 204
|
91
|
+
end
|
92
|
+
|
93
|
+
get '/v2/report_type_groups/:id' do
|
94
|
+
json_response(200, 'report_type_group.json')
|
95
|
+
end
|
96
|
+
|
97
|
+
get '/v2/report_type_groups' do
|
98
|
+
json_response(200, 'report_type_groups.json')
|
99
|
+
end
|
100
|
+
|
59
101
|
post '/v2/webhooks' do
|
60
102
|
json_response(201, 'webhook.json')
|
61
103
|
end
|
@@ -85,7 +127,7 @@ class FakeOnfidoAPI < Sinatra::Base
|
|
85
127
|
private
|
86
128
|
|
87
129
|
def json_response(response_code, file_name)
|
88
|
-
content_type
|
130
|
+
content_type "application/json; charset=utf-8"
|
89
131
|
status response_code
|
90
132
|
File.open(File.dirname(__FILE__) + '/fixtures/' + file_name, 'rb').read
|
91
133
|
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
{
|
2
|
+
"documents": [
|
3
|
+
{
|
4
|
+
"id": "7568415-123123-123123",
|
5
|
+
"created_at": "2014-05-23 13:50:33Z",
|
6
|
+
"href": "/v2/applicants/1030303-123123-123123/documents/7568415-123123-123123",
|
7
|
+
"file_name": "passport.jpg",
|
8
|
+
"file_type": "png",
|
9
|
+
"file_size": 282870,
|
10
|
+
"type": "passport",
|
11
|
+
"side": "back"
|
12
|
+
},
|
13
|
+
{
|
14
|
+
"id": "121122-123123-123123",
|
15
|
+
"created_at": "2014-05-23 13:50:33Z",
|
16
|
+
"href": "/v2/applicants/1030303-123123-123123/documents/7568415-123123-123123",
|
17
|
+
"file_name": "right_to_work.png",
|
18
|
+
"file_type": "png",
|
19
|
+
"file_size": 282870,
|
20
|
+
"type": "right_to_work"
|
21
|
+
}
|
22
|
+
]
|
23
|
+
}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
{
|
2
|
+
"id": "8546921-123123-123123",
|
3
|
+
"name": "Senior level",
|
4
|
+
"group_only": false,
|
5
|
+
"report_types": [
|
6
|
+
{
|
7
|
+
"id": "4566764-567657-234445",
|
8
|
+
"name": "identity"
|
9
|
+
},
|
10
|
+
{
|
11
|
+
"id": "2344556-236767-786868",
|
12
|
+
"name": "right_to_work"
|
13
|
+
},
|
14
|
+
{
|
15
|
+
"id": "4523434-345133-234424",
|
16
|
+
"name": "directorship"
|
17
|
+
},
|
18
|
+
{
|
19
|
+
"id": "7857345-234234-565345",
|
20
|
+
"name": "criminal_history",
|
21
|
+
"variant": "basic",
|
22
|
+
"options": []
|
23
|
+
}
|
24
|
+
]
|
25
|
+
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
{
|
2
|
+
"report_type_groups": [
|
3
|
+
{
|
4
|
+
"id": "8546921-123123-123123",
|
5
|
+
"name": "Senior level",
|
6
|
+
"group_only": false,
|
7
|
+
"report_types": [
|
8
|
+
{
|
9
|
+
"id": "121212-567657-234445",
|
10
|
+
"name": "identity"
|
11
|
+
}
|
12
|
+
]
|
13
|
+
},
|
14
|
+
{
|
15
|
+
"id": "8546921-123123-123123",
|
16
|
+
"name": "Senior level",
|
17
|
+
"group_only": false,
|
18
|
+
"report_types": [
|
19
|
+
{
|
20
|
+
"id": "4566764-567657-234445",
|
21
|
+
"name": "identity"
|
22
|
+
},
|
23
|
+
{
|
24
|
+
"id": "2344556-236767-786868",
|
25
|
+
"name": "right_to_work"
|
26
|
+
}
|
27
|
+
]
|
28
|
+
}
|
29
|
+
]
|
30
|
+
}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: onfido
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pericles Theodorou
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2017-04-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -45,14 +45,14 @@ dependencies:
|
|
45
45
|
requirements:
|
46
46
|
- - "~>"
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version: '
|
48
|
+
version: '2.3'
|
49
49
|
type: :development
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
53
|
- - "~>"
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version: '
|
55
|
+
version: '2.3'
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: rubocop
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
@@ -115,14 +115,14 @@ dependencies:
|
|
115
115
|
requirements:
|
116
116
|
- - "~>"
|
117
117
|
- !ruby/object:Gem::Version
|
118
|
-
version: '
|
118
|
+
version: '2.0'
|
119
119
|
type: :runtime
|
120
120
|
prerelease: false
|
121
121
|
version_requirements: !ruby/object:Gem::Requirement
|
122
122
|
requirements:
|
123
123
|
- - "~>"
|
124
124
|
- !ruby/object:Gem::Version
|
125
|
-
version: '
|
125
|
+
version: '2.0'
|
126
126
|
- !ruby/object:Gem::Dependency
|
127
127
|
name: rack
|
128
128
|
requirement: !ruby/object:Gem::Requirement
|
@@ -171,6 +171,7 @@ files:
|
|
171
171
|
- lib/onfido/resources/document.rb
|
172
172
|
- lib/onfido/resources/live_photo.rb
|
173
173
|
- lib/onfido/resources/report.rb
|
174
|
+
- lib/onfido/resources/report_type_group.rb
|
174
175
|
- lib/onfido/resources/webhook.rb
|
175
176
|
- lib/onfido/version.rb
|
176
177
|
- onfido.gemspec
|
@@ -181,6 +182,7 @@ files:
|
|
181
182
|
- spec/integrations/exceptions_spec.rb
|
182
183
|
- spec/integrations/live_photo_spec.rb
|
183
184
|
- spec/integrations/report_spec.rb
|
185
|
+
- spec/integrations/report_type_group_spec.rb
|
184
186
|
- spec/integrations/webhook_spec.rb
|
185
187
|
- spec/onfido/api_spec.rb
|
186
188
|
- spec/onfido/connection_error_spec.rb
|
@@ -198,8 +200,11 @@ files:
|
|
198
200
|
- spec/support/fixtures/checks.json
|
199
201
|
- spec/support/fixtures/checks_with_expanded_reports.json
|
200
202
|
- spec/support/fixtures/document.json
|
203
|
+
- spec/support/fixtures/documents.json
|
201
204
|
- spec/support/fixtures/live_photo.json
|
202
205
|
- spec/support/fixtures/report.json
|
206
|
+
- spec/support/fixtures/report_type_group.json
|
207
|
+
- spec/support/fixtures/report_type_groups.json
|
203
208
|
- spec/support/fixtures/reports.json
|
204
209
|
- spec/support/fixtures/unexpected_error_format.json
|
205
210
|
- spec/support/fixtures/webhook.json
|
@@ -224,7 +229,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
224
229
|
version: '0'
|
225
230
|
requirements: []
|
226
231
|
rubyforge_project:
|
227
|
-
rubygems_version: 2.
|
232
|
+
rubygems_version: 2.6.8
|
228
233
|
signing_key:
|
229
234
|
specification_version: 4
|
230
235
|
summary: A wrapper for Onfido API
|
@@ -236,6 +241,7 @@ test_files:
|
|
236
241
|
- spec/integrations/exceptions_spec.rb
|
237
242
|
- spec/integrations/live_photo_spec.rb
|
238
243
|
- spec/integrations/report_spec.rb
|
244
|
+
- spec/integrations/report_type_group_spec.rb
|
239
245
|
- spec/integrations/webhook_spec.rb
|
240
246
|
- spec/onfido/api_spec.rb
|
241
247
|
- spec/onfido/connection_error_spec.rb
|
@@ -253,9 +259,13 @@ test_files:
|
|
253
259
|
- spec/support/fixtures/checks.json
|
254
260
|
- spec/support/fixtures/checks_with_expanded_reports.json
|
255
261
|
- spec/support/fixtures/document.json
|
262
|
+
- spec/support/fixtures/documents.json
|
256
263
|
- spec/support/fixtures/live_photo.json
|
257
264
|
- spec/support/fixtures/report.json
|
265
|
+
- spec/support/fixtures/report_type_group.json
|
266
|
+
- spec/support/fixtures/report_type_groups.json
|
258
267
|
- spec/support/fixtures/reports.json
|
259
268
|
- spec/support/fixtures/unexpected_error_format.json
|
260
269
|
- spec/support/fixtures/webhook.json
|
261
270
|
- spec/support/fixtures/webhooks.json
|
271
|
+
has_rdoc:
|