onfido 0.12.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +5 -5
  2. data/.rubocop.yml +4 -3
  3. data/.travis.yml +8 -7
  4. data/CHANGELOG.md +23 -0
  5. data/LICENSE +2 -1
  6. data/README.md +70 -70
  7. data/lib/onfido.rb +1 -1
  8. data/lib/onfido/api.rb +4 -4
  9. data/lib/onfido/configuration.rb +12 -16
  10. data/lib/onfido/resource.rb +3 -6
  11. data/lib/onfido/resources/address.rb +1 -1
  12. data/lib/onfido/resources/applicant.rb +9 -5
  13. data/lib/onfido/resources/check.rb +10 -14
  14. data/lib/onfido/resources/document.rb +11 -11
  15. data/lib/onfido/resources/extraction.rb +9 -0
  16. data/lib/onfido/resources/live_photo.rb +9 -14
  17. data/lib/onfido/resources/live_video.rb +5 -8
  18. data/lib/onfido/resources/report.rb +8 -9
  19. data/lib/onfido/resources/sdk_token.rb +3 -5
  20. data/lib/onfido/resources/webhook.rb +11 -9
  21. data/lib/onfido/version.rb +1 -1
  22. data/onfido.gemspec +8 -9
  23. data/spec/integrations/address_spec.rb +1 -0
  24. data/spec/integrations/applicant_spec.rb +38 -32
  25. data/spec/integrations/check_spec.rb +13 -23
  26. data/spec/integrations/document_spec.rb +16 -17
  27. data/spec/integrations/exceptions_spec.rb +12 -13
  28. data/spec/integrations/extraction_spec.rb +19 -0
  29. data/spec/integrations/live_photo_spec.rb +12 -13
  30. data/spec/integrations/live_video_spec.rb +7 -10
  31. data/spec/integrations/report_spec.rb +11 -13
  32. data/spec/integrations/sdk_token_spec.rb +5 -5
  33. data/spec/integrations/webhook_spec.rb +35 -20
  34. data/spec/onfido/resource_spec.rb +10 -14
  35. data/spec/onfido_spec.rb +13 -13
  36. data/spec/support/fake_onfido_api.rb +60 -77
  37. data/spec/support/fixtures/applicant.json +21 -42
  38. data/spec/support/fixtures/check.json +4 -4
  39. data/spec/support/fixtures/checks.json +4 -4
  40. data/spec/support/fixtures/document.json +2 -2
  41. data/spec/support/fixtures/documents.json +8 -8
  42. data/spec/support/fixtures/extraction.json +23 -0
  43. data/spec/support/fixtures/live_photo.json +3 -3
  44. data/spec/support/fixtures/live_photos.json +6 -6
  45. data/spec/support/fixtures/live_video.json +3 -3
  46. data/spec/support/fixtures/live_videos.json +4 -4
  47. data/spec/support/fixtures/not_scheduled_for_deletion_error.json +7 -0
  48. data/spec/support/fixtures/report.json +4 -4
  49. data/spec/support/fixtures/reports.json +8 -8
  50. data/spec/support/fixtures/webhook.json +6 -5
  51. data/spec/support/fixtures/webhooks.json +17 -12
  52. metadata +22 -42
  53. data/lib/onfido/resources/report_type_group.rb +0 -11
  54. data/spec/integrations/report_type_group_spec.rb +0 -19
  55. data/spec/support/fixtures/check_with_expanded_reports.json +0 -30
  56. data/spec/support/fixtures/checks_with_expanded_reports.json +0 -34
  57. data/spec/support/fixtures/report_type_group.json +0 -25
  58. data/spec/support/fixtures/report_type_groups.json +0 -30
@@ -1,19 +0,0 @@
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
@@ -1,30 +0,0 @@
1
- {
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",
6
- "status": "pending",
7
- "result": "pending",
8
- "reports": [
9
- {
10
- "id": "6951786-123123-422221",
11
- "name": "identity",
12
- "created_at": "2014-05-23T13:50:33Z",
13
- "status": "awaiting_applicant",
14
- "result": "pending",
15
- "href": "/v2/checks/8546921-123123-123123/reports/6951786-123123-422221",
16
- "breakdown": {},
17
- "properties": {}
18
- },
19
- {
20
- "id": "6951786-123123-316712",
21
- "name": "document",
22
- "created_at": "2014-05-23T13:50:33Z",
23
- "status": "awaiting_applicant",
24
- "result": "pending",
25
- "href": "/v2/checks/8546921-123123-123123/reports/6951786-123123-316712",
26
- "breakdown": {},
27
- "properties": {}
28
- }
29
- ]
30
- }
@@ -1,34 +0,0 @@
1
- {
2
- "checks": [
3
- {
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",
8
- "status": "pending",
9
- "result": "pending",
10
- "reports": [
11
- {
12
- "id": "6951786-123123-422221",
13
- "name": "identity",
14
- "created_at": "2014-05-23T13:50:33Z",
15
- "status": "awaiting_applicant",
16
- "result": "pending",
17
- "href": "/v2/checks/8546921-123123-123123/reports/6951786-123123-422221",
18
- "breakdown": {},
19
- "properties": {}
20
- },
21
- {
22
- "id": "6951786-123123-316712",
23
- "name": "document",
24
- "created_at": "2014-05-23T13:50:33Z",
25
- "status": "awaiting_applicant",
26
- "result": "pending",
27
- "href": "/v2/checks/8546921-123123-123123/reports/6951786-123123-316712",
28
- "breakdown": {},
29
- "properties": {}
30
- }
31
- ]
32
- }
33
- ]
34
- }
@@ -1,25 +0,0 @@
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
- }
@@ -1,30 +0,0 @@
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
- }