creditsafe 0.6.2 → 0.6.3
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.
- checksums.yaml +4 -4
- data/.circleci/config.yml +17 -17
- data/.gitignore +4 -3
- data/.rspec +1 -1
- data/.rubocop.yml +14 -11
- data/.ruby-version +1 -1
- data/CHANGELOG.md +57 -53
- data/Gemfile +5 -5
- data/LICENSE.txt +22 -22
- data/README.md +175 -175
- data/creditsafe.gemspec +34 -35
- data/data/creditsafe-live.xml +342 -342
- data/data/creditsafe-test.xml +342 -342
- data/lib/creditsafe.rb +4 -4
- data/lib/creditsafe/client.rb +165 -165
- data/lib/creditsafe/constants.rb +49 -49
- data/lib/creditsafe/errors.rb +17 -17
- data/lib/creditsafe/match_type.rb +115 -115
- data/lib/creditsafe/messages.rb +98 -98
- data/lib/creditsafe/namespace.rb +20 -20
- data/lib/creditsafe/request/company_report.rb +42 -42
- data/lib/creditsafe/request/find_company.rb +120 -120
- data/lib/creditsafe/version.rb +5 -5
- data/spec/creditsafe/client_spec.rb +431 -431
- data/spec/creditsafe/messages_spec.rb +76 -76
- data/spec/fixtures/company-report-not-found.xml +13 -13
- data/spec/fixtures/company-report-request.xml +1 -1
- data/spec/fixtures/company-report-successful.xml +582 -582
- data/spec/fixtures/error-fault.xml +8 -8
- data/spec/fixtures/error-invalid-credentials.html +31 -31
- data/spec/fixtures/find-companies-error-no-text.xml +11 -11
- data/spec/fixtures/find-companies-error.xml +11 -11
- data/spec/fixtures/find-companies-none-found.xml +13 -13
- data/spec/fixtures/find-companies-request.xml +1 -1
- data/spec/fixtures/find-companies-successful-multi.xml +493 -493
- data/spec/fixtures/find-companies-successful.xml +29 -29
- data/spec/spec_helper.rb +14 -14
- metadata +39 -40
- data/Gemfile.lock +0 -129
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e5e6b555edb6131078c45308e06860adbfb18afdf8326eccedf0e3b40bf12d32
|
4
|
+
data.tar.gz: 04e6caab6be667db17b3d2f0dea79c610b2b3e2972066cdbb0d97fdbaf65b9d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd71392a827914caf224daf0d4d4f7b5b99628e7f08679e93cdea57ab2d91893931cd0942b8c8fc1f5e0b2942cd375193fb80d883f41068cdc24871148e38ab0
|
7
|
+
data.tar.gz: 4f430154fc5c8d6414426f92f75b09dc340bd9506abd9899cd7711eaeda28aaf4f98ce4f5a0ace1758e11bcc024bf93c7207f97ff8a1a448d2a187af4fdcba89
|
data/.circleci/config.yml
CHANGED
@@ -1,17 +1,17 @@
|
|
1
|
-
version: 2
|
2
|
-
jobs:
|
3
|
-
build:
|
4
|
-
working_directory: ~/creditsafe-ruby
|
5
|
-
docker:
|
6
|
-
- image: ruby:2.5
|
7
|
-
steps:
|
8
|
-
- checkout
|
9
|
-
- restore_cache:
|
10
|
-
key:
|
11
|
-
- run: bundle install --path vendor/bundle
|
12
|
-
- save_cache:
|
13
|
-
key:
|
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: ~/creditsafe-ruby
|
5
|
+
docker:
|
6
|
+
- image: ruby:2.5
|
7
|
+
steps:
|
8
|
+
- checkout
|
9
|
+
- restore_cache:
|
10
|
+
key: bundler-v1-{{ checksum "creditsafe.gemspec" }}-{{ checksum ".ruby-version" }}
|
11
|
+
- run: bundle install --path vendor/bundle
|
12
|
+
- save_cache:
|
13
|
+
key: bundler-v1-{{ checksum "creditsafe.gemspec" }}-{{ checksum ".ruby-version" }}
|
14
|
+
paths:
|
15
|
+
- "vendor/bundle"
|
16
|
+
- run: bundle exec rubocop
|
17
|
+
- run: bundle exec rspec --format RspecJunitFormatter
|
data/.gitignore
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
-
.bundle/
|
2
|
-
bin/
|
3
|
-
*.gem
|
1
|
+
.bundle/
|
2
|
+
bin/
|
3
|
+
*.gem
|
4
|
+
Gemfile.lock
|
data/.rspec
CHANGED
@@ -1 +1 @@
|
|
1
|
-
--color
|
1
|
+
--color
|
data/.rubocop.yml
CHANGED
@@ -1,11 +1,14 @@
|
|
1
|
-
inherit_gem:
|
2
|
-
gc_ruboconfig: rubocop.yml
|
3
|
-
|
4
|
-
RSpec/NestedGroups:
|
5
|
-
Max: 5
|
6
|
-
|
7
|
-
RSpec/ExampleLength:
|
8
|
-
Max: 20
|
9
|
-
|
10
|
-
RSpec/MultipleExpectations:
|
11
|
-
Max: 2
|
1
|
+
inherit_gem:
|
2
|
+
gc_ruboconfig: rubocop.yml
|
3
|
+
|
4
|
+
RSpec/NestedGroups:
|
5
|
+
Max: 5
|
6
|
+
|
7
|
+
RSpec/ExampleLength:
|
8
|
+
Max: 20
|
9
|
+
|
10
|
+
RSpec/MultipleExpectations:
|
11
|
+
Max: 2
|
12
|
+
|
13
|
+
RSpec/ImplicitBlockExpectation:
|
14
|
+
Enabled: false
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.5.
|
1
|
+
2.5.6
|
data/CHANGELOG.md
CHANGED
@@ -1,53 +1,57 @@
|
|
1
|
-
## v0.6.
|
2
|
-
|
3
|
-
-
|
4
|
-
|
5
|
-
## v0.6.
|
6
|
-
|
7
|
-
-
|
8
|
-
|
9
|
-
## v0.6.
|
10
|
-
|
11
|
-
-
|
12
|
-
|
13
|
-
## v0.
|
14
|
-
|
15
|
-
-
|
16
|
-
|
17
|
-
## v0.5.
|
18
|
-
|
19
|
-
-
|
20
|
-
|
21
|
-
## v0.5.
|
22
|
-
|
23
|
-
-
|
24
|
-
|
25
|
-
## v0.
|
26
|
-
|
27
|
-
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
-
|
39
|
-
|
40
|
-
## v0.3.
|
41
|
-
|
42
|
-
-
|
43
|
-
|
44
|
-
## v0.
|
45
|
-
|
46
|
-
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
1
|
+
## v0.6.3, 18 December 2019
|
2
|
+
|
3
|
+
- Update dependencies: excon
|
4
|
+
|
5
|
+
## v0.6.2, 4 January 2019
|
6
|
+
|
7
|
+
- Treat Bad Gateway (502) errors separately
|
8
|
+
|
9
|
+
## v0.6.1, 6 November 2018
|
10
|
+
|
11
|
+
- Update dependencies: activesupport, nokogiri, pry, rack
|
12
|
+
|
13
|
+
## v0.6.0, 25 September 2018
|
14
|
+
|
15
|
+
- Add searching by VAT number
|
16
|
+
|
17
|
+
## v0.5.2, 29 March 2018
|
18
|
+
|
19
|
+
- Raise `Creditsafe::TimeoutError` when a request times out
|
20
|
+
|
21
|
+
## v0.5.1, 1 March 2018
|
22
|
+
|
23
|
+
- Update allowed MatchTypes for some geos to reflect real world tests
|
24
|
+
|
25
|
+
## v0.5.0, 27 February 2018
|
26
|
+
|
27
|
+
- Automatically chooses a valid MatchType when searching for companies by name
|
28
|
+
|
29
|
+
## v0.4.0, 3 April 2017
|
30
|
+
|
31
|
+
- Adds support for including a postal code when searching for German companies by name
|
32
|
+
(@manojapr)
|
33
|
+
|
34
|
+
## v0.3.2, 27 February 2017
|
35
|
+
|
36
|
+
- Adds support for using Creditsafe's test environment, specified when instantiating the
|
37
|
+
client, as well as customising the log level used by the Savon SOAP client
|
38
|
+
- Adds support for finding companies in Germany by name, as well as company number
|
39
|
+
|
40
|
+
## v0.3.1, 6 January 2017
|
41
|
+
|
42
|
+
- Suppress password when inspecting client
|
43
|
+
|
44
|
+
## v0.3.0, 4 August 2016
|
45
|
+
|
46
|
+
- Add instrumentation to SOAP requests
|
47
|
+
|
48
|
+
## v0.2.0, 16 March 2016
|
49
|
+
|
50
|
+
- Subclass `ApiError` to distinguish between different Creditsafe error types
|
51
|
+
(patch by [greysteil](https://github.com/greysteil))
|
52
|
+
|
53
|
+
|
54
|
+
## v0.1.1, 15 February 2016
|
55
|
+
|
56
|
+
- Allow `city` parameter in `find_company` for German company lookups
|
57
|
+
(patch by [greysteil](https://github.com/greysteil))
|
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/LICENSE.txt
CHANGED
@@ -1,22 +1,22 @@
|
|
1
|
-
Copyright (c) 2017 GoCardless Ltd
|
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) 2017 GoCardless Ltd
|
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,175 +1,175 @@
|
|
1
|
-
# creditsafe-ruby
|
2
|
-
|
3
|
-
*Build status: [](https://circleci.com/gh/gocardless/creditsafe-ruby)*
|
4
|
-
|
5
|
-
A ruby library for interacting with the
|
6
|
-
[Creditsafe](http://www.creditsafeuk.com/) API.
|
7
|
-
|
8
|
-
Currently, it only partially implements the API to support finding companies by
|
9
|
-
registration number (and name in Germany), and retrieving company online reports.
|
10
|
-
|
11
|
-
# Installation
|
12
|
-
|
13
|
-
Install the gem from RubyGems.org by adding the following to your `Gemfile`:
|
14
|
-
|
15
|
-
```ruby
|
16
|
-
gem 'creditsafe', '~> 0.4.0'
|
17
|
-
```
|
18
|
-
|
19
|
-
Just run `bundle install` to install the gem and its dependencies.
|
20
|
-
|
21
|
-
# Usage
|
22
|
-
|
23
|
-
Initialise the client with your `username` and `password`.
|
24
|
-
|
25
|
-
```ruby
|
26
|
-
client = Creditsafe::Client.new(username: "foo", password: "bar")
|
27
|
-
|
28
|
-
# optionally with environment (live is default) and or log level
|
29
|
-
client = Creditsafe::Client.new(username: "foo", password: "bar", environment: :test, log_level: :debug)
|
30
|
-
```
|
31
|
-
|
32
|
-
### Company Search
|
33
|
-
|
34
|
-
To perform a search for a company, you need to provide a valid search criteria, including
|
35
|
-
the country code and a company registration number or company name:
|
36
|
-
|
37
|
-
```ruby
|
38
|
-
client.find_company({ country_code: "GB", registration_number: "07495895" })
|
39
|
-
=> {
|
40
|
-
name: "GOCARDLESS LTD",
|
41
|
-
type: "Ltd",
|
42
|
-
status: "Active",
|
43
|
-
registration_number: "07495895",
|
44
|
-
address: {
|
45
|
-
simple_value: "338-346, GOSWELL, LONDON",
|
46
|
-
postal_code: "EC1V7LQ"
|
47
|
-
},
|
48
|
-
available_report_types: { available_report_type: "Full" },
|
49
|
-
available_languages: { available_language: "EN" },
|
50
|
-
@date_of_latest_accounts: "2014-01-31T00:00:00Z",
|
51
|
-
@online_reports: "true",
|
52
|
-
@monitoring: "false",
|
53
|
-
@country: "GB",
|
54
|
-
@id: "GB003/0/07495895"
|
55
|
-
}
|
56
|
-
```
|
57
|
-
|
58
|
-
In Germany you can also perform a name search. For this you need to provide a country code
|
59
|
-
and a company name, and can optionally provide a postal code or city to filter the results
|
60
|
-
further:
|
61
|
-
|
62
|
-
```ruby
|
63
|
-
client.find_company({ country_code: "DE", company_name: "zalando", postal_code: "10243" })
|
64
|
-
=> [
|
65
|
-
{
|
66
|
-
"name": "Zalando Logistics Süd SE & Co. KG",
|
67
|
-
"type": "NonLtd",
|
68
|
-
"status": "Active",
|
69
|
-
"address": {
|
70
|
-
"street": "Tamara-Danz-Str. 1",
|
71
|
-
"city": "Berlin",
|
72
|
-
"postal_code": "10243"
|
73
|
-
},
|
74
|
-
"available_report_types": {
|
75
|
-
"available_report_type": [
|
76
|
-
"Full",
|
77
|
-
"Basic"
|
78
|
-
]
|
79
|
-
},
|
80
|
-
"available_languages": {
|
81
|
-
"available_language": [
|
82
|
-
"EN",
|
83
|
-
"DE"
|
84
|
-
]
|
85
|
-
},
|
86
|
-
"@online_reports": "true",
|
87
|
-
"@monitoring": "true",
|
88
|
-
"@country": "DE",
|
89
|
-
"@id": "DE001/1/DE20316785",
|
90
|
-
"@safe_number": "DE20316785"
|
91
|
-
},
|
92
|
-
{
|
93
|
-
"name": "Zalando Outlet Store Berlin",
|
94
|
-
"type": "NonLtd",
|
95
|
-
"status": "Active",
|
96
|
-
"address": {
|
97
|
-
"street": "Köpenicker Str. 20",
|
98
|
-
"city": "Berlin",
|
99
|
-
"postal_code": "10997"
|
100
|
-
},
|
101
|
-
"available_report_types": {
|
102
|
-
"available_report_type": [
|
103
|
-
"Full",
|
104
|
-
"Basic"
|
105
|
-
]
|
106
|
-
},
|
107
|
-
"available_languages": {
|
108
|
-
"available_language": [
|
109
|
-
"EN",
|
110
|
-
"DE"
|
111
|
-
]
|
112
|
-
},
|
113
|
-
"@online_reports": "true",
|
114
|
-
"@monitoring": "true",
|
115
|
-
"@country": "DE",
|
116
|
-
"@id": "DE001/1/DE16031795",
|
117
|
-
"@safe_number": "DE16031795"
|
118
|
-
},
|
119
|
-
...
|
120
|
-
]
|
121
|
-
```
|
122
|
-
|
123
|
-
In some countries you can also perform a VAT number search. For this, you need to provide
|
124
|
-
a country code and a VAT number:
|
125
|
-
|
126
|
-
```ruby
|
127
|
-
client.find_company({ country_code: "US", vat_number: "201665019" })
|
128
|
-
=> [
|
129
|
-
{
|
130
|
-
"name": "FACEBOOK, INCORPORATED",
|
131
|
-
"officeType": "HeadOffice",
|
132
|
-
"status": "Active",
|
133
|
-
"registration_number": "0883875",
|
134
|
-
"vat_number": "201665019",
|
135
|
-
"address": {
|
136
|
-
"simple_value": "1601 WILLOW ROAD , MENLO PARK, CA, 94025",
|
137
|
-
"street": "1601 WILLOW ROAD ",
|
138
|
-
"city": "MENLO PARK",
|
139
|
-
"postal_code": "94025",
|
140
|
-
"province": "CA"
|
141
|
-
},
|
142
|
-
"phone_number": "6505434800",
|
143
|
-
"available_report_types": {
|
144
|
-
"available_report_type": "Full"
|
145
|
-
},
|
146
|
-
"available_languages": {
|
147
|
-
"available_language": "EN"
|
148
|
-
},
|
149
|
-
"@online_reports": "true",
|
150
|
-
"@monitoring": "false",
|
151
|
-
"@country": "US",
|
152
|
-
"@id": "US023/X/US22964593",
|
153
|
-
"@safe_number": "US22964593"
|
154
|
-
},
|
155
|
-
...
|
156
|
-
]
|
157
|
-
```
|
158
|
-
|
159
|
-
### Company Report
|
160
|
-
|
161
|
-
To download all the information available in an online company report, you will
|
162
|
-
need the company's Creditsafe identifier (obtainable using
|
163
|
-
[find_company](#find_company) above):
|
164
|
-
|
165
|
-
```ruby
|
166
|
-
client.company_report("GB003/0/07495895")
|
167
|
-
=> {
|
168
|
-
...
|
169
|
-
}
|
170
|
-
```
|
171
|
-
|
172
|
-
|
173
|
-
---
|
174
|
-
|
175
|
-
GoCardless ♥ open source. If you do too, come [join us](https://gocardless.com/jobs#software-engineer).
|
1
|
+
# creditsafe-ruby
|
2
|
+
|
3
|
+
*Build status: [](https://circleci.com/gh/gocardless/creditsafe-ruby)*
|
4
|
+
|
5
|
+
A ruby library for interacting with the
|
6
|
+
[Creditsafe](http://www.creditsafeuk.com/) API.
|
7
|
+
|
8
|
+
Currently, it only partially implements the API to support finding companies by
|
9
|
+
registration number (and name in Germany), and retrieving company online reports.
|
10
|
+
|
11
|
+
# Installation
|
12
|
+
|
13
|
+
Install the gem from RubyGems.org by adding the following to your `Gemfile`:
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
gem 'creditsafe', '~> 0.4.0'
|
17
|
+
```
|
18
|
+
|
19
|
+
Just run `bundle install` to install the gem and its dependencies.
|
20
|
+
|
21
|
+
# Usage
|
22
|
+
|
23
|
+
Initialise the client with your `username` and `password`.
|
24
|
+
|
25
|
+
```ruby
|
26
|
+
client = Creditsafe::Client.new(username: "foo", password: "bar")
|
27
|
+
|
28
|
+
# optionally with environment (live is default) and or log level
|
29
|
+
client = Creditsafe::Client.new(username: "foo", password: "bar", environment: :test, log_level: :debug)
|
30
|
+
```
|
31
|
+
|
32
|
+
### Company Search
|
33
|
+
|
34
|
+
To perform a search for a company, you need to provide a valid search criteria, including
|
35
|
+
the country code and a company registration number or company name:
|
36
|
+
|
37
|
+
```ruby
|
38
|
+
client.find_company({ country_code: "GB", registration_number: "07495895" })
|
39
|
+
=> {
|
40
|
+
name: "GOCARDLESS LTD",
|
41
|
+
type: "Ltd",
|
42
|
+
status: "Active",
|
43
|
+
registration_number: "07495895",
|
44
|
+
address: {
|
45
|
+
simple_value: "338-346, GOSWELL, LONDON",
|
46
|
+
postal_code: "EC1V7LQ"
|
47
|
+
},
|
48
|
+
available_report_types: { available_report_type: "Full" },
|
49
|
+
available_languages: { available_language: "EN" },
|
50
|
+
@date_of_latest_accounts: "2014-01-31T00:00:00Z",
|
51
|
+
@online_reports: "true",
|
52
|
+
@monitoring: "false",
|
53
|
+
@country: "GB",
|
54
|
+
@id: "GB003/0/07495895"
|
55
|
+
}
|
56
|
+
```
|
57
|
+
|
58
|
+
In Germany you can also perform a name search. For this you need to provide a country code
|
59
|
+
and a company name, and can optionally provide a postal code or city to filter the results
|
60
|
+
further:
|
61
|
+
|
62
|
+
```ruby
|
63
|
+
client.find_company({ country_code: "DE", company_name: "zalando", postal_code: "10243" })
|
64
|
+
=> [
|
65
|
+
{
|
66
|
+
"name": "Zalando Logistics Süd SE & Co. KG",
|
67
|
+
"type": "NonLtd",
|
68
|
+
"status": "Active",
|
69
|
+
"address": {
|
70
|
+
"street": "Tamara-Danz-Str. 1",
|
71
|
+
"city": "Berlin",
|
72
|
+
"postal_code": "10243"
|
73
|
+
},
|
74
|
+
"available_report_types": {
|
75
|
+
"available_report_type": [
|
76
|
+
"Full",
|
77
|
+
"Basic"
|
78
|
+
]
|
79
|
+
},
|
80
|
+
"available_languages": {
|
81
|
+
"available_language": [
|
82
|
+
"EN",
|
83
|
+
"DE"
|
84
|
+
]
|
85
|
+
},
|
86
|
+
"@online_reports": "true",
|
87
|
+
"@monitoring": "true",
|
88
|
+
"@country": "DE",
|
89
|
+
"@id": "DE001/1/DE20316785",
|
90
|
+
"@safe_number": "DE20316785"
|
91
|
+
},
|
92
|
+
{
|
93
|
+
"name": "Zalando Outlet Store Berlin",
|
94
|
+
"type": "NonLtd",
|
95
|
+
"status": "Active",
|
96
|
+
"address": {
|
97
|
+
"street": "Köpenicker Str. 20",
|
98
|
+
"city": "Berlin",
|
99
|
+
"postal_code": "10997"
|
100
|
+
},
|
101
|
+
"available_report_types": {
|
102
|
+
"available_report_type": [
|
103
|
+
"Full",
|
104
|
+
"Basic"
|
105
|
+
]
|
106
|
+
},
|
107
|
+
"available_languages": {
|
108
|
+
"available_language": [
|
109
|
+
"EN",
|
110
|
+
"DE"
|
111
|
+
]
|
112
|
+
},
|
113
|
+
"@online_reports": "true",
|
114
|
+
"@monitoring": "true",
|
115
|
+
"@country": "DE",
|
116
|
+
"@id": "DE001/1/DE16031795",
|
117
|
+
"@safe_number": "DE16031795"
|
118
|
+
},
|
119
|
+
...
|
120
|
+
]
|
121
|
+
```
|
122
|
+
|
123
|
+
In some countries you can also perform a VAT number search. For this, you need to provide
|
124
|
+
a country code and a VAT number:
|
125
|
+
|
126
|
+
```ruby
|
127
|
+
client.find_company({ country_code: "US", vat_number: "201665019" })
|
128
|
+
=> [
|
129
|
+
{
|
130
|
+
"name": "FACEBOOK, INCORPORATED",
|
131
|
+
"officeType": "HeadOffice",
|
132
|
+
"status": "Active",
|
133
|
+
"registration_number": "0883875",
|
134
|
+
"vat_number": "201665019",
|
135
|
+
"address": {
|
136
|
+
"simple_value": "1601 WILLOW ROAD , MENLO PARK, CA, 94025",
|
137
|
+
"street": "1601 WILLOW ROAD ",
|
138
|
+
"city": "MENLO PARK",
|
139
|
+
"postal_code": "94025",
|
140
|
+
"province": "CA"
|
141
|
+
},
|
142
|
+
"phone_number": "6505434800",
|
143
|
+
"available_report_types": {
|
144
|
+
"available_report_type": "Full"
|
145
|
+
},
|
146
|
+
"available_languages": {
|
147
|
+
"available_language": "EN"
|
148
|
+
},
|
149
|
+
"@online_reports": "true",
|
150
|
+
"@monitoring": "false",
|
151
|
+
"@country": "US",
|
152
|
+
"@id": "US023/X/US22964593",
|
153
|
+
"@safe_number": "US22964593"
|
154
|
+
},
|
155
|
+
...
|
156
|
+
]
|
157
|
+
```
|
158
|
+
|
159
|
+
### Company Report
|
160
|
+
|
161
|
+
To download all the information available in an online company report, you will
|
162
|
+
need the company's Creditsafe identifier (obtainable using
|
163
|
+
[find_company](#find_company) above):
|
164
|
+
|
165
|
+
```ruby
|
166
|
+
client.company_report("GB003/0/07495895")
|
167
|
+
=> {
|
168
|
+
...
|
169
|
+
}
|
170
|
+
```
|
171
|
+
|
172
|
+
|
173
|
+
---
|
174
|
+
|
175
|
+
GoCardless ♥ open source. If you do too, come [join us](https://gocardless.com/jobs#software-engineer).
|