onfido 0.15.1 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/gem-push.yml +31 -0
  3. data/.github/workflows/ruby.yml +25 -0
  4. data/.rubocop.yml +5 -49
  5. data/.travis.yml +3 -10
  6. data/CHANGELOG.md +28 -0
  7. data/Gemfile +2 -0
  8. data/LICENSE +2 -1
  9. data/README.md +46 -172
  10. data/lib/onfido.rb +4 -4
  11. data/lib/onfido/api.rb +21 -15
  12. data/lib/onfido/errors/connection_error.rb +2 -0
  13. data/lib/onfido/errors/onfido_error.rb +2 -0
  14. data/lib/onfido/errors/request_error.rb +2 -0
  15. data/lib/onfido/errors/server_error.rb +2 -0
  16. data/lib/onfido/options.rb +38 -0
  17. data/lib/onfido/resource.rb +44 -61
  18. data/lib/onfido/resources/address.rb +3 -2
  19. data/lib/onfido/resources/applicant.rb +8 -6
  20. data/lib/onfido/resources/check.rb +15 -19
  21. data/lib/onfido/resources/document.rb +13 -11
  22. data/lib/onfido/resources/extraction.rb +11 -0
  23. data/lib/onfido/resources/live_photo.rb +11 -14
  24. data/lib/onfido/resources/live_video.rb +7 -8
  25. data/lib/onfido/resources/report.rb +10 -9
  26. data/lib/onfido/resources/sdk_token.rb +5 -5
  27. data/lib/onfido/resources/webhook.rb +15 -11
  28. data/lib/onfido/version.rb +3 -1
  29. data/onfido.gemspec +10 -12
  30. data/spec/integrations/address_spec.rb +5 -2
  31. data/spec/integrations/applicant_spec.rb +29 -42
  32. data/spec/integrations/check_spec.rb +28 -69
  33. data/spec/integrations/document_spec.rb +22 -19
  34. data/spec/integrations/extraction_spec.rb +23 -0
  35. data/spec/integrations/live_photo_spec.rb +18 -15
  36. data/spec/integrations/live_video_spec.rb +13 -11
  37. data/spec/integrations/report_spec.rb +16 -13
  38. data/spec/integrations/resource_spec.rb +93 -0
  39. data/spec/integrations/sdk_token_spec.rb +10 -6
  40. data/spec/integrations/webhook_spec.rb +56 -37
  41. data/spec/onfido/api_spec.rb +14 -25
  42. data/spec/onfido/connection_error_spec.rb +4 -2
  43. data/spec/onfido/options_spec.rb +39 -0
  44. data/spec/onfido/request_error_spec.rb +4 -2
  45. data/spec/spec_helper.rb +3 -5
  46. data/spec/support/fake_onfido_api.rb +77 -88
  47. data/spec/support/fixtures/applicant.json +21 -42
  48. data/spec/support/fixtures/check.json +4 -4
  49. data/spec/support/fixtures/checks.json +4 -4
  50. data/spec/support/fixtures/document.json +2 -2
  51. data/spec/support/fixtures/documents.json +8 -8
  52. data/spec/support/fixtures/extraction.json +23 -0
  53. data/spec/support/fixtures/live_photo.json +3 -3
  54. data/spec/support/fixtures/live_photos.json +6 -6
  55. data/spec/support/fixtures/live_video.json +3 -3
  56. data/spec/support/fixtures/live_videos.json +4 -4
  57. data/spec/support/fixtures/report.json +4 -4
  58. data/spec/support/fixtures/reports.json +8 -8
  59. data/spec/support/fixtures/webhook.json +6 -5
  60. data/spec/support/fixtures/webhooks.json +17 -12
  61. metadata +27 -65
  62. data/Rakefile +0 -1
  63. data/lib/onfido/configuration.rb +0 -47
  64. data/lib/onfido/null_logger.rb +0 -5
  65. data/lib/onfido/resources/report_type_group.rb +0 -11
  66. data/spec/integrations/exceptions_spec.rb +0 -74
  67. data/spec/integrations/report_type_group_spec.rb +0 -19
  68. data/spec/onfido/resource_spec.rb +0 -137
  69. data/spec/onfido_spec.rb +0 -84
  70. data/spec/support/fixtures/check_with_expanded_reports.json +0 -30
  71. data/spec/support/fixtures/checks_with_expanded_reports.json +0 -34
  72. data/spec/support/fixtures/report_type_group.json +0 -25
  73. data/spec/support/fixtures/report_type_groups.json +0 -30
@@ -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
- }