onfido 2.1.1 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +1 -1
- data/lib/onfido/options.rb +1 -1
- data/lib/onfido/version.rb +1 -1
- data/spec/integrations/applicant_spec.rb +1 -1
- data/spec/onfido/options_spec.rb +1 -1
- data/spec/support/fake_onfido_api.rb +36 -36
- data/spec/support/fixtures/applicant.json +1 -1
- data/spec/support/fixtures/check.json +1 -1
- data/spec/support/fixtures/checks.json +1 -1
- data/spec/support/fixtures/document.json +1 -1
- data/spec/support/fixtures/documents.json +2 -2
- data/spec/support/fixtures/live_photo.json +2 -2
- data/spec/support/fixtures/live_photos.json +4 -4
- data/spec/support/fixtures/live_video.json +2 -2
- data/spec/support/fixtures/live_videos.json +2 -2
- data/spec/support/fixtures/report.json +1 -1
- data/spec/support/fixtures/reports.json +2 -2
- data/spec/support/fixtures/webhook.json +1 -1
- data/spec/support/fixtures/webhooks.json +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 33080fe8a76369f014e7505bbc1597a6531f683374c958729f3a5aac6aa181c4
|
4
|
+
data.tar.gz: 35f3beb4faa5fc70b8c7f9e40418f8befa943a39ff0801403ebd2bc307a8bdbf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3910d5775649dc5091b49e3417ce6b89962799786026cc0f829e8cca88e2e86ea720e01570dd3b32630776d5e4007d76ed5773d473c6616a14ab7fd64f3e0740
|
7
|
+
data.tar.gz: 1ea8c2e2a8147a207213d8ca41fa11c98c46393fcba383e242450621cd66210ac0edc0b464a75fa9c1328c136a4d34d49c9434d6aa22e651779989c05dc6ef0a
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -7,7 +7,7 @@ The official Ruby library for integrating with the Onfido API.
|
|
7
7
|
|
8
8
|
Documentation can be found at https://documentation.onfido.com
|
9
9
|
|
10
|
-
This version uses Onfido API v3.
|
10
|
+
This version uses Onfido API v3.3 and is compatible with Ruby 2.4 onwards. Refer to our [API versioning guide](https://developers.onfido.com/guide/api-versioning-policy#client-libraries) for details of which client library versions use which versions of the API.
|
11
11
|
|
12
12
|
## Installation
|
13
13
|
|
data/lib/onfido/options.rb
CHANGED
data/lib/onfido/version.rb
CHANGED
@@ -34,7 +34,7 @@ describe Onfido::Applicant do
|
|
34
34
|
|
35
35
|
it 'serializes the payload correctly' do
|
36
36
|
WebMock.after_request do |request_signature, _response|
|
37
|
-
if request_signature.uri.path == 'v3.
|
37
|
+
if request_signature.uri.path == 'v3.3/applicants'
|
38
38
|
expect(Rack::Utils.parse_nested_query(request_signature.body))
|
39
39
|
.to eq(params)
|
40
40
|
end
|
data/spec/onfido/options_spec.rb
CHANGED
@@ -19,32 +19,32 @@ class FakeOnfidoAPI < Sinatra::Base # rubocop:disable Metrics/ClassLength
|
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
|
-
get '/v3.
|
22
|
+
get '/v3.3/addresses/pick' do
|
23
23
|
json_response(200, 'addresses.json')
|
24
24
|
end
|
25
25
|
|
26
|
-
post '/v3.
|
26
|
+
post '/v3.3/applicants' do
|
27
27
|
json_response(201, 'applicant.json')
|
28
28
|
end
|
29
29
|
|
30
|
-
put '/v3.
|
30
|
+
put '/v3.3/applicants/:id' do
|
31
31
|
json_response(200, 'applicant.json')
|
32
32
|
end
|
33
33
|
|
34
|
-
get '/v3.
|
34
|
+
get '/v3.3/applicants/:id' do
|
35
35
|
json_response(200, 'applicant.json')
|
36
36
|
end
|
37
37
|
|
38
|
-
get '/v3.
|
38
|
+
get '/v3.3/applicants' do
|
39
39
|
response = json_response(200, 'applicants.json')
|
40
40
|
{ applicants: JSON.parse(response)['applicants'][pagination_range] }.to_json
|
41
41
|
end
|
42
42
|
|
43
|
-
delete '/v3.
|
43
|
+
delete '/v3.3/applicants/:id' do
|
44
44
|
status 204
|
45
45
|
end
|
46
46
|
|
47
|
-
post '/v3.
|
47
|
+
post '/v3.3/applicants/:id/restore' do
|
48
48
|
if params['id'] == 'a2fb9c62-ab10-4898-a8ec-342c4b552ad5'
|
49
49
|
json_response(422, 'not_scheduled_for_deletion_error.json')
|
50
50
|
else
|
@@ -52,37 +52,37 @@ class FakeOnfidoAPI < Sinatra::Base # rubocop:disable Metrics/ClassLength
|
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
55
|
-
post '/v3.
|
55
|
+
post '/v3.3/documents' do
|
56
56
|
json_response(201, 'document.json')
|
57
57
|
end
|
58
58
|
|
59
|
-
post '/v3.
|
59
|
+
post '/v3.3/extractions' do
|
60
60
|
json_response(201, 'extraction.json')
|
61
61
|
end
|
62
62
|
|
63
|
-
get '/v3.
|
63
|
+
get '/v3.3/documents/:id' do
|
64
64
|
json_response(200, 'document.json')
|
65
65
|
end
|
66
66
|
|
67
|
-
get '/v3.
|
67
|
+
get '/v3.3/documents' do
|
68
68
|
json_response(200, 'documents.json')
|
69
69
|
end
|
70
70
|
|
71
|
-
get '/v3.
|
71
|
+
get '/v3.3/documents/:id/download' do
|
72
72
|
status 200
|
73
73
|
content_type 'application/octet-stream'
|
74
74
|
"\x01\x02\x03" # acts as binary file data
|
75
75
|
end
|
76
76
|
|
77
|
-
post '/v3.
|
77
|
+
post '/v3.3/live_photos' do
|
78
78
|
json_response(201, 'live_photo.json')
|
79
79
|
end
|
80
80
|
|
81
|
-
get '/v3.
|
81
|
+
get '/v3.3/live_photos/:id' do
|
82
82
|
json_response(200, 'live_photo.json')
|
83
83
|
end
|
84
84
|
|
85
|
-
get '/v3.
|
85
|
+
get '/v3.3/live_photos' do
|
86
86
|
if params['applicant_id'] == '1030303-123123-123123'
|
87
87
|
json_response(200, 'live_photos.json')
|
88
88
|
else
|
@@ -90,17 +90,17 @@ class FakeOnfidoAPI < Sinatra::Base # rubocop:disable Metrics/ClassLength
|
|
90
90
|
end
|
91
91
|
end
|
92
92
|
|
93
|
-
get '/v3.
|
93
|
+
get '/v3.3/live_photos/:id/download' do
|
94
94
|
status 200
|
95
95
|
content_type 'image/jpeg'
|
96
96
|
"\x01\x02\x03" # acts as binary file data
|
97
97
|
end
|
98
98
|
|
99
|
-
get '/v3.
|
99
|
+
get '/v3.3/live_videos/:id' do
|
100
100
|
json_response(200, 'live_video.json')
|
101
101
|
end
|
102
102
|
|
103
|
-
get '/v3.
|
103
|
+
get '/v3.3/live_videos' do
|
104
104
|
if params['applicant_id'] == '1030303-123123-123123'
|
105
105
|
json_response(200, 'live_videos.json')
|
106
106
|
else
|
@@ -108,79 +108,79 @@ class FakeOnfidoAPI < Sinatra::Base # rubocop:disable Metrics/ClassLength
|
|
108
108
|
end
|
109
109
|
end
|
110
110
|
|
111
|
-
get '/v3.
|
111
|
+
get '/v3.3/live_videos/:id/download' do
|
112
112
|
status 200
|
113
113
|
content_type 'video/quicktime'
|
114
114
|
"\x01\x02\x03" # acts as binary file data
|
115
115
|
end
|
116
116
|
|
117
|
-
post '/v3.
|
117
|
+
post '/v3.3/checks' do
|
118
118
|
params['applicant_id'].nil? ? status(422) : json_response(201, 'check.json')
|
119
119
|
end
|
120
120
|
|
121
|
-
get '/v3.
|
121
|
+
get '/v3.3/checks/:id' do
|
122
122
|
json_response(200, 'check.json')
|
123
123
|
end
|
124
124
|
|
125
|
-
get '/v3.
|
125
|
+
get '/v3.3/checks' do
|
126
126
|
json_response(200, 'checks.json')
|
127
127
|
end
|
128
128
|
|
129
|
-
post '/v3.
|
129
|
+
post '/v3.3/checks/:id/resume' do
|
130
130
|
status 204 # no_content
|
131
131
|
end
|
132
132
|
|
133
|
-
get '/v3.
|
133
|
+
get '/v3.3/checks/:id/download' do
|
134
134
|
status 200
|
135
135
|
content_type 'application/pdf'
|
136
136
|
"\x01\x02\x03" # acts as binary file data
|
137
137
|
end
|
138
138
|
|
139
|
-
get '/v3.
|
139
|
+
get '/v3.3/reports' do
|
140
140
|
json_response(200, 'reports.json')
|
141
141
|
end
|
142
142
|
|
143
|
-
get '/v3.
|
143
|
+
get '/v3.3/reports/:id' do
|
144
144
|
json_response(200, 'report.json')
|
145
145
|
end
|
146
146
|
|
147
|
-
post '/v3.
|
147
|
+
post '/v3.3/reports/:id/resume' do
|
148
148
|
status 204
|
149
149
|
end
|
150
150
|
|
151
|
-
post '/v3.
|
151
|
+
post '/v3.3/reports/:id/cancel' do
|
152
152
|
status 204
|
153
153
|
end
|
154
154
|
|
155
|
-
post '/v3.
|
155
|
+
post '/v3.3/sdk_token' do
|
156
156
|
json_response(201, 'sdk_token.json')
|
157
157
|
end
|
158
158
|
|
159
|
-
post '/v3.
|
159
|
+
post '/v3.3/webhooks' do
|
160
160
|
json_response(201, 'webhook.json')
|
161
161
|
end
|
162
162
|
|
163
|
-
get '/v3.
|
163
|
+
get '/v3.3/webhooks/:id' do
|
164
164
|
json_response(200, 'webhook.json')
|
165
165
|
end
|
166
166
|
|
167
|
-
delete '/v3.
|
167
|
+
delete '/v3.3/webhooks/:id' do
|
168
168
|
status 204
|
169
169
|
end
|
170
170
|
|
171
|
-
get '/v3.
|
171
|
+
get '/v3.3/webhooks' do
|
172
172
|
json_response(200, 'webhooks.json')
|
173
173
|
end
|
174
174
|
|
175
|
-
get '/v3.
|
175
|
+
get '/v3.3/4xx_response' do
|
176
176
|
json_response(422, '4xx_response.json')
|
177
177
|
end
|
178
178
|
|
179
|
-
get '/v3.
|
179
|
+
get '/v3.3/unexpected_error_format' do
|
180
180
|
json_response(400, 'unexpected_error_format.json')
|
181
181
|
end
|
182
182
|
|
183
|
-
get '/v3.
|
183
|
+
get '/v3.3/unparseable_response' do
|
184
184
|
content_type :json
|
185
185
|
status 504
|
186
186
|
''
|
@@ -7,7 +7,7 @@
|
|
7
7
|
"last_name":"Bing",
|
8
8
|
"email":"chandler_bing_6@friends.com",
|
9
9
|
"dob":"1968-04-08",
|
10
|
-
"href":"/v3.
|
10
|
+
"href":"/v3.3/applicants/61f659cb-c90b-4067-808a-6136b5c01351",
|
11
11
|
"id_numbers":[],
|
12
12
|
"address": {
|
13
13
|
"flat_number":"4",
|
@@ -3,7 +3,7 @@
|
|
3
3
|
{
|
4
4
|
"id": "7568415-123123-123123",
|
5
5
|
"created_at": "2019-11-23 13:50:33Z",
|
6
|
-
"href": "/v3.
|
6
|
+
"href": "/v3.3/documents/7568415-123123-123123",
|
7
7
|
"file_name": "passport.jpg",
|
8
8
|
"file_type": "png",
|
9
9
|
"file_size": 282870,
|
@@ -12,7 +12,7 @@
|
|
12
12
|
{
|
13
13
|
"id": "121122-123123-123123",
|
14
14
|
"created_at": "2019-11-23 13:50:40Z",
|
15
|
-
"href": "/v3.
|
15
|
+
"href": "/v3.3/documents/7568415-123123-123123",
|
16
16
|
"file_name": "driving_licence.png",
|
17
17
|
"file_type": "png",
|
18
18
|
"file_size": 282870,
|
@@ -4,6 +4,6 @@
|
|
4
4
|
"file_name": "onfido_captured_image.jpg",
|
5
5
|
"file_type": "image/jpeg",
|
6
6
|
"file_size": 47544,
|
7
|
-
"href": "/v3.
|
8
|
-
"download_href": "/v3.
|
7
|
+
"href": "/v3.3/live_photos/3538c8f6-fdce-4745-9d34-fc246bc05aa1",
|
8
|
+
"download_href": "/v3.3/live_photos/3538c8f6-fdce-4745-9d34-fc246bc05aa1/download"
|
9
9
|
}
|
@@ -6,8 +6,8 @@
|
|
6
6
|
"file_name": "onfido_captured_image.jpg",
|
7
7
|
"file_type": "image/jpeg",
|
8
8
|
"file_size": 47544,
|
9
|
-
"href": "/v3.
|
10
|
-
"download_href": "/v3.
|
9
|
+
"href": "/v3.3/live_photos/3538c8f6-fdce-4745-9d34-fc246bc05aa1",
|
10
|
+
"download_href": "/v3.3/live_photos/3538c8f6-fdce-4745-9d34-fc246bc05aa1/download"
|
11
11
|
},
|
12
12
|
{
|
13
13
|
"id": "5134c12a-555a-1234-5e12-9d34fcbc11ba",
|
@@ -15,8 +15,8 @@
|
|
15
15
|
"file_name": "onfido_captured_image.jpg",
|
16
16
|
"file_type": "image/jpeg",
|
17
17
|
"file_size": 47544,
|
18
|
-
"href": "/v3.
|
19
|
-
"download_href": "/v3.
|
18
|
+
"href": "/v3.3/live_photos/5134c12a-555a-1234-5e12-9d34fcbc11ba",
|
19
|
+
"download_href": "/v3.3/live_photos/5134c12a-555a-1234-5e12-9d34fcbc11ba/download"
|
20
20
|
}
|
21
21
|
]
|
22
22
|
}
|
@@ -18,6 +18,6 @@
|
|
18
18
|
"file_name" : "output-29-05-2018_11_00_24.mov",
|
19
19
|
"file_type" : "video/quicktime",
|
20
20
|
"file_size" : 3348421,
|
21
|
-
"href" : "/v3.
|
22
|
-
"download_href" : "/v3.
|
21
|
+
"href" : "/v3.3/live_videos/c9701e9b-83aa-442f-995b-20320ee8fb01",
|
22
|
+
"download_href" : "/v3.3/live_videos/c9701e9b-83aa-442f-995b-20320ee8fb01/download"
|
23
23
|
}
|
@@ -16,11 +16,11 @@
|
|
16
16
|
}
|
17
17
|
],
|
18
18
|
"created_at": "2019-11-29T09:00:39Z",
|
19
|
-
"download_href": "/v3.
|
19
|
+
"download_href": "/v3.3/live_videos/c9701e9b-83aa-442f-995b-20320ee8fb01/download",
|
20
20
|
"file_name": "output-29-11-2019_11_00_24.mov",
|
21
21
|
"file_size": 3348421,
|
22
22
|
"file_type": "video/quicktime",
|
23
|
-
"href": "/v3.
|
23
|
+
"href": "/v3.3/live_videos/c9701e9b-83aa-442f-995b-20320ee8fb01",
|
24
24
|
"id": "c9701e9b-83aa-442f-995b-20320ee8fb01"
|
25
25
|
}
|
26
26
|
]
|
@@ -6,7 +6,7 @@
|
|
6
6
|
"created_at": "2019-11-23T13:50:45Z",
|
7
7
|
"status": "in_progress",
|
8
8
|
"result": "pending",
|
9
|
-
"href": "/v3.
|
9
|
+
"href": "/v3.3/reports/6951786-123123-422221",
|
10
10
|
"breakdown": {},
|
11
11
|
"properties": {}
|
12
12
|
},
|
@@ -16,7 +16,7 @@
|
|
16
16
|
"created_at": "2019-11-23T13:50:45Z",
|
17
17
|
"status": "in_progress",
|
18
18
|
"result": "pending",
|
19
|
-
"href": "/v3.
|
19
|
+
"href": "/v3.3/reports/6951786-123123-316712",
|
20
20
|
"breakdown": {},
|
21
21
|
"properties": {}
|
22
22
|
}
|
@@ -4,7 +4,7 @@
|
|
4
4
|
"id": "dd0a89e4-d44e-417a-aec4-01137d01ae59",
|
5
5
|
"url": "https://demo.com",
|
6
6
|
"enabled":false,
|
7
|
-
"href": "/v3.
|
7
|
+
"href": "/v3.3/webhooks/dd0a89e4-d44e-417a-aec4-01137d01ae59",
|
8
8
|
"environments": [
|
9
9
|
"live"
|
10
10
|
],
|
@@ -18,7 +18,7 @@
|
|
18
18
|
"id": "bfc727a8-f7bf-4073-b123-ed70a70f58e5",
|
19
19
|
"url": "https://demo2.com",
|
20
20
|
"enabled": true,
|
21
|
-
"href": "/v3.
|
21
|
+
"href": "/v3.3/webhooks/bfc727a8-f7bf-4073-b123-ed70a70f58e5",
|
22
22
|
"environments": [
|
23
23
|
"live"
|
24
24
|
],
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: onfido
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Onfido
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-02
|
11
|
+
date: 2022-03-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|