passfort 0.2.3 → 0.3.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 (49) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +17 -17
  3. data/.rubocop.yml +5 -5
  4. data/.ruby-version +1 -1
  5. data/CHANGELOG.md +33 -28
  6. data/Gemfile +5 -5
  7. data/Gemfile.lock +91 -89
  8. data/LICENCE.txt +22 -22
  9. data/README.md +6 -6
  10. data/lib/passfort.rb +35 -35
  11. data/lib/passfort/client.rb +23 -23
  12. data/lib/passfort/endpoint.rb +10 -10
  13. data/lib/passfort/endpoint/checks.rb +19 -19
  14. data/lib/passfort/endpoint/profiles.rb +46 -46
  15. data/lib/passfort/endpoint/tasks.rb +16 -16
  16. data/lib/passfort/errors.rb +15 -15
  17. data/lib/passfort/errors/api_error.rb +16 -16
  18. data/lib/passfort/errors/chargeable_limit_reached_error.rb +12 -12
  19. data/lib/passfort/errors/invalid_api_key_error.rb +12 -12
  20. data/lib/passfort/errors/invalid_input_data_error.rb +12 -12
  21. data/lib/passfort/errors/request_error.rb +12 -12
  22. data/lib/passfort/errors/timeout_error.rb +12 -12
  23. data/lib/passfort/errors/unknown_api_error.rb +12 -12
  24. data/lib/passfort/errors/unparseable_response_error.rb +11 -11
  25. data/lib/passfort/http.rb +89 -65
  26. data/lib/passfort/resource.rb +12 -12
  27. data/lib/passfort/resource/base.rb +21 -21
  28. data/lib/passfort/resource/check.rb +10 -10
  29. data/lib/passfort/resource/company_data.rb +11 -11
  30. data/lib/passfort/resource/individual_data.rb +11 -11
  31. data/lib/passfort/resource/profile.rb +15 -15
  32. data/lib/passfort/resource/task.rb +9 -9
  33. data/lib/passfort/version.rb +5 -5
  34. data/passfort.gemspec +30 -29
  35. data/spec/fixtures/check.json +67 -67
  36. data/spec/fixtures/collected_data.json +7 -7
  37. data/spec/fixtures/company_ownership_check/check.json +78 -78
  38. data/spec/fixtures/company_ownership_check/collected_data.json +7 -7
  39. data/spec/fixtures/company_ownership_check/collected_data_update_request.json +63 -63
  40. data/spec/fixtures/company_ownership_check/profile.json +128 -128
  41. data/spec/fixtures/profile.json +128 -128
  42. data/spec/fixtures/task.json +6 -6
  43. data/spec/integration/company_ownership_check_spec.rb +74 -74
  44. data/spec/passfort/endpoint/checks_spec.rb +22 -22
  45. data/spec/passfort/endpoint/profiles_spec.rb +79 -79
  46. data/spec/passfort/endpoint/tasks_spec.rb +21 -21
  47. data/spec/passfort/http_spec.rb +130 -95
  48. data/spec/spec_helper.rb +9 -9
  49. metadata +16 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5832d8b7e35914667cd070932413409c72ba907a9a0f66c4f371a38ad830dfe5
4
- data.tar.gz: 5a78b3c88b98268f33eac8d6992b170338334f80397145ad895a21d35d0ff042
3
+ metadata.gz: c013a4f7ffd719e32ebee5be88c3372af875f7089647f57a698974879117ac16
4
+ data.tar.gz: 5c910f390dd5bd5215b5292ae099400022a3234f413d577e12b6809b714792c1
5
5
  SHA512:
6
- metadata.gz: ad1b56c1c2b447e2f43d307477677892e0c711974611b023d88c089c7e4d27bf5e468750c930173d4d7e1bb8b32a4a85763bb34923a3358277cb1f6fa9f1e87f
7
- data.tar.gz: 301c2f12b9e4d148604d3b90d8642f7a05f17979641a9d9837f97e9dfb50bcce98776342e2f15924f14b8b54046d35905854644629d3d587ddb122d2f9735ea6
6
+ metadata.gz: da3bfde367aec9a97b9337ec09fc9451cf9455a7ac6a028e29898da0dcd055f8ec92187db0934b0d15891ebf001fd3fd8aff8c796a3fc036873b441e69b8f9c5
7
+ data.tar.gz: e4f2fc6b6036d772048847328466d66bc26f1e688c5c64f3f13f65698641521e1273a7c5dd8626e1051e29bfc867adc30dd07a2ecfe3986b7cf0b02c793718a3
@@ -1,17 +1,17 @@
1
- version: 2
2
- jobs:
3
- build:
4
- working_directory: ~/passfort
5
- docker:
6
- - image: ruby:2.5
7
- steps:
8
- - checkout
9
- - restore_cache:
10
- key: gemfile-lock-{{ checksum "Gemfile.lock" }}
11
- - run: bundle install --deployment
12
- - save_cache:
13
- key: gemfile-lock-{{ checksum "Gemfile.lock" }}
14
- paths:
15
- - "vendor/bundle"
16
- - run: bundle exec rubocop
17
- - run: bundle exec rspec --format RspecJunitFormatter
1
+ version: 2
2
+ jobs:
3
+ build:
4
+ working_directory: ~/passfort
5
+ docker:
6
+ - image: ruby:2.5
7
+ steps:
8
+ - checkout
9
+ - restore_cache:
10
+ key: gemfile-lock-{{ checksum "Gemfile.lock" }}
11
+ - run: bundle install --deployment
12
+ - save_cache:
13
+ key: gemfile-lock-{{ checksum "Gemfile.lock" }}
14
+ paths:
15
+ - "vendor/bundle"
16
+ - run: bundle exec rubocop
17
+ - run: bundle exec rspec --format RspecJunitFormatter
@@ -1,5 +1,5 @@
1
- inherit_gem:
2
- gc_ruboconfig: rubocop.yml
3
-
4
- Metrics/MethodLength:
5
- Max: 15
1
+ inherit_gem:
2
+ gc_ruboconfig: rubocop.yml
3
+
4
+ Metrics/MethodLength:
5
+ Max: 15
@@ -1 +1 @@
1
- 2.5.0
1
+ 2.5.0
@@ -1,28 +1,33 @@
1
- Changelog
2
- =========
3
-
4
- Unreleased
5
- ----------
6
-
7
- No changes.
8
-
9
- 0.2.3
10
- -----
11
-
12
- - Raise `Passfort::Errors::TimeoutError` when a request times out.
13
-
14
- 0.2.2
15
- ----------
16
-
17
- - Raise UnparsesableResponseError when the response cannot be parsed as JSON.
18
-
19
- 0.2.1
20
- -----
21
-
22
- - Include detailed error information in any raised errors.
23
-
24
- 0.2.0
25
- -----
26
-
27
- - Convert resource attributes to a hash with indifferent access,
28
- so that you can use symbol or string keys.
1
+ Changelog
2
+ =========
3
+
4
+ Unreleased
5
+ ----------
6
+
7
+ No changes.
8
+
9
+ 0.3.0
10
+ -----
11
+
12
+ - Add `ActiveSupport::Notifications` support.
13
+
14
+ 0.2.3
15
+ -----
16
+
17
+ - Raise `Passfort::Errors::TimeoutError` when a request times out.
18
+
19
+ 0.2.2
20
+ ----------
21
+
22
+ - Raise UnparsesableResponseError when the response cannot be parsed as JSON.
23
+
24
+ 0.2.1
25
+ -----
26
+
27
+ - Include detailed error information in any raised errors.
28
+
29
+ 0.2.0
30
+ -----
31
+
32
+ - Convert resource attributes to a hash with indifferent access,
33
+ so that you can use symbol or string keys.
data/Gemfile CHANGED
@@ -1,5 +1,5 @@
1
- # frozen_string_literal: true
2
-
3
- source "https://rubygems.org"
4
-
5
- gemspec
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gemspec
@@ -1,89 +1,91 @@
1
- PATH
2
- remote: .
3
- specs:
4
- passfort (0.2.3)
5
- activesupport (~> 5.0)
6
- excon (~> 0.60)
7
-
8
- GEM
9
- remote: https://rubygems.org/
10
- specs:
11
- activesupport (5.1.5)
12
- concurrent-ruby (~> 1.0, >= 1.0.2)
13
- i18n (~> 0.7)
14
- minitest (~> 5.1)
15
- tzinfo (~> 1.1)
16
- addressable (2.5.2)
17
- public_suffix (>= 2.0.2, < 4.0)
18
- ast (2.4.0)
19
- coderay (1.1.2)
20
- concurrent-ruby (1.0.5)
21
- crack (0.4.3)
22
- safe_yaml (~> 1.0.0)
23
- diff-lcs (1.3)
24
- excon (0.62.0)
25
- gc_ruboconfig (2.3.5)
26
- rubocop (~> 0.54.0)
27
- rubocop-rspec (~> 1.24)
28
- hashdiff (0.3.7)
29
- i18n (0.9.5)
30
- concurrent-ruby (~> 1.0)
31
- method_source (0.9.0)
32
- minitest (5.11.3)
33
- parallel (1.12.1)
34
- parser (2.5.0.5)
35
- ast (~> 2.4.0)
36
- powerpack (0.1.1)
37
- pry (0.11.3)
38
- coderay (~> 1.1.0)
39
- method_source (~> 0.9.0)
40
- public_suffix (3.0.2)
41
- rainbow (3.0.0)
42
- rspec (3.7.0)
43
- rspec-core (~> 3.7.0)
44
- rspec-expectations (~> 3.7.0)
45
- rspec-mocks (~> 3.7.0)
46
- rspec-core (3.7.1)
47
- rspec-support (~> 3.7.0)
48
- rspec-expectations (3.7.0)
49
- diff-lcs (>= 1.2.0, < 2.0)
50
- rspec-support (~> 3.7.0)
51
- rspec-mocks (3.7.0)
52
- diff-lcs (>= 1.2.0, < 2.0)
53
- rspec-support (~> 3.7.0)
54
- rspec-support (3.7.1)
55
- rspec_junit_formatter (0.3.0)
56
- rspec-core (>= 2, < 4, != 2.12.0)
57
- rubocop (0.54.0)
58
- parallel (~> 1.10)
59
- parser (>= 2.5)
60
- powerpack (~> 0.1)
61
- rainbow (>= 2.2.2, < 4.0)
62
- ruby-progressbar (~> 1.7)
63
- unicode-display_width (~> 1.0, >= 1.0.1)
64
- rubocop-rspec (1.24.0)
65
- rubocop (>= 0.53.0)
66
- ruby-progressbar (1.9.0)
67
- safe_yaml (1.0.4)
68
- thread_safe (0.3.6)
69
- tzinfo (1.2.5)
70
- thread_safe (~> 0.1)
71
- unicode-display_width (1.3.0)
72
- webmock (3.3.0)
73
- addressable (>= 2.3.6)
74
- crack (>= 0.3.2)
75
- hashdiff
76
-
77
- PLATFORMS
78
- ruby
79
-
80
- DEPENDENCIES
81
- gc_ruboconfig (~> 2.3)
82
- passfort!
83
- pry (~> 0.10)
84
- rspec (~> 3.2)
85
- rspec_junit_formatter (~> 0.3)
86
- webmock (~> 3.3)
87
-
88
- BUNDLED WITH
89
- 1.16.1
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ passfort (0.3.0)
5
+ activesupport (~> 5.0)
6
+ excon (~> 0.60)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ activesupport (5.1.6)
12
+ concurrent-ruby (~> 1.0, >= 1.0.2)
13
+ i18n (>= 0.7, < 2)
14
+ minitest (~> 5.1)
15
+ tzinfo (~> 1.1)
16
+ addressable (2.5.2)
17
+ public_suffix (>= 2.0.2, < 4.0)
18
+ ast (2.4.0)
19
+ coderay (1.1.2)
20
+ concurrent-ruby (1.0.5)
21
+ crack (0.4.3)
22
+ safe_yaml (~> 1.0.0)
23
+ diff-lcs (1.3)
24
+ excon (0.62.0)
25
+ gc_ruboconfig (2.3.5)
26
+ rubocop (~> 0.54.0)
27
+ rubocop-rspec (~> 1.24)
28
+ hashdiff (0.3.7)
29
+ i18n (1.0.0)
30
+ concurrent-ruby (~> 1.0)
31
+ method_source (0.9.0)
32
+ minitest (5.11.3)
33
+ parallel (1.12.1)
34
+ parser (2.5.0.5)
35
+ ast (~> 2.4.0)
36
+ powerpack (0.1.1)
37
+ pry (0.11.3)
38
+ coderay (~> 1.1.0)
39
+ method_source (~> 0.9.0)
40
+ public_suffix (3.0.2)
41
+ rainbow (3.0.0)
42
+ rspec (3.7.0)
43
+ rspec-core (~> 3.7.0)
44
+ rspec-expectations (~> 3.7.0)
45
+ rspec-mocks (~> 3.7.0)
46
+ rspec-core (3.7.1)
47
+ rspec-support (~> 3.7.0)
48
+ rspec-expectations (3.7.0)
49
+ diff-lcs (>= 1.2.0, < 2.0)
50
+ rspec-support (~> 3.7.0)
51
+ rspec-mocks (3.7.0)
52
+ diff-lcs (>= 1.2.0, < 2.0)
53
+ rspec-support (~> 3.7.0)
54
+ rspec-support (3.7.1)
55
+ rspec_junit_formatter (0.3.0)
56
+ rspec-core (>= 2, < 4, != 2.12.0)
57
+ rubocop (0.54.0)
58
+ parallel (~> 1.10)
59
+ parser (>= 2.5)
60
+ powerpack (~> 0.1)
61
+ rainbow (>= 2.2.2, < 4.0)
62
+ ruby-progressbar (~> 1.7)
63
+ unicode-display_width (~> 1.0, >= 1.0.1)
64
+ rubocop-rspec (1.24.0)
65
+ rubocop (>= 0.53.0)
66
+ ruby-progressbar (1.9.0)
67
+ safe_yaml (1.0.4)
68
+ thread_safe (0.3.6)
69
+ timecop (0.9.1)
70
+ tzinfo (1.2.5)
71
+ thread_safe (~> 0.1)
72
+ unicode-display_width (1.3.0)
73
+ webmock (3.3.0)
74
+ addressable (>= 2.3.6)
75
+ crack (>= 0.3.2)
76
+ hashdiff
77
+
78
+ PLATFORMS
79
+ ruby
80
+
81
+ DEPENDENCIES
82
+ gc_ruboconfig (~> 2.3)
83
+ passfort!
84
+ pry (~> 0.10)
85
+ rspec (~> 3.2)
86
+ rspec_junit_formatter (~> 0.3)
87
+ timecop (~> 0.8)
88
+ webmock (~> 3.3)
89
+
90
+ BUNDLED WITH
91
+ 1.16.1
@@ -1,22 +1,22 @@
1
- Copyright (c) 2018 GoCardless
2
-
3
- MIT License
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- "Software"), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1
+ Copyright (c) 2018 GoCardless
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
- PassFort
2
- ========
3
-
4
- [![CircleCI](https://circleci.com/gh/gocardless/passfort/tree/master.svg?style=svg)](https://circleci.com/gh/gocardless/passfort/tree/master)
5
-
6
- A Ruby client library for the [PassFort](https://passfort.com) API.
1
+ PassFort
2
+ ========
3
+
4
+ [![CircleCI](https://circleci.com/gh/gocardless/passfort/tree/master.svg?style=svg)](https://circleci.com/gh/gocardless/passfort/tree/master)
5
+
6
+ A Ruby client library for the [PassFort](https://passfort.com) API.
@@ -1,35 +1,35 @@
1
- # frozen_string_literal: true
2
-
3
- require "passfort/version"
4
- require "passfort/errors"
5
-
6
- require "passfort/resource"
7
- require "passfort/endpoint"
8
- require "passfort/client"
9
-
10
- module Passfort
11
- module CheckType
12
- IDENTITY_CHECK = "IDENTITY_CHECK"
13
- DOCUMENT_VERIFICATION = "DOCUMENT_VERIFICATION"
14
- DOCUMENT_FETCH = "DOCUMENT_FETCH"
15
- PEPS_SCREEN = "PEPS_SCREEN"
16
- SANCTIONS_SCREEN = "SANCTIONS_SCREEN"
17
- PEPS_AND_SANCTIONS_SCREEN = "PEPS_AND_SANCTIONS_SCREEN"
18
- COMPANY_REGISTRY = "COMPANY_REGISTRY"
19
- COMPANY_OWNERSHIP = "COMPANY_OWNERSHIP"
20
- COMPANY_FILINGS = "COMPANY_FILINGS"
21
- COMPANY_FILING_PURCHASE = "COMPANY_FILING_PURCHASE"
22
- COMPANY_PEPS_AND_SANCTIONS_SCREEN = "COMPANY_PEPS_AND_SANCTIONS_SCREEN"
23
- end
24
-
25
- module EntityType
26
- INDIVIDUAL = "INDIVIDUAL"
27
- COMPANY = "COMPANY"
28
- end
29
-
30
- module Role
31
- INDIVIDUAL_CUSTOMER = "INDIVIDUAL_CUSTOMER"
32
- INDIVIDUAL_ASSOCIATED = "INDIVIDUAL_ASSOCIATED"
33
- COMPANY_CUSTOMER = "COMPANY_CUSTOMER"
34
- end
35
- end
1
+ # frozen_string_literal: true
2
+
3
+ require "passfort/version"
4
+ require "passfort/errors"
5
+
6
+ require "passfort/resource"
7
+ require "passfort/endpoint"
8
+ require "passfort/client"
9
+
10
+ module Passfort
11
+ module CheckType
12
+ IDENTITY_CHECK = "IDENTITY_CHECK"
13
+ DOCUMENT_VERIFICATION = "DOCUMENT_VERIFICATION"
14
+ DOCUMENT_FETCH = "DOCUMENT_FETCH"
15
+ PEPS_SCREEN = "PEPS_SCREEN"
16
+ SANCTIONS_SCREEN = "SANCTIONS_SCREEN"
17
+ PEPS_AND_SANCTIONS_SCREEN = "PEPS_AND_SANCTIONS_SCREEN"
18
+ COMPANY_REGISTRY = "COMPANY_REGISTRY"
19
+ COMPANY_OWNERSHIP = "COMPANY_OWNERSHIP"
20
+ COMPANY_FILINGS = "COMPANY_FILINGS"
21
+ COMPANY_FILING_PURCHASE = "COMPANY_FILING_PURCHASE"
22
+ COMPANY_PEPS_AND_SANCTIONS_SCREEN = "COMPANY_PEPS_AND_SANCTIONS_SCREEN"
23
+ end
24
+
25
+ module EntityType
26
+ INDIVIDUAL = "INDIVIDUAL"
27
+ COMPANY = "COMPANY"
28
+ end
29
+
30
+ module Role
31
+ INDIVIDUAL_CUSTOMER = "INDIVIDUAL_CUSTOMER"
32
+ INDIVIDUAL_ASSOCIATED = "INDIVIDUAL_ASSOCIATED"
33
+ COMPANY_CUSTOMER = "COMPANY_CUSTOMER"
34
+ end
35
+ end