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
@@ -1,9 +1,9 @@
1
- # frozen_string_literal: true
2
-
3
- module Passfort
4
- module Resource
5
- class Task < Base
6
- attributes :id, :type, :is_complete, :is_expired, :check_ids
7
- end
8
- end
9
- end
1
+ # frozen_string_literal: true
2
+
3
+ module Passfort
4
+ module Resource
5
+ class Task < Base
6
+ attributes :id, :type, :is_complete, :is_expired, :check_ids
7
+ end
8
+ end
9
+ end
@@ -1,5 +1,5 @@
1
- # frozen_string_literal: true
2
-
3
- module Passfort
4
- VERSION = "0.4.1"
5
- end
1
+ # frozen_string_literal: true
2
+
3
+ module Passfort
4
+ VERSION = "0.4.2"
5
+ end
data/passfort.gemspec CHANGED
@@ -1,30 +1,30 @@
1
- # frozen_string_literal: true
2
-
3
- lib = File.expand_path("lib", __dir__)
4
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
-
6
- require "passfort/version"
7
-
8
- Gem::Specification.new do |spec|
9
- spec.name = "passfort"
10
- spec.version = Passfort::VERSION
11
- spec.summary = "Client for the PassFort API"
12
- spec.authors = %w[GoCardless]
13
- spec.homepage = "https://github.com/gocardless/passfort"
14
- spec.email = %w[developers@gocardless.com]
15
- spec.license = "MIT"
16
-
17
- spec.files = `git ls-files -z`.split("\x0")
18
- spec.test_files = spec.files.grep(%r{^spec/})
19
- spec.require_paths = ["lib"]
20
-
21
- spec.add_dependency "activesupport", "~> 5.0"
22
- spec.add_dependency "excon", "~> 0.60"
23
-
24
- spec.add_development_dependency "gc_ruboconfig", "~> 2.3"
25
- spec.add_development_dependency "pry", "~> 0.10"
26
- spec.add_development_dependency "rspec", "~> 3.2"
27
- spec.add_development_dependency "rspec_junit_formatter", "~> 0.3"
28
- spec.add_development_dependency "timecop", "~> 0.8"
29
- spec.add_development_dependency "webmock", "~> 3.3"
30
- end
1
+ # frozen_string_literal: true
2
+
3
+ lib = File.expand_path("lib", __dir__)
4
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
+
6
+ require "passfort/version"
7
+
8
+ Gem::Specification.new do |spec|
9
+ spec.name = "passfort"
10
+ spec.version = Passfort::VERSION
11
+ spec.summary = "Client for the PassFort API"
12
+ spec.authors = %w[GoCardless]
13
+ spec.homepage = "https://github.com/gocardless/passfort"
14
+ spec.email = %w[developers@gocardless.com]
15
+ spec.license = "MIT"
16
+
17
+ spec.files = `git ls-files -z`.split("\x0")
18
+ spec.test_files = spec.files.grep(%r{^spec/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_dependency "activesupport", ">= 5.0"
22
+ spec.add_dependency "excon", "~> 0.60"
23
+
24
+ spec.add_development_dependency "gc_ruboconfig", "~> 2.3"
25
+ spec.add_development_dependency "pry", "~> 0.10"
26
+ spec.add_development_dependency "rspec", "~> 3.2"
27
+ spec.add_development_dependency "rspec_junit_formatter", "~> 0.3"
28
+ spec.add_development_dependency "timecop", "~> 0.8"
29
+ spec.add_development_dependency "webmock", "~> 3.3"
30
+ end
@@ -1,67 +1,67 @@
1
- {
2
- "check_type": "IDENTITY_CHECK",
3
- "errors": [],
4
- "id": "6c1d594a-496e-11e7-911e-acbc32b67d7b",
5
- "input_data": {
6
- "address_history": [
7
- {
8
- "address": {
9
- "country": "Southend-on-Sea",
10
- "locality": "Southend-on-Sea",
11
- "postal_code": "1",
12
- "postal_town": "Leigh-on-Sea",
13
- "route": "The Fairway",
14
- "state_province": "England",
15
- "street_number": "106",
16
- "type": "STRUCTURED"
17
- },
18
- "end_date": "2017-05",
19
- "start_date": "2017-01"
20
- }
21
- ],
22
- "entity_type": "INDIVIDUAL",
23
- "personal_details": {
24
- "dob": "1987-01-01",
25
- "name": {
26
- "family_name": "Smith",
27
- "given_names": [
28
- "Thomas"
29
- ]
30
- }
31
- }
32
- },
33
- "output_data": {
34
- "credit_ref": {
35
- "exact": {
36
- "count": 8,
37
- "match": true
38
- },
39
- "exact_dob": {
40
- "count": 8,
41
- "match": true
42
- },
43
- "partial": {
44
- "count": 8,
45
- "match": true
46
- }
47
- },
48
- "db_matches": {
49
- "electoral_exact": {
50
- "count": 1,
51
- "match": true
52
- },
53
- "electoral_exact_dob": {
54
- "count": 0,
55
- "match": false
56
- },
57
- "electoral_partial": {
58
- "count": 1,
59
- "match": true
60
- }
61
- },
62
- "entity_type": "INDIVIDUAL"
63
- },
64
- "result": "2+2",
65
- "state": "COMPLETE",
66
- "task_ids": []
67
- }
1
+ {
2
+ "check_type": "IDENTITY_CHECK",
3
+ "errors": [],
4
+ "id": "6c1d594a-496e-11e7-911e-acbc32b67d7b",
5
+ "input_data": {
6
+ "address_history": [
7
+ {
8
+ "address": {
9
+ "country": "Southend-on-Sea",
10
+ "locality": "Southend-on-Sea",
11
+ "postal_code": "1",
12
+ "postal_town": "Leigh-on-Sea",
13
+ "route": "The Fairway",
14
+ "state_province": "England",
15
+ "street_number": "106",
16
+ "type": "STRUCTURED"
17
+ },
18
+ "end_date": "2017-05",
19
+ "start_date": "2017-01"
20
+ }
21
+ ],
22
+ "entity_type": "INDIVIDUAL",
23
+ "personal_details": {
24
+ "dob": "1987-01-01",
25
+ "name": {
26
+ "family_name": "Smith",
27
+ "given_names": [
28
+ "Thomas"
29
+ ]
30
+ }
31
+ }
32
+ },
33
+ "output_data": {
34
+ "credit_ref": {
35
+ "exact": {
36
+ "count": 8,
37
+ "match": true
38
+ },
39
+ "exact_dob": {
40
+ "count": 8,
41
+ "match": true
42
+ },
43
+ "partial": {
44
+ "count": 8,
45
+ "match": true
46
+ }
47
+ },
48
+ "db_matches": {
49
+ "electoral_exact": {
50
+ "count": 1,
51
+ "match": true
52
+ },
53
+ "electoral_exact_dob": {
54
+ "count": 0,
55
+ "match": false
56
+ },
57
+ "electoral_partial": {
58
+ "count": 1,
59
+ "match": true
60
+ }
61
+ },
62
+ "entity_type": "INDIVIDUAL"
63
+ },
64
+ "result": "2+2",
65
+ "state": "COMPLETE",
66
+ "task_ids": []
67
+ }
@@ -1,7 +1,7 @@
1
- {
2
- "entity_type": "COMPANY",
3
- "metadata": {
4
- "country_of_incorporation": "GBR",
5
- "number": "09565115"
6
- }
7
- }
1
+ {
2
+ "entity_type": "COMPANY",
3
+ "metadata": {
4
+ "country_of_incorporation": "GBR",
5
+ "number": "09565115"
6
+ }
7
+ }
@@ -1,19 +1,19 @@
1
- {
2
- "companies": [
3
- {
4
- "country": "GBR",
5
- "name": "GOCARDLESS LTD",
6
- "number": "07495895"
7
- },
8
- {
9
- "country": "GBR",
10
- "name": "GO CARD LIMITED",
11
- "number": "07269277"
12
- },
13
- {
14
- "country": "GBR",
15
- "name": "GO CAR DIRECT LTD",
16
- "number": "10333984"
17
- }
18
- ]
1
+ {
2
+ "companies": [
3
+ {
4
+ "country": "GBR",
5
+ "name": "GOCARDLESS LTD",
6
+ "number": "07495895"
7
+ },
8
+ {
9
+ "country": "GBR",
10
+ "name": "GO CARD LIMITED",
11
+ "number": "07269277"
12
+ },
13
+ {
14
+ "country": "GBR",
15
+ "name": "GO CAR DIRECT LTD",
16
+ "number": "10333984"
17
+ }
18
+ ]
19
19
  }
@@ -1,78 +1,78 @@
1
- {
2
- "check_type": "COMPANY_OWNERSHIP",
3
- "errors": [],
4
- "id": "30e4ea06-0519-11e8-000000000000",
5
- "input_data": {
6
- "entity_type": "COMPANY",
7
- "metadata": {
8
- "country_of_incorporation": "GBR",
9
- "number": "09565115"
10
- }
11
- },
12
- "output_data": {
13
- "entity_type": "COMPANY",
14
- "metadata": {},
15
- "ownership_structure": {
16
- "shareholders": [
17
- {
18
- "entity_type": "INDIVIDUAL",
19
- "immediate_data": {
20
- "address_history": [],
21
- "entity_type": "INDIVIDUAL",
22
- "personal_details": {
23
- "name": {
24
- "family_name": "Gillies",
25
- "given_names": [
26
- "Donald"
27
- ]
28
- }
29
- }
30
- },
31
- "provider_name": "DueDil",
32
- "resolver_id": "322d0f54-0519-11e8-914c-000000000000",
33
- "shareholdings": [
34
- {
35
- "amount": 100,
36
- "currency": "GBP",
37
- "percentage": 50,
38
- "share_class": "Ordinary"
39
- }
40
- ],
41
- "total_percentage": 50
42
- },
43
- {
44
- "entity_type": "INDIVIDUAL",
45
- "immediate_data": {
46
- "address_history": [],
47
- "entity_type": "INDIVIDUAL",
48
- "personal_details": {
49
- "name": {
50
- "family_name": "Irish",
51
- "given_names": [
52
- "Henry"
53
- ]
54
- }
55
- }
56
- },
57
- "provider_name": "DueDil",
58
- "resolver_id": "322d1f9e-0519-11e8-b046-000000000000",
59
- "shareholdings": [
60
- {
61
- "amount": 100,
62
- "currency": "GBP",
63
- "percentage": 50,
64
- "share_class": "Ordinary"
65
- }
66
- ],
67
- "total_percentage": 50
68
- }
69
- ]
70
- }
71
- },
72
- "performed_on": "2018-01-29 17:24:01",
73
- "result": "Pass",
74
- "state": "COMPLETE",
75
- "task_ids": [
76
- "b845e7f4-f9e8-11e7-a4d1-000000000000"
77
- ]
78
- }
1
+ {
2
+ "check_type": "COMPANY_OWNERSHIP",
3
+ "errors": [],
4
+ "id": "30e4ea06-0519-11e8-000000000000",
5
+ "input_data": {
6
+ "entity_type": "COMPANY",
7
+ "metadata": {
8
+ "country_of_incorporation": "GBR",
9
+ "number": "09565115"
10
+ }
11
+ },
12
+ "output_data": {
13
+ "entity_type": "COMPANY",
14
+ "metadata": {},
15
+ "ownership_structure": {
16
+ "shareholders": [
17
+ {
18
+ "entity_type": "INDIVIDUAL",
19
+ "immediate_data": {
20
+ "address_history": [],
21
+ "entity_type": "INDIVIDUAL",
22
+ "personal_details": {
23
+ "name": {
24
+ "family_name": "Gillies",
25
+ "given_names": [
26
+ "Donald"
27
+ ]
28
+ }
29
+ }
30
+ },
31
+ "provider_name": "DueDil",
32
+ "resolver_id": "322d0f54-0519-11e8-914c-000000000000",
33
+ "shareholdings": [
34
+ {
35
+ "amount": 100,
36
+ "currency": "GBP",
37
+ "percentage": 50,
38
+ "share_class": "Ordinary"
39
+ }
40
+ ],
41
+ "total_percentage": 50
42
+ },
43
+ {
44
+ "entity_type": "INDIVIDUAL",
45
+ "immediate_data": {
46
+ "address_history": [],
47
+ "entity_type": "INDIVIDUAL",
48
+ "personal_details": {
49
+ "name": {
50
+ "family_name": "Irish",
51
+ "given_names": [
52
+ "Henry"
53
+ ]
54
+ }
55
+ }
56
+ },
57
+ "provider_name": "DueDil",
58
+ "resolver_id": "322d1f9e-0519-11e8-b046-000000000000",
59
+ "shareholdings": [
60
+ {
61
+ "amount": 100,
62
+ "currency": "GBP",
63
+ "percentage": 50,
64
+ "share_class": "Ordinary"
65
+ }
66
+ ],
67
+ "total_percentage": 50
68
+ }
69
+ ]
70
+ }
71
+ },
72
+ "performed_on": "2018-01-29 17:24:01",
73
+ "result": "Pass",
74
+ "state": "COMPLETE",
75
+ "task_ids": [
76
+ "b845e7f4-f9e8-11e7-a4d1-000000000000"
77
+ ]
78
+ }
@@ -1,7 +1,7 @@
1
- {
2
- "entity_type": "COMPANY",
3
- "metadata": {
4
- "country_of_incorporation": "GBR",
5
- "number": "09565115"
6
- }
7
- }
1
+ {
2
+ "entity_type": "COMPANY",
3
+ "metadata": {
4
+ "country_of_incorporation": "GBR",
5
+ "number": "09565115"
6
+ }
7
+ }