trustdock 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.rspec +3 -0
- data/.travis.yml +7 -0
- data/Gemfile +8 -0
- data/Gemfile.lock +90 -0
- data/LICENSE.txt +21 -0
- data/README.md +74 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/fixtures/vcr_cassettes/create_verification.yml +62 -0
- data/fixtures/vcr_cassettes/update_comparing_data.yml +227 -0
- data/fixtures/vcr_cassettes/update_document.yml +172 -0
- data/fixtures/vcr_cassettes/update_plan.yml +117 -0
- data/fixtures/vcr_cassettes/verification.yml +124 -0
- data/lib/trustdock.rb +7 -0
- data/lib/trustdock/client.rb +78 -0
- data/lib/trustdock/error.rb +13 -0
- data/lib/trustdock/response/verification.rb +19 -0
- data/lib/trustdock/version.rb +3 -0
- data/trustdock.gemspec +35 -0
- metadata +166 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 3941f36b05ac233d8a0e64bf4e7c54d765e45e21d1975a7fb0d0a2a0a68ee5b9
|
4
|
+
data.tar.gz: 32ce7955eb2a757f24255450438c63f6b7235ce97b91d17abe488f13755f3cc9
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f3d13014980f9b1bfd88013feca23c8350fc90c82f767bdbc69d20b4b3a4a58602feb473b00199fca9dd4afec805130d442cd902983e06af550fd8ea24e347d1
|
7
|
+
data.tar.gz: 688f0ec889b4094717b6cc0e8ec6a957b297d893983c9b4a1c68e6663769df6c15bf13c1df9fba07a3a91add1210aab554130cbe9034a3c68280f5bd8a7be6a7
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,90 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
trustdock (0.1.0)
|
5
|
+
dry-struct (~> 1.0)
|
6
|
+
faraday (~> 0.15)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
addressable (2.7.0)
|
12
|
+
public_suffix (>= 2.0.2, < 5.0)
|
13
|
+
concurrent-ruby (1.1.5)
|
14
|
+
crack (0.4.3)
|
15
|
+
safe_yaml (~> 1.0.0)
|
16
|
+
diff-lcs (1.3)
|
17
|
+
docile (1.3.2)
|
18
|
+
dry-configurable (0.8.3)
|
19
|
+
concurrent-ruby (~> 1.0)
|
20
|
+
dry-core (~> 0.4, >= 0.4.7)
|
21
|
+
dry-container (0.7.2)
|
22
|
+
concurrent-ruby (~> 1.0)
|
23
|
+
dry-configurable (~> 0.1, >= 0.1.3)
|
24
|
+
dry-core (0.4.9)
|
25
|
+
concurrent-ruby (~> 1.0)
|
26
|
+
dry-equalizer (0.2.2)
|
27
|
+
dry-inflector (0.1.2)
|
28
|
+
dry-logic (1.0.3)
|
29
|
+
concurrent-ruby (~> 1.0)
|
30
|
+
dry-core (~> 0.2)
|
31
|
+
dry-equalizer (~> 0.2)
|
32
|
+
dry-struct (1.0.0)
|
33
|
+
dry-core (~> 0.4, >= 0.4.3)
|
34
|
+
dry-equalizer (~> 0.2)
|
35
|
+
dry-types (~> 1.0)
|
36
|
+
ice_nine (~> 0.11)
|
37
|
+
dry-types (1.1.1)
|
38
|
+
concurrent-ruby (~> 1.0)
|
39
|
+
dry-container (~> 0.3)
|
40
|
+
dry-core (~> 0.4, >= 0.4.4)
|
41
|
+
dry-equalizer (~> 0.2, >= 0.2.2)
|
42
|
+
dry-inflector (~> 0.1, >= 0.1.2)
|
43
|
+
dry-logic (~> 1.0, >= 1.0.2)
|
44
|
+
faraday (0.15.4)
|
45
|
+
multipart-post (>= 1.2, < 3)
|
46
|
+
hashdiff (1.0.0)
|
47
|
+
ice_nine (0.11.2)
|
48
|
+
json (2.2.0)
|
49
|
+
multipart-post (2.1.1)
|
50
|
+
public_suffix (4.0.1)
|
51
|
+
rake (10.5.0)
|
52
|
+
rspec (3.8.0)
|
53
|
+
rspec-core (~> 3.8.0)
|
54
|
+
rspec-expectations (~> 3.8.0)
|
55
|
+
rspec-mocks (~> 3.8.0)
|
56
|
+
rspec-core (3.8.2)
|
57
|
+
rspec-support (~> 3.8.0)
|
58
|
+
rspec-expectations (3.8.4)
|
59
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
60
|
+
rspec-support (~> 3.8.0)
|
61
|
+
rspec-mocks (3.8.1)
|
62
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
63
|
+
rspec-support (~> 3.8.0)
|
64
|
+
rspec-support (3.8.2)
|
65
|
+
safe_yaml (1.0.5)
|
66
|
+
simplecov (0.17.1)
|
67
|
+
docile (~> 1.1)
|
68
|
+
json (>= 1.8, < 3)
|
69
|
+
simplecov-html (~> 0.10.0)
|
70
|
+
simplecov-html (0.10.2)
|
71
|
+
vcr (5.0.0)
|
72
|
+
webmock (3.7.6)
|
73
|
+
addressable (>= 2.3.6)
|
74
|
+
crack (>= 0.3.2)
|
75
|
+
hashdiff (>= 0.4.0, < 2.0.0)
|
76
|
+
|
77
|
+
PLATFORMS
|
78
|
+
ruby
|
79
|
+
|
80
|
+
DEPENDENCIES
|
81
|
+
bundler (~> 2.0)
|
82
|
+
rake (~> 10.0)
|
83
|
+
rspec (~> 3.0)
|
84
|
+
simplecov
|
85
|
+
trustdock!
|
86
|
+
vcr (~> 5.0)
|
87
|
+
webmock (~> 3.7)
|
88
|
+
|
89
|
+
BUNDLED WITH
|
90
|
+
2.0.2
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2019 hachidori, inc. and camelmasa
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Trustdock
|
2
|
+
|
3
|
+
## Installation
|
4
|
+
|
5
|
+
Add this line to your application's Gemfile:
|
6
|
+
|
7
|
+
```ruby
|
8
|
+
gem 'trustdock'
|
9
|
+
```
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install trustdock
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
```
|
22
|
+
require "trustdock"
|
23
|
+
|
24
|
+
client = Trustdock::Client.new(API_KEY)
|
25
|
+
|
26
|
+
# Verifications
|
27
|
+
verification = client.create_verification
|
28
|
+
verification = client.verification(verification.id)
|
29
|
+
|
30
|
+
# Plan
|
31
|
+
client.update_plan(verification.id, { ids: [plan_id] })
|
32
|
+
|
33
|
+
params = {
|
34
|
+
"id_document": {
|
35
|
+
"type": "passport",
|
36
|
+
"format": "image",
|
37
|
+
"data": {
|
38
|
+
"front": [
|
39
|
+
base64_image
|
40
|
+
],
|
41
|
+
"back": [
|
42
|
+
base64_image
|
43
|
+
]
|
44
|
+
}
|
45
|
+
}
|
46
|
+
}
|
47
|
+
|
48
|
+
# Document
|
49
|
+
client.update_document(verification.id, plan_id, params)
|
50
|
+
|
51
|
+
params = {
|
52
|
+
"name": "日本花子",
|
53
|
+
"birth": "1975-06-01",
|
54
|
+
"address": "三重県津市垂水2566番地",
|
55
|
+
"gender": "female"
|
56
|
+
}
|
57
|
+
|
58
|
+
# Ccomparing Data
|
59
|
+
response = client.update_comparing_data(verification.id, params)
|
60
|
+
```
|
61
|
+
|
62
|
+
## Development
|
63
|
+
|
64
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
65
|
+
|
66
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
67
|
+
|
68
|
+
## Contributing
|
69
|
+
|
70
|
+
Bug reports and pull requests are welcome on BitBucket at https://bitbucket.org/hachidori_develop/trustdock/
|
71
|
+
|
72
|
+
## License
|
73
|
+
|
74
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "trustdock"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1,62 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://api.test.trustdock.io/v2/verifications
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Content-Type:
|
11
|
+
- application/json
|
12
|
+
Authorization:
|
13
|
+
- Bearer api_token
|
14
|
+
User-Agent:
|
15
|
+
- Faraday v0.15.4
|
16
|
+
Content-Length:
|
17
|
+
- '0'
|
18
|
+
Accept-Encoding:
|
19
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
20
|
+
Accept:
|
21
|
+
- "*/*"
|
22
|
+
response:
|
23
|
+
status:
|
24
|
+
code: 202
|
25
|
+
message: Accepted
|
26
|
+
headers:
|
27
|
+
Server:
|
28
|
+
- nginx
|
29
|
+
Date:
|
30
|
+
- Tue, 01 Oct 2019 23:27:34 GMT
|
31
|
+
Content-Type:
|
32
|
+
- application/json; charset=utf-8
|
33
|
+
Transfer-Encoding:
|
34
|
+
- chunked
|
35
|
+
Connection:
|
36
|
+
- keep-alive
|
37
|
+
X-Frame-Options:
|
38
|
+
- SAMEORIGIN
|
39
|
+
X-Xss-Protection:
|
40
|
+
- 1; mode=block
|
41
|
+
X-Content-Type-Options:
|
42
|
+
- nosniff
|
43
|
+
X-Download-Options:
|
44
|
+
- noopen
|
45
|
+
X-Permitted-Cross-Domain-Policies:
|
46
|
+
- none
|
47
|
+
Referrer-Policy:
|
48
|
+
- strict-origin-when-cross-origin
|
49
|
+
Cache-Control:
|
50
|
+
- no-cache
|
51
|
+
X-Request-Id:
|
52
|
+
- 995081b8a57ce5e9971ff55cb741d731
|
53
|
+
X-Runtime:
|
54
|
+
- '0.067066'
|
55
|
+
Vary:
|
56
|
+
- Origin
|
57
|
+
body:
|
58
|
+
encoding: UTF-8
|
59
|
+
string: '{"id":"c0785a9a-5a9d-4a52-9347-d0abd7d527cf","id_for_helper":"594b1ed6-183f-44ec-913c-417fc6853951","state":"accepted","result":null,"accepted_at":"2019-10-01T23:27:34.000Z","plans_selected_at":null,"document_submitted_at":null,"prepared_at":null,"verified_at":null}'
|
60
|
+
http_version:
|
61
|
+
recorded_at: Tue, 01 Oct 2019 23:27:34 GMT
|
62
|
+
recorded_with: VCR 5.0.0
|
@@ -0,0 +1,227 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://api.test.trustdock.io/v2/verifications
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Content-Type:
|
11
|
+
- application/json
|
12
|
+
Authorization:
|
13
|
+
- Bearer api_token
|
14
|
+
User-Agent:
|
15
|
+
- Faraday v0.15.4
|
16
|
+
Content-Length:
|
17
|
+
- '0'
|
18
|
+
Accept-Encoding:
|
19
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
20
|
+
Accept:
|
21
|
+
- "*/*"
|
22
|
+
response:
|
23
|
+
status:
|
24
|
+
code: 202
|
25
|
+
message: Accepted
|
26
|
+
headers:
|
27
|
+
Server:
|
28
|
+
- nginx
|
29
|
+
Date:
|
30
|
+
- Tue, 01 Oct 2019 23:27:35 GMT
|
31
|
+
Content-Type:
|
32
|
+
- application/json; charset=utf-8
|
33
|
+
Transfer-Encoding:
|
34
|
+
- chunked
|
35
|
+
Connection:
|
36
|
+
- keep-alive
|
37
|
+
X-Frame-Options:
|
38
|
+
- SAMEORIGIN
|
39
|
+
X-Xss-Protection:
|
40
|
+
- 1; mode=block
|
41
|
+
X-Content-Type-Options:
|
42
|
+
- nosniff
|
43
|
+
X-Download-Options:
|
44
|
+
- noopen
|
45
|
+
X-Permitted-Cross-Domain-Policies:
|
46
|
+
- none
|
47
|
+
Referrer-Policy:
|
48
|
+
- strict-origin-when-cross-origin
|
49
|
+
Cache-Control:
|
50
|
+
- no-cache
|
51
|
+
X-Request-Id:
|
52
|
+
- 80e31f0230a6ba5bcd623952ef86b4e3
|
53
|
+
X-Runtime:
|
54
|
+
- '0.067350'
|
55
|
+
Vary:
|
56
|
+
- Origin
|
57
|
+
body:
|
58
|
+
encoding: UTF-8
|
59
|
+
string: '{"id":"eae183df-3e25-4517-8e87-d2e06f5af81f","id_for_helper":"2743c717-c2f8-4a2b-9302-f2eb8f6d0f47","state":"accepted","result":null,"accepted_at":"2019-10-01T23:27:35.000Z","plans_selected_at":null,"document_submitted_at":null,"prepared_at":null,"verified_at":null}'
|
60
|
+
http_version:
|
61
|
+
recorded_at: Tue, 01 Oct 2019 23:27:35 GMT
|
62
|
+
- request:
|
63
|
+
method: put
|
64
|
+
uri: https://api.test.trustdock.io/v2/verifications/eae183df-3e25-4517-8e87-d2e06f5af81f/plans
|
65
|
+
body:
|
66
|
+
encoding: UTF-8
|
67
|
+
string: '{"ids":["924af311-788f-4252-9b6d-bef2bc0871ae"]}'
|
68
|
+
headers:
|
69
|
+
Content-Type:
|
70
|
+
- application/json
|
71
|
+
Authorization:
|
72
|
+
- Bearer api_token
|
73
|
+
User-Agent:
|
74
|
+
- Faraday v0.15.4
|
75
|
+
Accept-Encoding:
|
76
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
77
|
+
Accept:
|
78
|
+
- "*/*"
|
79
|
+
response:
|
80
|
+
status:
|
81
|
+
code: 204
|
82
|
+
message: No Content
|
83
|
+
headers:
|
84
|
+
Server:
|
85
|
+
- nginx
|
86
|
+
Date:
|
87
|
+
- Tue, 01 Oct 2019 23:27:35 GMT
|
88
|
+
Connection:
|
89
|
+
- keep-alive
|
90
|
+
X-Frame-Options:
|
91
|
+
- SAMEORIGIN
|
92
|
+
X-Xss-Protection:
|
93
|
+
- 1; mode=block
|
94
|
+
X-Content-Type-Options:
|
95
|
+
- nosniff
|
96
|
+
X-Download-Options:
|
97
|
+
- noopen
|
98
|
+
X-Permitted-Cross-Domain-Policies:
|
99
|
+
- none
|
100
|
+
Referrer-Policy:
|
101
|
+
- strict-origin-when-cross-origin
|
102
|
+
Cache-Control:
|
103
|
+
- no-cache
|
104
|
+
X-Request-Id:
|
105
|
+
- 3af565f47e239f96f7f8da5827739976
|
106
|
+
X-Runtime:
|
107
|
+
- '0.050859'
|
108
|
+
Vary:
|
109
|
+
- Origin
|
110
|
+
Strict-Transport-Security:
|
111
|
+
- max-age=31536000; includeSubdomains
|
112
|
+
body:
|
113
|
+
encoding: UTF-8
|
114
|
+
string: ''
|
115
|
+
http_version:
|
116
|
+
recorded_at: Tue, 01 Oct 2019 23:27:35 GMT
|
117
|
+
- request:
|
118
|
+
method: put
|
119
|
+
uri: https://api.test.trustdock.io/v2/verifications/eae183df-3e25-4517-8e87-d2e06f5af81f/plans/924af311-788f-4252-9b6d-bef2bc0871ae/documents
|
120
|
+
body:
|
121
|
+
encoding: UTF-8
|
122
|
+
string: '{"id_document":{"type":"passport","format":"image","data":{"front":["iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAABhGlDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw0AcxV9bS0UrDnYQPyBDdbIgKuKoVShChVArtOpgcukXNGlIUlwcBdeCgx+LVQcXZ10dXAVB8APExdVJ0UVK/F9SaBHjwXE/3t173L0D/PUyU82OcUDVLCOViAuZ7KoQekUQw+hGGIMSM/U5UUzCc3zdw8fXuxjP8j735+hRciYDfALxLNMNi3iDeHrT0jnvE0dYUVKIz4nHDLog8SPXZZffOBcc9vPMiJFOzRNHiIVCG8ttzIqGSjxFHFVUjfL9GZcVzluc1XKVNe/JXxjOaSvLXKc5hAQWsQQRAmRUUUIZFmK0aqSYSNF+3MM/4PhFcsnkKoGRYwEVqJAcP/gf/O7WzE9OuEnhOBB8se2PESC0CzRqtv19bNuNEyDwDFxpLX+lDsx8kl5radEjoHcbuLhuafIecLkD9D/pkiE5UoCmP58H3s/om7JA3y3Qteb21tzH6QOQpq6SN8DBITBaoOx1j3d3tvf275lmfz85tnKQCfSDXgAAAAxJREFUCNdj+DhjBQAErwIyZjaCMwAAAABJRU5ErkJggg=="],"back":["iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAABhGlDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw0AcxV9bS0UrDnYQPyBDdbIgKuKoVShChVArtOpgcukXNGlIUlwcBdeCgx+LVQcXZ10dXAVB8APExdVJ0UVK/F9SaBHjwXE/3t173L0D/PUyU82OcUDVLCOViAuZ7KoQekUQw+hGGIMSM/U5UUzCc3zdw8fXuxjP8j735+hRciYDfALxLNMNi3iDeHrT0jnvE0dYUVKIz4nHDLog8SPXZZffOBcc9vPMiJFOzRNHiIVCG8ttzIqGSjxFHFVUjfL9GZcVzluc1XKVNe/JXxjOaSvLXKc5hAQWsQQRAmRUUUIZFmK0aqSYSNF+3MM/4PhFcsnkKoGRYwEVqJAcP/gf/O7WzE9OuEnhOBB8se2PESC0CzRqtv19bNuNEyDwDFxpLX+lDsx8kl5radEjoHcbuLhuafIecLkD9D/pkiE5UoCmP58H3s/om7JA3y3Qteb21tzH6QOQpq6SN8DBITBaoOx1j3d3tvf275lmfz85tnKQCfSDXgAAAAxJREFUCNdj+DhjBQAErwIyZjaCMwAAAABJRU5ErkJggg=="]}}}'
|
123
|
+
headers:
|
124
|
+
Content-Type:
|
125
|
+
- application/json
|
126
|
+
Authorization:
|
127
|
+
- Bearer api_token
|
128
|
+
User-Agent:
|
129
|
+
- Faraday v0.15.4
|
130
|
+
Accept-Encoding:
|
131
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
132
|
+
Accept:
|
133
|
+
- "*/*"
|
134
|
+
response:
|
135
|
+
status:
|
136
|
+
code: 204
|
137
|
+
message: No Content
|
138
|
+
headers:
|
139
|
+
Server:
|
140
|
+
- nginx
|
141
|
+
Date:
|
142
|
+
- Tue, 01 Oct 2019 23:27:36 GMT
|
143
|
+
Connection:
|
144
|
+
- keep-alive
|
145
|
+
X-Frame-Options:
|
146
|
+
- SAMEORIGIN
|
147
|
+
X-Xss-Protection:
|
148
|
+
- 1; mode=block
|
149
|
+
X-Content-Type-Options:
|
150
|
+
- nosniff
|
151
|
+
X-Download-Options:
|
152
|
+
- noopen
|
153
|
+
X-Permitted-Cross-Domain-Policies:
|
154
|
+
- none
|
155
|
+
Referrer-Policy:
|
156
|
+
- strict-origin-when-cross-origin
|
157
|
+
Cache-Control:
|
158
|
+
- no-cache
|
159
|
+
X-Request-Id:
|
160
|
+
- 58e94852f2b09407f44f0351b856be50
|
161
|
+
X-Runtime:
|
162
|
+
- '0.436694'
|
163
|
+
Vary:
|
164
|
+
- Origin
|
165
|
+
Strict-Transport-Security:
|
166
|
+
- max-age=31536000; includeSubdomains
|
167
|
+
body:
|
168
|
+
encoding: UTF-8
|
169
|
+
string: ''
|
170
|
+
http_version:
|
171
|
+
recorded_at: Tue, 01 Oct 2019 23:27:36 GMT
|
172
|
+
- request:
|
173
|
+
method: put
|
174
|
+
uri: https://api.test.trustdock.io/v2/verifications/eae183df-3e25-4517-8e87-d2e06f5af81f/comparing_data
|
175
|
+
body:
|
176
|
+
encoding: UTF-8
|
177
|
+
string: '{"name":"日本花子","birth":"1975-06-01","address":"三重県津市垂水2566番地","gender":"female"}'
|
178
|
+
headers:
|
179
|
+
Content-Type:
|
180
|
+
- application/json
|
181
|
+
Authorization:
|
182
|
+
- Bearer api_token
|
183
|
+
User-Agent:
|
184
|
+
- Faraday v0.15.4
|
185
|
+
Accept-Encoding:
|
186
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
187
|
+
Accept:
|
188
|
+
- "*/*"
|
189
|
+
response:
|
190
|
+
status:
|
191
|
+
code: 204
|
192
|
+
message: No Content
|
193
|
+
headers:
|
194
|
+
Server:
|
195
|
+
- nginx
|
196
|
+
Date:
|
197
|
+
- Tue, 01 Oct 2019 23:27:36 GMT
|
198
|
+
Connection:
|
199
|
+
- keep-alive
|
200
|
+
X-Frame-Options:
|
201
|
+
- SAMEORIGIN
|
202
|
+
X-Xss-Protection:
|
203
|
+
- 1; mode=block
|
204
|
+
X-Content-Type-Options:
|
205
|
+
- nosniff
|
206
|
+
X-Download-Options:
|
207
|
+
- noopen
|
208
|
+
X-Permitted-Cross-Domain-Policies:
|
209
|
+
- none
|
210
|
+
Referrer-Policy:
|
211
|
+
- strict-origin-when-cross-origin
|
212
|
+
Cache-Control:
|
213
|
+
- no-cache
|
214
|
+
X-Request-Id:
|
215
|
+
- 24a83f956edd25ad52424f6c3d0542a9
|
216
|
+
X-Runtime:
|
217
|
+
- '0.089601'
|
218
|
+
Vary:
|
219
|
+
- Origin
|
220
|
+
Strict-Transport-Security:
|
221
|
+
- max-age=31536000; includeSubdomains
|
222
|
+
body:
|
223
|
+
encoding: UTF-8
|
224
|
+
string: ''
|
225
|
+
http_version:
|
226
|
+
recorded_at: Tue, 01 Oct 2019 23:27:36 GMT
|
227
|
+
recorded_with: VCR 5.0.0
|
@@ -0,0 +1,172 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://api.test.trustdock.io/v2/verifications
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Content-Type:
|
11
|
+
- application/json
|
12
|
+
Authorization:
|
13
|
+
- Bearer api_token
|
14
|
+
User-Agent:
|
15
|
+
- Faraday v0.15.4
|
16
|
+
Content-Length:
|
17
|
+
- '0'
|
18
|
+
Accept-Encoding:
|
19
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
20
|
+
Accept:
|
21
|
+
- "*/*"
|
22
|
+
response:
|
23
|
+
status:
|
24
|
+
code: 202
|
25
|
+
message: Accepted
|
26
|
+
headers:
|
27
|
+
Server:
|
28
|
+
- nginx
|
29
|
+
Date:
|
30
|
+
- Tue, 01 Oct 2019 23:27:34 GMT
|
31
|
+
Content-Type:
|
32
|
+
- application/json; charset=utf-8
|
33
|
+
Transfer-Encoding:
|
34
|
+
- chunked
|
35
|
+
Connection:
|
36
|
+
- keep-alive
|
37
|
+
X-Frame-Options:
|
38
|
+
- SAMEORIGIN
|
39
|
+
X-Xss-Protection:
|
40
|
+
- 1; mode=block
|
41
|
+
X-Content-Type-Options:
|
42
|
+
- nosniff
|
43
|
+
X-Download-Options:
|
44
|
+
- noopen
|
45
|
+
X-Permitted-Cross-Domain-Policies:
|
46
|
+
- none
|
47
|
+
Referrer-Policy:
|
48
|
+
- strict-origin-when-cross-origin
|
49
|
+
Cache-Control:
|
50
|
+
- no-cache
|
51
|
+
X-Request-Id:
|
52
|
+
- 21786f6046125c350e88766b085b923b
|
53
|
+
X-Runtime:
|
54
|
+
- '0.038274'
|
55
|
+
Vary:
|
56
|
+
- Origin
|
57
|
+
body:
|
58
|
+
encoding: UTF-8
|
59
|
+
string: '{"id":"ad373dfe-6978-4703-a480-729676a0261a","id_for_helper":"bb9f50a9-a057-4e6d-bc4d-4db15b31bb00","state":"accepted","result":null,"accepted_at":"2019-10-01T23:27:34.000Z","plans_selected_at":null,"document_submitted_at":null,"prepared_at":null,"verified_at":null}'
|
60
|
+
http_version:
|
61
|
+
recorded_at: Tue, 01 Oct 2019 23:27:34 GMT
|
62
|
+
- request:
|
63
|
+
method: put
|
64
|
+
uri: https://api.test.trustdock.io/v2/verifications/ad373dfe-6978-4703-a480-729676a0261a/plans
|
65
|
+
body:
|
66
|
+
encoding: UTF-8
|
67
|
+
string: '{"ids":["924af311-788f-4252-9b6d-bef2bc0871ae"]}'
|
68
|
+
headers:
|
69
|
+
Content-Type:
|
70
|
+
- application/json
|
71
|
+
Authorization:
|
72
|
+
- Bearer api_token
|
73
|
+
User-Agent:
|
74
|
+
- Faraday v0.15.4
|
75
|
+
Accept-Encoding:
|
76
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
77
|
+
Accept:
|
78
|
+
- "*/*"
|
79
|
+
response:
|
80
|
+
status:
|
81
|
+
code: 204
|
82
|
+
message: No Content
|
83
|
+
headers:
|
84
|
+
Server:
|
85
|
+
- nginx
|
86
|
+
Date:
|
87
|
+
- Tue, 01 Oct 2019 23:27:34 GMT
|
88
|
+
Connection:
|
89
|
+
- keep-alive
|
90
|
+
X-Frame-Options:
|
91
|
+
- SAMEORIGIN
|
92
|
+
X-Xss-Protection:
|
93
|
+
- 1; mode=block
|
94
|
+
X-Content-Type-Options:
|
95
|
+
- nosniff
|
96
|
+
X-Download-Options:
|
97
|
+
- noopen
|
98
|
+
X-Permitted-Cross-Domain-Policies:
|
99
|
+
- none
|
100
|
+
Referrer-Policy:
|
101
|
+
- strict-origin-when-cross-origin
|
102
|
+
Cache-Control:
|
103
|
+
- no-cache
|
104
|
+
X-Request-Id:
|
105
|
+
- ba4b9a21fef138eb9bd34da548c7ddc4
|
106
|
+
X-Runtime:
|
107
|
+
- '0.083201'
|
108
|
+
Vary:
|
109
|
+
- Origin
|
110
|
+
Strict-Transport-Security:
|
111
|
+
- max-age=31536000; includeSubdomains
|
112
|
+
body:
|
113
|
+
encoding: UTF-8
|
114
|
+
string: ''
|
115
|
+
http_version:
|
116
|
+
recorded_at: Tue, 01 Oct 2019 23:27:34 GMT
|
117
|
+
- request:
|
118
|
+
method: put
|
119
|
+
uri: https://api.test.trustdock.io/v2/verifications/ad373dfe-6978-4703-a480-729676a0261a/plans/924af311-788f-4252-9b6d-bef2bc0871ae/documents
|
120
|
+
body:
|
121
|
+
encoding: UTF-8
|
122
|
+
string: '{"id_document":{"type":"passport","format":"image","data":{"front":["iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAABhGlDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw0AcxV9bS0UrDnYQPyBDdbIgKuKoVShChVArtOpgcukXNGlIUlwcBdeCgx+LVQcXZ10dXAVB8APExdVJ0UVK/F9SaBHjwXE/3t173L0D/PUyU82OcUDVLCOViAuZ7KoQekUQw+hGGIMSM/U5UUzCc3zdw8fXuxjP8j735+hRciYDfALxLNMNi3iDeHrT0jnvE0dYUVKIz4nHDLog8SPXZZffOBcc9vPMiJFOzRNHiIVCG8ttzIqGSjxFHFVUjfL9GZcVzluc1XKVNe/JXxjOaSvLXKc5hAQWsQQRAmRUUUIZFmK0aqSYSNF+3MM/4PhFcsnkKoGRYwEVqJAcP/gf/O7WzE9OuEnhOBB8se2PESC0CzRqtv19bNuNEyDwDFxpLX+lDsx8kl5radEjoHcbuLhuafIecLkD9D/pkiE5UoCmP58H3s/om7JA3y3Qteb21tzH6QOQpq6SN8DBITBaoOx1j3d3tvf275lmfz85tnKQCfSDXgAAAAxJREFUCNdj+DhjBQAErwIyZjaCMwAAAABJRU5ErkJggg=="],"back":["iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAABhGlDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw0AcxV9bS0UrDnYQPyBDdbIgKuKoVShChVArtOpgcukXNGlIUlwcBdeCgx+LVQcXZ10dXAVB8APExdVJ0UVK/F9SaBHjwXE/3t173L0D/PUyU82OcUDVLCOViAuZ7KoQekUQw+hGGIMSM/U5UUzCc3zdw8fXuxjP8j735+hRciYDfALxLNMNi3iDeHrT0jnvE0dYUVKIz4nHDLog8SPXZZffOBcc9vPMiJFOzRNHiIVCG8ttzIqGSjxFHFVUjfL9GZcVzluc1XKVNe/JXxjOaSvLXKc5hAQWsQQRAmRUUUIZFmK0aqSYSNF+3MM/4PhFcsnkKoGRYwEVqJAcP/gf/O7WzE9OuEnhOBB8se2PESC0CzRqtv19bNuNEyDwDFxpLX+lDsx8kl5radEjoHcbuLhuafIecLkD9D/pkiE5UoCmP58H3s/om7JA3y3Qteb21tzH6QOQpq6SN8DBITBaoOx1j3d3tvf275lmfz85tnKQCfSDXgAAAAxJREFUCNdj+DhjBQAErwIyZjaCMwAAAABJRU5ErkJggg=="]}}}'
|
123
|
+
headers:
|
124
|
+
Content-Type:
|
125
|
+
- application/json
|
126
|
+
Authorization:
|
127
|
+
- Bearer api_token
|
128
|
+
User-Agent:
|
129
|
+
- Faraday v0.15.4
|
130
|
+
Accept-Encoding:
|
131
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
132
|
+
Accept:
|
133
|
+
- "*/*"
|
134
|
+
response:
|
135
|
+
status:
|
136
|
+
code: 204
|
137
|
+
message: No Content
|
138
|
+
headers:
|
139
|
+
Server:
|
140
|
+
- nginx
|
141
|
+
Date:
|
142
|
+
- Tue, 01 Oct 2019 23:27:35 GMT
|
143
|
+
Connection:
|
144
|
+
- keep-alive
|
145
|
+
X-Frame-Options:
|
146
|
+
- SAMEORIGIN
|
147
|
+
X-Xss-Protection:
|
148
|
+
- 1; mode=block
|
149
|
+
X-Content-Type-Options:
|
150
|
+
- nosniff
|
151
|
+
X-Download-Options:
|
152
|
+
- noopen
|
153
|
+
X-Permitted-Cross-Domain-Policies:
|
154
|
+
- none
|
155
|
+
Referrer-Policy:
|
156
|
+
- strict-origin-when-cross-origin
|
157
|
+
Cache-Control:
|
158
|
+
- no-cache
|
159
|
+
X-Request-Id:
|
160
|
+
- e58cc4e981dd730753b3cba1f8fb8629
|
161
|
+
X-Runtime:
|
162
|
+
- '0.348234'
|
163
|
+
Vary:
|
164
|
+
- Origin
|
165
|
+
Strict-Transport-Security:
|
166
|
+
- max-age=31536000; includeSubdomains
|
167
|
+
body:
|
168
|
+
encoding: UTF-8
|
169
|
+
string: ''
|
170
|
+
http_version:
|
171
|
+
recorded_at: Tue, 01 Oct 2019 23:27:35 GMT
|
172
|
+
recorded_with: VCR 5.0.0
|
@@ -0,0 +1,117 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://api.test.trustdock.io/v2/verifications
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Content-Type:
|
11
|
+
- application/json
|
12
|
+
Authorization:
|
13
|
+
- Bearer api_token
|
14
|
+
User-Agent:
|
15
|
+
- Faraday v0.15.4
|
16
|
+
Content-Length:
|
17
|
+
- '0'
|
18
|
+
Accept-Encoding:
|
19
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
20
|
+
Accept:
|
21
|
+
- "*/*"
|
22
|
+
response:
|
23
|
+
status:
|
24
|
+
code: 202
|
25
|
+
message: Accepted
|
26
|
+
headers:
|
27
|
+
Server:
|
28
|
+
- nginx
|
29
|
+
Date:
|
30
|
+
- Tue, 01 Oct 2019 23:27:34 GMT
|
31
|
+
Content-Type:
|
32
|
+
- application/json; charset=utf-8
|
33
|
+
Transfer-Encoding:
|
34
|
+
- chunked
|
35
|
+
Connection:
|
36
|
+
- keep-alive
|
37
|
+
X-Frame-Options:
|
38
|
+
- SAMEORIGIN
|
39
|
+
X-Xss-Protection:
|
40
|
+
- 1; mode=block
|
41
|
+
X-Content-Type-Options:
|
42
|
+
- nosniff
|
43
|
+
X-Download-Options:
|
44
|
+
- noopen
|
45
|
+
X-Permitted-Cross-Domain-Policies:
|
46
|
+
- none
|
47
|
+
Referrer-Policy:
|
48
|
+
- strict-origin-when-cross-origin
|
49
|
+
Cache-Control:
|
50
|
+
- no-cache
|
51
|
+
X-Request-Id:
|
52
|
+
- 9757a09fb814c17db95ff1fab8de14b5
|
53
|
+
X-Runtime:
|
54
|
+
- '0.038800'
|
55
|
+
Vary:
|
56
|
+
- Origin
|
57
|
+
body:
|
58
|
+
encoding: UTF-8
|
59
|
+
string: '{"id":"48e6ff90-0d0a-49d5-9ca9-64c8e70d0828","id_for_helper":"f4627145-64f8-467a-bbad-a8706bc9d8d6","state":"accepted","result":null,"accepted_at":"2019-10-01T23:27:34.000Z","plans_selected_at":null,"document_submitted_at":null,"prepared_at":null,"verified_at":null}'
|
60
|
+
http_version:
|
61
|
+
recorded_at: Tue, 01 Oct 2019 23:27:34 GMT
|
62
|
+
- request:
|
63
|
+
method: put
|
64
|
+
uri: https://api.test.trustdock.io/v2/verifications/48e6ff90-0d0a-49d5-9ca9-64c8e70d0828/plans
|
65
|
+
body:
|
66
|
+
encoding: UTF-8
|
67
|
+
string: '{"ids":["924af311-788f-4252-9b6d-bef2bc0871ae"]}'
|
68
|
+
headers:
|
69
|
+
Content-Type:
|
70
|
+
- application/json
|
71
|
+
Authorization:
|
72
|
+
- Bearer api_token
|
73
|
+
User-Agent:
|
74
|
+
- Faraday v0.15.4
|
75
|
+
Accept-Encoding:
|
76
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
77
|
+
Accept:
|
78
|
+
- "*/*"
|
79
|
+
response:
|
80
|
+
status:
|
81
|
+
code: 204
|
82
|
+
message: No Content
|
83
|
+
headers:
|
84
|
+
Server:
|
85
|
+
- nginx
|
86
|
+
Date:
|
87
|
+
- Tue, 01 Oct 2019 23:27:34 GMT
|
88
|
+
Connection:
|
89
|
+
- keep-alive
|
90
|
+
X-Frame-Options:
|
91
|
+
- SAMEORIGIN
|
92
|
+
X-Xss-Protection:
|
93
|
+
- 1; mode=block
|
94
|
+
X-Content-Type-Options:
|
95
|
+
- nosniff
|
96
|
+
X-Download-Options:
|
97
|
+
- noopen
|
98
|
+
X-Permitted-Cross-Domain-Policies:
|
99
|
+
- none
|
100
|
+
Referrer-Policy:
|
101
|
+
- strict-origin-when-cross-origin
|
102
|
+
Cache-Control:
|
103
|
+
- no-cache
|
104
|
+
X-Request-Id:
|
105
|
+
- 1911b30030a935449a7deb44067e045c
|
106
|
+
X-Runtime:
|
107
|
+
- '0.087112'
|
108
|
+
Vary:
|
109
|
+
- Origin
|
110
|
+
Strict-Transport-Security:
|
111
|
+
- max-age=31536000; includeSubdomains
|
112
|
+
body:
|
113
|
+
encoding: UTF-8
|
114
|
+
string: ''
|
115
|
+
http_version:
|
116
|
+
recorded_at: Tue, 01 Oct 2019 23:27:34 GMT
|
117
|
+
recorded_with: VCR 5.0.0
|
@@ -0,0 +1,124 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://api.test.trustdock.io/v2/verifications
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Content-Type:
|
11
|
+
- application/json
|
12
|
+
Authorization:
|
13
|
+
- Bearer api_token
|
14
|
+
User-Agent:
|
15
|
+
- Faraday v0.15.4
|
16
|
+
Content-Length:
|
17
|
+
- '0'
|
18
|
+
Accept-Encoding:
|
19
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
20
|
+
Accept:
|
21
|
+
- "*/*"
|
22
|
+
response:
|
23
|
+
status:
|
24
|
+
code: 202
|
25
|
+
message: Accepted
|
26
|
+
headers:
|
27
|
+
Server:
|
28
|
+
- nginx
|
29
|
+
Date:
|
30
|
+
- Tue, 01 Oct 2019 23:27:34 GMT
|
31
|
+
Content-Type:
|
32
|
+
- application/json; charset=utf-8
|
33
|
+
Transfer-Encoding:
|
34
|
+
- chunked
|
35
|
+
Connection:
|
36
|
+
- keep-alive
|
37
|
+
X-Frame-Options:
|
38
|
+
- SAMEORIGIN
|
39
|
+
X-Xss-Protection:
|
40
|
+
- 1; mode=block
|
41
|
+
X-Content-Type-Options:
|
42
|
+
- nosniff
|
43
|
+
X-Download-Options:
|
44
|
+
- noopen
|
45
|
+
X-Permitted-Cross-Domain-Policies:
|
46
|
+
- none
|
47
|
+
Referrer-Policy:
|
48
|
+
- strict-origin-when-cross-origin
|
49
|
+
Cache-Control:
|
50
|
+
- no-cache
|
51
|
+
X-Request-Id:
|
52
|
+
- 10183e7bf9709a2b8d1b382e630ee68d
|
53
|
+
X-Runtime:
|
54
|
+
- '0.038171'
|
55
|
+
Vary:
|
56
|
+
- Origin
|
57
|
+
body:
|
58
|
+
encoding: UTF-8
|
59
|
+
string: '{"id":"b3f2fe82-f95c-4eba-a8ce-457738c9ccb9","id_for_helper":"976305a9-0d17-4f38-ab68-21f94bb450ea","state":"accepted","result":null,"accepted_at":"2019-10-01T23:27:34.000Z","plans_selected_at":null,"document_submitted_at":null,"prepared_at":null,"verified_at":null}'
|
60
|
+
http_version:
|
61
|
+
recorded_at: Tue, 01 Oct 2019 23:27:34 GMT
|
62
|
+
- request:
|
63
|
+
method: get
|
64
|
+
uri: https://api.test.trustdock.io/v2/verifications/b3f2fe82-f95c-4eba-a8ce-457738c9ccb9
|
65
|
+
body:
|
66
|
+
encoding: US-ASCII
|
67
|
+
string: ''
|
68
|
+
headers:
|
69
|
+
Content-Type:
|
70
|
+
- application/json
|
71
|
+
Authorization:
|
72
|
+
- Bearer api_token
|
73
|
+
User-Agent:
|
74
|
+
- Faraday v0.15.4
|
75
|
+
Accept-Encoding:
|
76
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
77
|
+
Accept:
|
78
|
+
- "*/*"
|
79
|
+
response:
|
80
|
+
status:
|
81
|
+
code: 200
|
82
|
+
message: OK
|
83
|
+
headers:
|
84
|
+
Server:
|
85
|
+
- nginx
|
86
|
+
Date:
|
87
|
+
- Tue, 01 Oct 2019 23:27:34 GMT
|
88
|
+
Content-Type:
|
89
|
+
- application/json; charset=utf-8
|
90
|
+
Transfer-Encoding:
|
91
|
+
- chunked
|
92
|
+
Connection:
|
93
|
+
- keep-alive
|
94
|
+
Vary:
|
95
|
+
- Accept-Encoding
|
96
|
+
- Origin
|
97
|
+
X-Frame-Options:
|
98
|
+
- SAMEORIGIN
|
99
|
+
X-Xss-Protection:
|
100
|
+
- 1; mode=block
|
101
|
+
X-Content-Type-Options:
|
102
|
+
- nosniff
|
103
|
+
X-Download-Options:
|
104
|
+
- noopen
|
105
|
+
X-Permitted-Cross-Domain-Policies:
|
106
|
+
- none
|
107
|
+
Referrer-Policy:
|
108
|
+
- strict-origin-when-cross-origin
|
109
|
+
Etag:
|
110
|
+
- W/"9181c923dcbe1597d07d2b005ae26833"
|
111
|
+
Cache-Control:
|
112
|
+
- max-age=0, private, must-revalidate
|
113
|
+
X-Request-Id:
|
114
|
+
- ddd7deefd220a7b22dddb170f07c67c6
|
115
|
+
X-Runtime:
|
116
|
+
- '0.029647'
|
117
|
+
Strict-Transport-Security:
|
118
|
+
- max-age=31536000; includeSubdomains
|
119
|
+
body:
|
120
|
+
encoding: ASCII-8BIT
|
121
|
+
string: '{"id":"b3f2fe82-f95c-4eba-a8ce-457738c9ccb9","id_for_helper":"976305a9-0d17-4f38-ab68-21f94bb450ea","state":"accepted","result":null,"accepted_at":"2019-10-01T23:27:34.000Z","plans_selected_at":null,"document_submitted_at":null,"prepared_at":null,"verified_at":null}'
|
122
|
+
http_version:
|
123
|
+
recorded_at: Tue, 01 Oct 2019 23:27:34 GMT
|
124
|
+
recorded_with: VCR 5.0.0
|
data/lib/trustdock.rb
ADDED
@@ -0,0 +1,78 @@
|
|
1
|
+
module Trustdock
|
2
|
+
class Client
|
3
|
+
PRODUCTION_URL = "https://api.trustdock.io"
|
4
|
+
SANDBOX_URL = "https://api.test.trustdock.io"
|
5
|
+
|
6
|
+
attr_reader :last_response
|
7
|
+
|
8
|
+
def initialize(api_token, sandbox: false)
|
9
|
+
@api_token = api_token
|
10
|
+
@sandbox = sandbox
|
11
|
+
end
|
12
|
+
|
13
|
+
def verification(id)
|
14
|
+
@last_response = request(:get, "/v2/verifications/#{id}")
|
15
|
+
|
16
|
+
Response::Verification.new JSON.parse(@last_response.body, symbolize_names: true)
|
17
|
+
end
|
18
|
+
|
19
|
+
def create_verification(options = {})
|
20
|
+
@last_response = request(:post, "/v2/verifications", options)
|
21
|
+
|
22
|
+
Response::Verification.new JSON.parse(@last_response.body, symbolize_names: true)
|
23
|
+
end
|
24
|
+
|
25
|
+
def update_plan(verification_id, options)
|
26
|
+
@last_response = request(:put, "/v2/verifications/#{verification_id}/plans", options)
|
27
|
+
|
28
|
+
nil
|
29
|
+
end
|
30
|
+
|
31
|
+
def update_document(verification_id, plan_id, options)
|
32
|
+
@last_response = request(:put, "/v2/verifications/#{verification_id}/plans/#{plan_id}/documents", options)
|
33
|
+
|
34
|
+
nil
|
35
|
+
end
|
36
|
+
|
37
|
+
def update_comparing_data(verification_id, options)
|
38
|
+
@last_response = request(:put, "/v2/verifications/#{verification_id}/comparing_data", options)
|
39
|
+
|
40
|
+
nil
|
41
|
+
end
|
42
|
+
|
43
|
+
private
|
44
|
+
|
45
|
+
def request(method, path, options = nil)
|
46
|
+
client.send(method, path, (options) ? options.to_json : nil)
|
47
|
+
|
48
|
+
rescue Faraday::Error => e
|
49
|
+
@last_response = e.response
|
50
|
+
|
51
|
+
case e.response[:status]
|
52
|
+
when 401
|
53
|
+
raise UnauthorizedError
|
54
|
+
when 404
|
55
|
+
raise NotFoundError
|
56
|
+
when 422
|
57
|
+
raise UnprocessableEntityError
|
58
|
+
when 500
|
59
|
+
raise InternalServerError
|
60
|
+
when 503
|
61
|
+
raise ServiceUnavailableError
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
def client
|
66
|
+
@client ||= Faraday.new(api_url) do |conn|
|
67
|
+
conn.headers["Content-Type"] = "application/json"
|
68
|
+
conn.authorization :Bearer, @api_token
|
69
|
+
conn.response :raise_error
|
70
|
+
conn.adapter Faraday.default_adapter
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
def api_url
|
75
|
+
@sandbox ? SANDBOX_URL : PRODUCTION_URL
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module Trustdock
|
2
|
+
class Error < StandardError; end
|
3
|
+
|
4
|
+
class ClientError < Error; end
|
5
|
+
class ServerError < Error; end
|
6
|
+
|
7
|
+
class UnauthorizedError < ClientError; end
|
8
|
+
class NotFoundError < ClientError; end
|
9
|
+
class UnprocessableEntityError < ClientError; end
|
10
|
+
|
11
|
+
class InternalServerError < ServerError; end
|
12
|
+
class ServiceUnavailableError < ServerError; end
|
13
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Trustdock
|
2
|
+
module Types
|
3
|
+
include Dry.Types(default: :nominal)
|
4
|
+
end
|
5
|
+
|
6
|
+
module Response
|
7
|
+
class Verification < Dry::Struct
|
8
|
+
attribute :id, Types::String
|
9
|
+
attribute :id_for_helper, Types::String
|
10
|
+
attribute :state, Types::String
|
11
|
+
attribute :result, Types::String
|
12
|
+
attribute :accepted_at, Types::String
|
13
|
+
attribute :plans_selected_at, Types::String
|
14
|
+
attribute :document_submitted_at, Types::String
|
15
|
+
attribute :prepared_at, Types::String
|
16
|
+
attribute :verified_at, Types::String
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/trustdock.gemspec
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
lib = File.expand_path("lib", __dir__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
require "trustdock/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "trustdock"
|
7
|
+
spec.version = Trustdock::VERSION
|
8
|
+
spec.authors = ["hachidori, inc.", "camelmasa"]
|
9
|
+
spec.email = ["camelmasa@gmail.com"]
|
10
|
+
|
11
|
+
spec.summary = %q{Ruby client for TRUSTDOCK}
|
12
|
+
spec.description = %q{Ruby client for TRUSTDOCK}
|
13
|
+
spec.homepage = "https://bitbucket.org/hachidori_develop/trustdock/src/master/"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
17
|
+
spec.metadata["source_code_uri"] = spec.homepage
|
18
|
+
|
19
|
+
# Specify which files should be added to the gem when it is released.
|
20
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
21
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
22
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
23
|
+
end
|
24
|
+
spec.bindir = "exe"
|
25
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
26
|
+
spec.require_paths = ["lib"]
|
27
|
+
|
28
|
+
spec.add_dependency "dry-struct", "~> 1.0"
|
29
|
+
spec.add_dependency "faraday", "~> 0.15"
|
30
|
+
spec.add_development_dependency "bundler", "~> 2.0"
|
31
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
32
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
33
|
+
spec.add_development_dependency "vcr", "~> 5.0"
|
34
|
+
spec.add_development_dependency "webmock", "~> 3.7"
|
35
|
+
end
|
metadata
ADDED
@@ -0,0 +1,166 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: trustdock
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- hachidori, inc.
|
8
|
+
- camelmasa
|
9
|
+
autorequire:
|
10
|
+
bindir: exe
|
11
|
+
cert_chain: []
|
12
|
+
date: 2019-10-23 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: dry-struct
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - "~>"
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '1.0'
|
21
|
+
type: :runtime
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - "~>"
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '1.0'
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: faraday
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - "~>"
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '0.15'
|
35
|
+
type: :runtime
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - "~>"
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '0.15'
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: bundler
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - "~>"
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '2.0'
|
49
|
+
type: :development
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - "~>"
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '2.0'
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: rake
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - "~>"
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '10.0'
|
63
|
+
type: :development
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - "~>"
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '10.0'
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: rspec
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - "~>"
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '3.0'
|
77
|
+
type: :development
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - "~>"
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '3.0'
|
84
|
+
- !ruby/object:Gem::Dependency
|
85
|
+
name: vcr
|
86
|
+
requirement: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - "~>"
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '5.0'
|
91
|
+
type: :development
|
92
|
+
prerelease: false
|
93
|
+
version_requirements: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - "~>"
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '5.0'
|
98
|
+
- !ruby/object:Gem::Dependency
|
99
|
+
name: webmock
|
100
|
+
requirement: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - "~>"
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '3.7'
|
105
|
+
type: :development
|
106
|
+
prerelease: false
|
107
|
+
version_requirements: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - "~>"
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '3.7'
|
112
|
+
description: Ruby client for TRUSTDOCK
|
113
|
+
email:
|
114
|
+
- camelmasa@gmail.com
|
115
|
+
executables: []
|
116
|
+
extensions: []
|
117
|
+
extra_rdoc_files: []
|
118
|
+
files:
|
119
|
+
- ".gitignore"
|
120
|
+
- ".rspec"
|
121
|
+
- ".travis.yml"
|
122
|
+
- Gemfile
|
123
|
+
- Gemfile.lock
|
124
|
+
- LICENSE.txt
|
125
|
+
- README.md
|
126
|
+
- Rakefile
|
127
|
+
- bin/console
|
128
|
+
- bin/setup
|
129
|
+
- fixtures/vcr_cassettes/create_verification.yml
|
130
|
+
- fixtures/vcr_cassettes/update_comparing_data.yml
|
131
|
+
- fixtures/vcr_cassettes/update_document.yml
|
132
|
+
- fixtures/vcr_cassettes/update_plan.yml
|
133
|
+
- fixtures/vcr_cassettes/verification.yml
|
134
|
+
- lib/trustdock.rb
|
135
|
+
- lib/trustdock/client.rb
|
136
|
+
- lib/trustdock/error.rb
|
137
|
+
- lib/trustdock/response/verification.rb
|
138
|
+
- lib/trustdock/version.rb
|
139
|
+
- trustdock.gemspec
|
140
|
+
homepage: https://bitbucket.org/hachidori_develop/trustdock/src/master/
|
141
|
+
licenses:
|
142
|
+
- MIT
|
143
|
+
metadata:
|
144
|
+
homepage_uri: https://bitbucket.org/hachidori_develop/trustdock/src/master/
|
145
|
+
source_code_uri: https://bitbucket.org/hachidori_develop/trustdock/src/master/
|
146
|
+
post_install_message:
|
147
|
+
rdoc_options: []
|
148
|
+
require_paths:
|
149
|
+
- lib
|
150
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
151
|
+
requirements:
|
152
|
+
- - ">="
|
153
|
+
- !ruby/object:Gem::Version
|
154
|
+
version: '0'
|
155
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
requirements: []
|
161
|
+
rubyforge_project:
|
162
|
+
rubygems_version: 2.7.6
|
163
|
+
signing_key:
|
164
|
+
specification_version: 4
|
165
|
+
summary: Ruby client for TRUSTDOCK
|
166
|
+
test_files: []
|