onfido 0.15.1 → 1.0.0

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.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +5 -0
  3. data/LICENSE +2 -1
  4. data/README.md +18 -32
  5. data/lib/onfido.rb +0 -1
  6. data/lib/onfido/api.rb +0 -4
  7. data/lib/onfido/configuration.rb +2 -3
  8. data/lib/onfido/resource.rb +1 -5
  9. data/lib/onfido/resources/address.rb +4 -2
  10. data/lib/onfido/resources/applicant.rb +6 -6
  11. data/lib/onfido/resources/check.rb +9 -19
  12. data/lib/onfido/resources/document.rb +11 -11
  13. data/lib/onfido/resources/live_photo.rb +9 -14
  14. data/lib/onfido/resources/live_video.rb +5 -8
  15. data/lib/onfido/resources/report.rb +8 -9
  16. data/lib/onfido/resources/sdk_token.rb +3 -5
  17. data/lib/onfido/resources/webhook.rb +7 -9
  18. data/lib/onfido/version.rb +1 -1
  19. data/onfido.gemspec +6 -6
  20. data/spec/integrations/address_spec.rb +1 -0
  21. data/spec/integrations/applicant_spec.rb +18 -36
  22. data/spec/integrations/check_spec.rb +13 -67
  23. data/spec/integrations/document_spec.rb +16 -17
  24. data/spec/integrations/exceptions_spec.rb +12 -13
  25. data/spec/integrations/live_photo_spec.rb +12 -13
  26. data/spec/integrations/live_video_spec.rb +7 -10
  27. data/spec/integrations/report_spec.rb +11 -13
  28. data/spec/integrations/sdk_token_spec.rb +5 -5
  29. data/spec/integrations/webhook_spec.rb +26 -18
  30. data/spec/onfido/resource_spec.rb +6 -12
  31. data/spec/onfido_spec.rb +3 -11
  32. data/spec/support/fake_onfido_api.rb +44 -78
  33. data/spec/support/fixtures/applicant.json +21 -42
  34. data/spec/support/fixtures/check.json +4 -4
  35. data/spec/support/fixtures/checks.json +4 -4
  36. data/spec/support/fixtures/document.json +2 -2
  37. data/spec/support/fixtures/documents.json +8 -8
  38. data/spec/support/fixtures/live_photo.json +3 -3
  39. data/spec/support/fixtures/live_photos.json +6 -6
  40. data/spec/support/fixtures/live_video.json +3 -3
  41. data/spec/support/fixtures/live_videos.json +4 -4
  42. data/spec/support/fixtures/report.json +4 -4
  43. data/spec/support/fixtures/reports.json +8 -8
  44. data/spec/support/fixtures/webhook.json +6 -5
  45. data/spec/support/fixtures/webhooks.json +17 -12
  46. metadata +11 -24
  47. data/lib/onfido/resources/report_type_group.rb +0 -11
  48. data/spec/integrations/report_type_group_spec.rb +0 -19
  49. data/spec/support/fixtures/check_with_expanded_reports.json +0 -30
  50. data/spec/support/fixtures/checks_with_expanded_reports.json +0 -34
  51. data/spec/support/fixtures/report_type_group.json +0 -25
  52. data/spec/support/fixtures/report_type_groups.json +0 -30
@@ -1,44 +1,23 @@
1
1
  {
2
- "id":"61f659cb-c90b-4067-808a-6136b5c01351",
3
- "created_at":"2015-04-10T13:16:01Z",
4
- "title":"Mr",
5
- "first_name":"Chandler",
6
- "middle_name":"Muriel",
7
- "last_name":"Bing",
8
- "email":"chandler_bing_6@friends.com",
9
- "gender":"Male",
10
- "dob":"1968-04-08",
11
- "telephone":"555555555",
12
- "mobile":"77777777",
13
- "country":"gbr",
14
- "href":"/v2/applicants/61f659cb-c90b-4067-808a-6136b5c01351",
15
- "id_numbers":[],
16
- "addresses": [
17
- {
18
- "flat_number":"4",
19
- "building_number":"100",
20
- "building_name":"Awesome Building",
21
- "street":"Main Street",
22
- "sub_street":"A sub street",
23
- "town":"London",
24
- "state":"",
25
- "postcode":"SW4 6EH",
26
- "country":"GBR",
27
- "start_date":"",
28
- "end_date":""
29
- },
30
- {
31
- "flat_number":"1",
32
- "building_number":"10",
33
- "building_name":"Great Building",
34
- "street":"Old Street",
35
- "sub_street":"Sub Street",
36
- "town":"London",
37
- "state":"",
38
- "postcode":"SW1 4NG",
39
- "country":"GBR",
40
- "start_date":"",
41
- "end_date":""
42
- }
43
- ]
2
+ "id":"61f659cb-c90b-4067-808a-6136b5c01351",
3
+ "created_at":"2015-04-10T13:16:01Z",
4
+ "title":"Mr",
5
+ "first_name":"Chandler",
6
+ "middle_name":"Muriel",
7
+ "last_name":"Bing",
8
+ "email":"chandler_bing_6@friends.com",
9
+ "dob":"1968-04-08",
10
+ "href":"/v3/applicants/61f659cb-c90b-4067-808a-6136b5c01351",
11
+ "id_numbers":[],
12
+ "address": {
13
+ "flat_number":"4",
14
+ "building_number":"100",
15
+ "building_name":"Awesome Building",
16
+ "street":"Main Street",
17
+ "sub_street":"A sub street",
18
+ "town":"London",
19
+ "state":"",
20
+ "postcode":"SW4 6EH",
21
+ "country":"GBR"
22
+ }
44
23
  }
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "id": "8546921-123123-123123",
3
- "created_at": "2014-05-23T13:50:33Z",
4
- "href": "/v2/applicants/61f659cb-c90b-4067-808a-6136b5c01351/checks/8546921-123123-123123",
5
- "type": "standard",
3
+ "created_at": "2019-05-23T13:50:33Z",
4
+ "href": "/v3/checks/8546921-123123-123123",
5
+ "applicant_provides_data": "false",
6
6
  "status": "pending",
7
7
  "result": "pending",
8
- "reports": [
8
+ "report_ids": [
9
9
  "1030303-123123-375629",
10
10
  "1030303-123123-456789"
11
11
  ]
@@ -2,12 +2,12 @@
2
2
  "checks": [
3
3
  {
4
4
  "id": "8546921-123123-123123",
5
- "created_at": "2014-05-23T13:50:33Z",
6
- "href": "/v2/applicants/61f659cb-c90b-4067-808a-6136b5c01351/checks/8546921-123123-123123",
7
- "type": "standard",
5
+ "created_at": "2019-11-23T13:50:33Z",
6
+ "href": "/v3/checks/8546921-123123-123123",
7
+ "applicant_provides_data": "false",
8
8
  "status": "pending",
9
9
  "result": "pending",
10
- "reports": [
10
+ "report_ids": [
11
11
  "1030303-123123-375629",
12
12
  "1030303-123123-456789"
13
13
  ]
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "7568415-123123-123123",
3
- "created_at": "2014-05-23 13:50:33Z",
4
- "href": "/v2/applicants/1030303-123123-123123/documents/7568415-123123-123123",
3
+ "created_at": "2019-11-23 13:50:33Z",
4
+ "href": "/v3/documents/7568415-123123-123123",
5
5
  "file_name": "passport.jpg",
6
6
  "file_type": "png",
7
7
  "file_size": 282870,
@@ -2,22 +2,22 @@
2
2
  "documents": [
3
3
  {
4
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",
5
+ "created_at": "2019-11-23 13:50:33Z",
6
+ "href": "/v3/documents/7568415-123123-123123",
7
7
  "file_name": "passport.jpg",
8
8
  "file_type": "png",
9
9
  "file_size": 282870,
10
- "type": "passport",
11
- "side": "back"
10
+ "type": "passport"
12
11
  },
13
12
  {
14
13
  "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",
14
+ "created_at": "2019-11-23 13:50:40Z",
15
+ "href": "/v3/documents/7568415-123123-123123",
16
+ "file_name": "driving_licence.png",
18
17
  "file_type": "png",
19
18
  "file_size": 282870,
20
- "type": "right_to_work"
19
+ "type": "driving_licence",
20
+ "side": "front"
21
21
  }
22
22
  ]
23
23
  }
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "id": "3538c8f6-fdce-4745-9d34-fc246bc05aa1",
3
- "created_at": "2014-05-23 13:50:33Z",
3
+ "created_at": "2019-11-23 13:50:33Z",
4
4
  "file_name": "onfido_captured_image.jpg",
5
5
  "file_type": "image/jpeg",
6
6
  "file_size": 47544,
7
- "href": "/v2/live_photos/3538c8f6-fdce-4745-9d34-fc246bc05aa1",
8
- "download_href": "/v2/live_photos/3538c8f6-fdce-4745-9d34-fc246bc05aa1/download"
7
+ "href": "/v3/live_photos/3538c8f6-fdce-4745-9d34-fc246bc05aa1",
8
+ "download_href": "/v3/live_photos/3538c8f6-fdce-4745-9d34-fc246bc05aa1/download"
9
9
  }
@@ -2,21 +2,21 @@
2
2
  "live_photos": [
3
3
  {
4
4
  "id": "3538c8f6-fdce-4745-9d34-fc246bc05aa1",
5
- "created_at": "2014-05-23 13:50:33Z",
5
+ "created_at": "2019-11-23 13:50:33Z",
6
6
  "file_name": "onfido_captured_image.jpg",
7
7
  "file_type": "image/jpeg",
8
8
  "file_size": 47544,
9
- "href": "/v2/live_photos/3538c8f6-fdce-4745-9d34-fc246bc05aa1",
10
- "download_href": "/v2/live_photos/3538c8f6-fdce-4745-9d34-fc246bc05aa1/download"
9
+ "href": "/v3/live_photos/3538c8f6-fdce-4745-9d34-fc246bc05aa1",
10
+ "download_href": "/v3/live_photos/3538c8f6-fdce-4745-9d34-fc246bc05aa1/download"
11
11
  },
12
12
  {
13
13
  "id": "5134c12a-555a-1234-5e12-9d34fcbc11ba",
14
- "created_at": "2014-05-23 13:50:33Z",
14
+ "created_at": "2019-11-23 13:50:33Z",
15
15
  "file_name": "onfido_captured_image.jpg",
16
16
  "file_type": "image/jpeg",
17
17
  "file_size": 47544,
18
- "href": "/v2/live_photos/5134c12a-555a-1234-5e12-9d34fcbc11ba",
19
- "download_href": "/v2/live_photos/5134c12a-555a-1234-5e12-9d34fcbc11ba/download"
18
+ "href": "/v3/live_photos/5134c12a-555a-1234-5e12-9d34fcbc11ba",
19
+ "download_href": "/v3/live_photos/5134c12a-555a-1234-5e12-9d34fcbc11ba/download"
20
20
  }
21
21
  ]
22
22
  }
@@ -14,10 +14,10 @@
14
14
  ]
15
15
  }
16
16
  ],
17
- "created_at" : "2018-05-29T09:00:39Z",
17
+ "created_at" : "2019-11-29T09:00:39Z",
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" : "/v2/live_videos/c9701e9b-83aa-442f-995b-20320ee8fb01",
22
- "download_href" : "/v2/live_videos/c9701e9b-83aa-442f-995b-20320ee8fb01/download"
21
+ "href" : "/v3/live_videos/c9701e9b-83aa-442f-995b-20320ee8fb01",
22
+ "download_href" : "/v3/live_videos/c9701e9b-83aa-442f-995b-20320ee8fb01/download"
23
23
  }
@@ -15,12 +15,12 @@
15
15
  "type": "recite"
16
16
  }
17
17
  ],
18
- "created_at": "2018-05-29T09:00:39Z",
19
- "download_href": "/v2/live_videos/c9701e9b-83aa-442f-995b-20320ee8fb01/download",
20
- "file_name": "output-29-05-2018_11_00_24.mov",
18
+ "created_at": "2019-11-29T09:00:39Z",
19
+ "download_href": "/v3/live_videos/c9701e9b-83aa-442f-995b-20320ee8fb01/download",
20
+ "file_name": "output-29-11-2019_11_00_24.mov",
21
21
  "file_size": 3348421,
22
22
  "file_type": "video/quicktime",
23
- "href": "/v2/live_videos/c9701e9b-83aa-442f-995b-20320ee8fb01",
23
+ "href": "/v3/live_videos/c9701e9b-83aa-442f-995b-20320ee8fb01",
24
24
  "id": "c9701e9b-83aa-442f-995b-20320ee8fb01"
25
25
  }
26
26
  ]
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "id": "6951786-123123-422221",
3
- "name": "identity",
4
- "created_at": "2014-05-23T13:50:33Z",
5
- "status": "awaiting_applicant",
3
+ "name": "document",
4
+ "created_at": "2019-11-23T13:50:45Z",
5
+ "status": "in_progress",
6
6
  "result": "pending",
7
- "href": "/v2/checks/8546921-123123-123123/reports/6951786-123123-422221",
7
+ "href": "/v3/reports/6951786-123123-422221",
8
8
  "breakdown": {},
9
9
  "properties": {}
10
10
  }
@@ -2,21 +2,21 @@
2
2
  "reports": [
3
3
  {
4
4
  "id": "6951786-123123-422221",
5
- "name": "identity",
6
- "created_at": "2014-05-23T13:50:33Z",
7
- "status": "awaiting_applicant",
5
+ "name": "document",
6
+ "created_at": "2019-11-23T13:50:45Z",
7
+ "status": "in_progress",
8
8
  "result": "pending",
9
- "href": "/v2/checks/8546921-123123-123123/reports/6951786-123123-422221",
9
+ "href": "/v3/reports/6951786-123123-422221",
10
10
  "breakdown": {},
11
11
  "properties": {}
12
12
  },
13
13
  {
14
14
  "id": "6951786-123123-316712",
15
- "name": "document",
16
- "created_at": "2014-05-23T13:50:33Z",
17
- "status": "awaiting_applicant",
15
+ "name": "facial_similarity_photo",
16
+ "created_at": "2019-11-23T13:50:45Z",
17
+ "status": "in_progress",
18
18
  "result": "pending",
19
- "href": "/v2/checks/8546921-123123-123123/reports/6951786-123123-316712",
19
+ "href": "/v3/reports/6951786-123123-316712",
20
20
  "breakdown": {},
21
21
  "properties": {}
22
22
  }
@@ -3,11 +3,12 @@
3
3
  "url": "https://webhookendpoint.url",
4
4
  "token": "yV85IsmuYwmjQGlZ",
5
5
  "enabled": true,
6
- "href": "/v2/webhooks/fcb73186-0733-4f6f-9c57-d9d5ef979443",
6
+ "href": "/v3/webhooks/fcb73186-0733-4f6f-9c57-d9d5ef979443",
7
+ "environments": [
8
+ "live"
9
+ ],
7
10
  "events": [
8
- "report completion",
9
- "report withdrawal",
10
- "check completion",
11
- "check in progress"
11
+ "report.completed",
12
+ "check.completed"
12
13
  ]
13
14
  }
@@ -2,24 +2,29 @@
2
2
  "webhooks": [
3
3
  {
4
4
  "id": "dd0a89e4-d44e-417a-aec4-01137d01ae59",
5
- "url": "https://demo.com","enabled":false,
6
- "href": "/v2/webhooks/dd0a89e4-d44e-417a-aec4-01137d01ae59",
7
- "events":
8
- [
9
- "check in progress"
5
+ "url": "https://demo.com",
6
+ "enabled":false,
7
+ "href": "/v3/webhooks/dd0a89e4-d44e-417a-aec4-01137d01ae59",
8
+ "environments": [
9
+ "live"
10
+ ],
11
+ "events": [
12
+ "report.completed",
13
+ "report.withdrawn",
14
+ "check.completed"
10
15
  ]
11
16
  },
12
17
  {
13
18
  "id": "bfc727a8-f7bf-4073-b123-ed70a70f58e5",
14
19
  "url": "https://demo2.com",
15
20
  "enabled": true,
16
- "href": "/v2/webhooks/bfc727a8-f7bf-4073-b123-ed70a70f58e5",
17
- "events":
18
- [
19
- "report completion",
20
- "report withdrawal",
21
- "check in progress",
22
- "check completion"
21
+ "href": "/v3/webhooks/bfc727a8-f7bf-4073-b123-ed70a70f58e5",
22
+ "environments": [
23
+ "live"
24
+ ],
25
+ "events": [
26
+ "report.completed",
27
+ "check.completed"
23
28
  ]
24
29
  }
25
30
  ]
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: onfido
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
- - Pericles Theodorou
8
- - Grey Baker
9
- autorequire:
7
+ - Onfido
8
+ autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2021-03-12 00:00:00.000000000 Z
11
+ date: 2020-01-13 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: bundler
@@ -137,12 +136,11 @@ dependencies:
137
136
  - - "~>"
138
137
  - !ruby/object:Gem::Version
139
138
  version: '2.0'
140
- description: A thin wrapper for Onfido's API. This gem supports both v1 and v2 of
141
- the Onfido API. Refer to Onfido's API documentation for details of the expected
142
- requests and responses for both.
139
+ description: A thin wrapper for Onfido's API. This gem only supports v3 of the Onfido
140
+ API. Refer to Onfido's API documentation for details of the expected requests and
141
+ responses.
143
142
  email:
144
- - periclestheo@gmail.com
145
- - grey@gocardless.com
143
+ - engineering@onfido.com
146
144
  executables: []
147
145
  extensions: []
148
146
  extra_rdoc_files: []
@@ -172,7 +170,6 @@ files:
172
170
  - lib/onfido/resources/live_photo.rb
173
171
  - lib/onfido/resources/live_video.rb
174
172
  - lib/onfido/resources/report.rb
175
- - lib/onfido/resources/report_type_group.rb
176
173
  - lib/onfido/resources/sdk_token.rb
177
174
  - lib/onfido/resources/webhook.rb
178
175
  - lib/onfido/version.rb
@@ -185,7 +182,6 @@ files:
185
182
  - spec/integrations/live_photo_spec.rb
186
183
  - spec/integrations/live_video_spec.rb
187
184
  - spec/integrations/report_spec.rb
188
- - spec/integrations/report_type_group_spec.rb
189
185
  - spec/integrations/sdk_token_spec.rb
190
186
  - spec/integrations/webhook_spec.rb
191
187
  - spec/onfido/api_spec.rb
@@ -200,9 +196,7 @@ files:
200
196
  - spec/support/fixtures/applicant.json
201
197
  - spec/support/fixtures/applicants.json
202
198
  - spec/support/fixtures/check.json
203
- - spec/support/fixtures/check_with_expanded_reports.json
204
199
  - spec/support/fixtures/checks.json
205
- - spec/support/fixtures/checks_with_expanded_reports.json
206
200
  - spec/support/fixtures/document.json
207
201
  - spec/support/fixtures/documents.json
208
202
  - spec/support/fixtures/live_photo.json
@@ -211,18 +205,16 @@ files:
211
205
  - spec/support/fixtures/live_videos.json
212
206
  - spec/support/fixtures/not_scheduled_for_deletion_error.json
213
207
  - spec/support/fixtures/report.json
214
- - spec/support/fixtures/report_type_group.json
215
- - spec/support/fixtures/report_type_groups.json
216
208
  - spec/support/fixtures/reports.json
217
209
  - spec/support/fixtures/sdk_token.json
218
210
  - spec/support/fixtures/unexpected_error_format.json
219
211
  - spec/support/fixtures/webhook.json
220
212
  - spec/support/fixtures/webhooks.json
221
- homepage: http://github.com/hvssle/onfido
213
+ homepage: http://github.com/onfido/onfido-ruby
222
214
  licenses:
223
215
  - MIT
224
216
  metadata: {}
225
- post_install_message:
217
+ post_install_message:
226
218
  rdoc_options: []
227
219
  require_paths:
228
220
  - lib
@@ -238,7 +230,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
238
230
  version: '0'
239
231
  requirements: []
240
232
  rubygems_version: 3.0.3
241
- signing_key:
233
+ signing_key:
242
234
  specification_version: 4
243
235
  summary: A wrapper for Onfido API
244
236
  test_files:
@@ -250,7 +242,6 @@ test_files:
250
242
  - spec/integrations/live_photo_spec.rb
251
243
  - spec/integrations/live_video_spec.rb
252
244
  - spec/integrations/report_spec.rb
253
- - spec/integrations/report_type_group_spec.rb
254
245
  - spec/integrations/sdk_token_spec.rb
255
246
  - spec/integrations/webhook_spec.rb
256
247
  - spec/onfido/api_spec.rb
@@ -265,9 +256,7 @@ test_files:
265
256
  - spec/support/fixtures/applicant.json
266
257
  - spec/support/fixtures/applicants.json
267
258
  - spec/support/fixtures/check.json
268
- - spec/support/fixtures/check_with_expanded_reports.json
269
259
  - spec/support/fixtures/checks.json
270
- - spec/support/fixtures/checks_with_expanded_reports.json
271
260
  - spec/support/fixtures/document.json
272
261
  - spec/support/fixtures/documents.json
273
262
  - spec/support/fixtures/live_photo.json
@@ -276,8 +265,6 @@ test_files:
276
265
  - spec/support/fixtures/live_videos.json
277
266
  - spec/support/fixtures/not_scheduled_for_deletion_error.json
278
267
  - spec/support/fixtures/report.json
279
- - spec/support/fixtures/report_type_group.json
280
- - spec/support/fixtures/report_type_groups.json
281
268
  - spec/support/fixtures/reports.json
282
269
  - spec/support/fixtures/sdk_token.json
283
270
  - spec/support/fixtures/unexpected_error_format.json
@@ -1,11 +0,0 @@
1
- module Onfido
2
- class ReportTypeGroup < Resource
3
- def find(report_type_group_id)
4
- get(url: url_for("report_type_groups/#{report_type_group_id}"))
5
- end
6
-
7
- def all
8
- get(url: url_for("report_type_groups"))
9
- end
10
- end
11
- end