passfort 0.4.1 → 0.4.2

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 (53) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +17 -17
  3. data/.rubocop.yml +8 -8
  4. data/.ruby-version +1 -1
  5. data/CHANGELOG.md +53 -48
  6. data/Gemfile +5 -5
  7. data/Gemfile.lock +95 -93
  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 +35 -35
  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 +16 -16
  17. data/lib/passfort/errors/api_error.rb +16 -16
  18. data/lib/passfort/errors/bad_gateway_error.rb +12 -12
  19. data/lib/passfort/errors/chargeable_limit_reached_error.rb +12 -12
  20. data/lib/passfort/errors/invalid_api_key_error.rb +12 -12
  21. data/lib/passfort/errors/invalid_input_data_error.rb +12 -12
  22. data/lib/passfort/errors/request_error.rb +12 -12
  23. data/lib/passfort/errors/timeout_error.rb +12 -12
  24. data/lib/passfort/errors/unknown_api_error.rb +12 -12
  25. data/lib/passfort/errors/unparseable_response_error.rb +11 -11
  26. data/lib/passfort/http.rb +95 -95
  27. data/lib/passfort/resource.rb +13 -13
  28. data/lib/passfort/resource/base.rb +21 -21
  29. data/lib/passfort/resource/check.rb +10 -10
  30. data/lib/passfort/resource/company_data.rb +11 -11
  31. data/lib/passfort/resource/company_summary.rb +9 -9
  32. data/lib/passfort/resource/individual_data.rb +11 -11
  33. data/lib/passfort/resource/profile.rb +15 -15
  34. data/lib/passfort/resource/task.rb +9 -9
  35. data/lib/passfort/version.rb +5 -5
  36. data/passfort.gemspec +30 -30
  37. data/spec/fixtures/check.json +67 -67
  38. data/spec/fixtures/collected_data.json +7 -7
  39. data/spec/fixtures/companies.json +18 -18
  40. data/spec/fixtures/company_ownership_check/check.json +78 -78
  41. data/spec/fixtures/company_ownership_check/collected_data.json +7 -7
  42. data/spec/fixtures/company_ownership_check/collected_data_update_request.json +63 -63
  43. data/spec/fixtures/company_ownership_check/profile.json +128 -128
  44. data/spec/fixtures/profile.json +128 -128
  45. data/spec/fixtures/task.json +6 -6
  46. data/spec/integration/company_ownership_check_spec.rb +74 -74
  47. data/spec/passfort/client_spec.rb +43 -43
  48. data/spec/passfort/endpoint/checks_spec.rb +22 -22
  49. data/spec/passfort/endpoint/profiles_spec.rb +79 -79
  50. data/spec/passfort/endpoint/tasks_spec.rb +21 -21
  51. data/spec/passfort/http_spec.rb +167 -167
  52. data/spec/spec_helper.rb +9 -9
  53. metadata +5 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 11ea8f8190854086192759bf2d52c6e56394e9f2c81dbdb85b9762c75e57604a
4
- data.tar.gz: ba26cd625775ade293582c72681313f0c52933e52b82ed945ae6c03ce7585fe6
3
+ metadata.gz: 11bc30dad98c2b60b6c272eee5f48556989e88db71b5e915617678472c2c271e
4
+ data.tar.gz: '088281bd1522c13cd0df32fd7c4a6f8321005fa1ef56e5b2640882ab4119b17b'
5
5
  SHA512:
6
- metadata.gz: 9ebb366bcfe48b0d04ea6eb0932b55338e08df4ea9146b1562e0b0c1fbad9be840699ba48b03258a019d5f6123329a6f3a92210e1bce75f26c45c479fa9cc0ce
7
- data.tar.gz: b33a0a9f873906adea43ab81b90fe0d09304081b4895c89b0bcb4e61f79b426de09c9f2536d2ac78e2716392559c533302535504b0e2e8aec20f35f1d0856cc1
6
+ metadata.gz: baf78917a324ecaa99403307123268f6f9046ab872e5eeaa6c531fc5828ae1cbb1080566c153618baf6d03a421e263c0f73029a396841ea439a253b2444bc2f5
7
+ data.tar.gz: bb667e105ee76cf67765a376d752b5f95a9664fec53491d3cdcd9335c8122706b285b542ee2223ede9761300e14f358f6a4d6d1202cd4bf57d6a54f5002456bf
data/.circleci/config.yml CHANGED
@@ -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
data/.rubocop.yml CHANGED
@@ -1,8 +1,8 @@
1
- inherit_gem:
2
- gc_ruboconfig: rubocop.yml
3
-
4
- Metrics/AbcSize:
5
- Max: 17
6
-
7
- Metrics/MethodLength:
8
- Max: 17
1
+ inherit_gem:
2
+ gc_ruboconfig: rubocop.yml
3
+
4
+ Metrics/AbcSize:
5
+ Max: 17
6
+
7
+ Metrics/MethodLength:
8
+ Max: 17
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.5.0
1
+ 2.5.0
data/CHANGELOG.md CHANGED
@@ -1,48 +1,53 @@
1
- Changelog
2
- =========
3
-
4
- Unreleased
5
- ----------
6
-
7
- No changes.
8
-
9
- 0.4.1
10
- -----
11
-
12
- - Treat Bad Gateway (502) errors separately
13
-
14
- 0.4.0
15
- -----
16
-
17
- - Add `company_search` functionality
18
-
19
- 0.3.1
20
- -----
21
-
22
- - Allow setting connection properties
23
-
24
- 0.3.0
25
- -----
26
-
27
- - Add `ActiveSupport::Notifications` support.
28
-
29
- 0.2.3
30
- -----
31
-
32
- - Raise `Passfort::Errors::TimeoutError` when a request times out.
33
-
34
- 0.2.2
35
- ----------
36
-
37
- - Raise UnparsesableResponseError when the response cannot be parsed as JSON.
38
-
39
- 0.2.1
40
- -----
41
-
42
- - Include detailed error information in any raised errors.
43
-
44
- 0.2.0
45
- -----
46
-
47
- - Convert resource attributes to a hash with indifferent access,
48
- so that you can use symbol or string keys.
1
+ Changelog
2
+ =========
3
+
4
+ Unreleased
5
+ ----------
6
+
7
+ No changes.
8
+
9
+ 0.4.2
10
+ -----
11
+
12
+ - Add Rails 6 compatibility
13
+
14
+ 0.4.1
15
+ -----
16
+
17
+ - Treat Bad Gateway (502) errors separately
18
+
19
+ 0.4.0
20
+ -----
21
+
22
+ - Add `company_search` functionality
23
+
24
+ 0.3.1
25
+ -----
26
+
27
+ - Allow setting connection properties
28
+
29
+ 0.3.0
30
+ -----
31
+
32
+ - Add `ActiveSupport::Notifications` support.
33
+
34
+ 0.2.3
35
+ -----
36
+
37
+ - Raise `Passfort::Errors::TimeoutError` when a request times out.
38
+
39
+ 0.2.2
40
+ ----------
41
+
42
+ - Raise UnparsesableResponseError when the response cannot be parsed as JSON.
43
+
44
+ 0.2.1
45
+ -----
46
+
47
+ - Include detailed error information in any raised errors.
48
+
49
+ 0.2.0
50
+ -----
51
+
52
+ - Convert resource attributes to a hash with indifferent access,
53
+ 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
data/Gemfile.lock CHANGED
@@ -1,93 +1,95 @@
1
- PATH
2
- remote: .
3
- specs:
4
- passfort (0.4.1)
5
- activesupport (~> 5.0)
6
- excon (~> 0.60)
7
-
8
- GEM
9
- remote: https://rubygems.org/
10
- specs:
11
- activesupport (5.2.2)
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.1.3)
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.14)
26
- rubocop (>= 0.57, < 0.62)
27
- rubocop-rspec (~> 1.25)
28
- hashdiff (0.3.8)
29
- i18n (1.1.1)
30
- concurrent-ruby (~> 1.0)
31
- jaro_winkler (1.5.1)
32
- method_source (0.9.2)
33
- minitest (5.11.3)
34
- parallel (1.12.1)
35
- parser (2.5.3.0)
36
- ast (~> 2.4.0)
37
- powerpack (0.1.2)
38
- pry (0.12.2)
39
- coderay (~> 1.1.0)
40
- method_source (~> 0.9.0)
41
- public_suffix (3.0.3)
42
- rainbow (3.0.0)
43
- rspec (3.8.0)
44
- rspec-core (~> 3.8.0)
45
- rspec-expectations (~> 3.8.0)
46
- rspec-mocks (~> 3.8.0)
47
- rspec-core (3.8.0)
48
- rspec-support (~> 3.8.0)
49
- rspec-expectations (3.8.0)
50
- diff-lcs (>= 1.2.0, < 2.0)
51
- rspec-support (~> 3.8.0)
52
- rspec-mocks (3.8.0)
53
- diff-lcs (>= 1.2.0, < 2.0)
54
- rspec-support (~> 3.8.0)
55
- rspec-support (3.8.0)
56
- rspec_junit_formatter (0.4.1)
57
- rspec-core (>= 2, < 4, != 2.12.0)
58
- rubocop (0.61.1)
59
- jaro_winkler (~> 1.5.1)
60
- parallel (~> 1.10)
61
- parser (>= 2.5, != 2.5.1.1)
62
- powerpack (~> 0.1)
63
- rainbow (>= 2.2.2, < 4.0)
64
- ruby-progressbar (~> 1.7)
65
- unicode-display_width (~> 1.4.0)
66
- rubocop-rspec (1.30.1)
67
- rubocop (>= 0.60.0)
68
- ruby-progressbar (1.10.0)
69
- safe_yaml (1.0.4)
70
- thread_safe (0.3.6)
71
- timecop (0.9.1)
72
- tzinfo (1.2.5)
73
- thread_safe (~> 0.1)
74
- unicode-display_width (1.4.1)
75
- webmock (3.5.1)
76
- addressable (>= 2.3.6)
77
- crack (>= 0.3.2)
78
- hashdiff
79
-
80
- PLATFORMS
81
- ruby
82
-
83
- DEPENDENCIES
84
- gc_ruboconfig (~> 2.3)
85
- passfort!
86
- pry (~> 0.10)
87
- rspec (~> 3.2)
88
- rspec_junit_formatter (~> 0.3)
89
- timecop (~> 0.8)
90
- webmock (~> 3.3)
91
-
92
- BUNDLED WITH
93
- 1.16.1
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ passfort (0.4.2)
5
+ activesupport (>= 5.0)
6
+ excon (~> 0.60)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ activesupport (6.0.1)
12
+ concurrent-ruby (~> 1.0, >= 1.0.2)
13
+ i18n (>= 0.7, < 2)
14
+ minitest (~> 5.1)
15
+ tzinfo (~> 1.1)
16
+ zeitwerk (~> 2.2)
17
+ addressable (2.7.0)
18
+ public_suffix (>= 2.0.2, < 5.0)
19
+ ast (2.4.0)
20
+ coderay (1.1.2)
21
+ concurrent-ruby (1.1.5)
22
+ crack (0.4.3)
23
+ safe_yaml (~> 1.0.0)
24
+ diff-lcs (1.3)
25
+ excon (0.70.0)
26
+ gc_ruboconfig (2.3.14)
27
+ rubocop (>= 0.57, < 0.62)
28
+ rubocop-rspec (~> 1.25)
29
+ hashdiff (1.0.0)
30
+ i18n (1.7.0)
31
+ concurrent-ruby (~> 1.0)
32
+ jaro_winkler (1.5.1)
33
+ method_source (0.9.2)
34
+ minitest (5.13.0)
35
+ parallel (1.12.1)
36
+ parser (2.5.3.0)
37
+ ast (~> 2.4.0)
38
+ powerpack (0.1.2)
39
+ pry (0.12.2)
40
+ coderay (~> 1.1.0)
41
+ method_source (~> 0.9.0)
42
+ public_suffix (4.0.1)
43
+ rainbow (3.0.0)
44
+ rspec (3.8.0)
45
+ rspec-core (~> 3.8.0)
46
+ rspec-expectations (~> 3.8.0)
47
+ rspec-mocks (~> 3.8.0)
48
+ rspec-core (3.8.0)
49
+ rspec-support (~> 3.8.0)
50
+ rspec-expectations (3.8.0)
51
+ diff-lcs (>= 1.2.0, < 2.0)
52
+ rspec-support (~> 3.8.0)
53
+ rspec-mocks (3.8.0)
54
+ diff-lcs (>= 1.2.0, < 2.0)
55
+ rspec-support (~> 3.8.0)
56
+ rspec-support (3.8.0)
57
+ rspec_junit_formatter (0.4.1)
58
+ rspec-core (>= 2, < 4, != 2.12.0)
59
+ rubocop (0.61.1)
60
+ jaro_winkler (~> 1.5.1)
61
+ parallel (~> 1.10)
62
+ parser (>= 2.5, != 2.5.1.1)
63
+ powerpack (~> 0.1)
64
+ rainbow (>= 2.2.2, < 4.0)
65
+ ruby-progressbar (~> 1.7)
66
+ unicode-display_width (~> 1.4.0)
67
+ rubocop-rspec (1.30.1)
68
+ rubocop (>= 0.60.0)
69
+ ruby-progressbar (1.10.0)
70
+ safe_yaml (1.0.5)
71
+ thread_safe (0.3.6)
72
+ timecop (0.9.1)
73
+ tzinfo (1.2.5)
74
+ thread_safe (~> 0.1)
75
+ unicode-display_width (1.4.1)
76
+ webmock (3.7.2)
77
+ addressable (>= 2.3.6)
78
+ crack (>= 0.3.2)
79
+ hashdiff (>= 0.4.0, < 2.0.0)
80
+ zeitwerk (2.2.2)
81
+
82
+ PLATFORMS
83
+ ruby
84
+
85
+ DEPENDENCIES
86
+ gc_ruboconfig (~> 2.3)
87
+ passfort!
88
+ pry (~> 0.10)
89
+ rspec (~> 3.2)
90
+ rspec_junit_formatter (~> 0.3)
91
+ timecop (~> 0.8)
92
+ webmock (~> 3.3)
93
+
94
+ BUNDLED WITH
95
+ 1.17.3
data/LICENCE.txt CHANGED
@@ -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.
data/lib/passfort.rb CHANGED
@@ -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