onfido 0.15.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/LICENSE +2 -1
- data/README.md +18 -32
- data/lib/onfido.rb +0 -1
- data/lib/onfido/api.rb +0 -4
- data/lib/onfido/configuration.rb +2 -3
- data/lib/onfido/resource.rb +1 -5
- data/lib/onfido/resources/address.rb +4 -2
- data/lib/onfido/resources/applicant.rb +6 -6
- data/lib/onfido/resources/check.rb +9 -19
- data/lib/onfido/resources/document.rb +11 -11
- data/lib/onfido/resources/live_photo.rb +9 -14
- data/lib/onfido/resources/live_video.rb +5 -8
- data/lib/onfido/resources/report.rb +8 -9
- data/lib/onfido/resources/sdk_token.rb +3 -5
- data/lib/onfido/resources/webhook.rb +7 -9
- data/lib/onfido/version.rb +1 -1
- data/onfido.gemspec +6 -6
- data/spec/integrations/address_spec.rb +1 -0
- data/spec/integrations/applicant_spec.rb +18 -36
- data/spec/integrations/check_spec.rb +13 -67
- data/spec/integrations/document_spec.rb +16 -17
- data/spec/integrations/exceptions_spec.rb +12 -13
- data/spec/integrations/live_photo_spec.rb +12 -13
- data/spec/integrations/live_video_spec.rb +7 -10
- data/spec/integrations/report_spec.rb +11 -13
- data/spec/integrations/sdk_token_spec.rb +5 -5
- data/spec/integrations/webhook_spec.rb +26 -18
- data/spec/onfido/resource_spec.rb +6 -12
- data/spec/onfido_spec.rb +3 -11
- data/spec/support/fake_onfido_api.rb +44 -78
- data/spec/support/fixtures/applicant.json +21 -42
- data/spec/support/fixtures/check.json +4 -4
- data/spec/support/fixtures/checks.json +4 -4
- data/spec/support/fixtures/document.json +2 -2
- data/spec/support/fixtures/documents.json +8 -8
- data/spec/support/fixtures/live_photo.json +3 -3
- data/spec/support/fixtures/live_photos.json +6 -6
- data/spec/support/fixtures/live_video.json +3 -3
- data/spec/support/fixtures/live_videos.json +4 -4
- data/spec/support/fixtures/report.json +4 -4
- data/spec/support/fixtures/reports.json +8 -8
- data/spec/support/fixtures/webhook.json +6 -5
- data/spec/support/fixtures/webhooks.json +17 -12
- metadata +11 -24
- data/lib/onfido/resources/report_type_group.rb +0 -11
- data/spec/integrations/report_type_group_spec.rb +0 -19
- data/spec/support/fixtures/check_with_expanded_reports.json +0 -30
- data/spec/support/fixtures/checks_with_expanded_reports.json +0 -34
- data/spec/support/fixtures/report_type_group.json +0 -25
- data/spec/support/fixtures/report_type_groups.json +0 -30
@@ -4,7 +4,7 @@ describe Onfido::LivePhoto do
|
|
4
4
|
subject(:live_photo) { described_class.new }
|
5
5
|
|
6
6
|
describe '#create' do
|
7
|
-
let(:params) { { file: file } }
|
7
|
+
let(:params) { { applicant_id: '123456', file: file } }
|
8
8
|
|
9
9
|
context 'with a File-like object to upload' do
|
10
10
|
let(:file) { Tempfile.new(['passport', '.jpg']) }
|
@@ -15,7 +15,8 @@ describe Onfido::LivePhoto do
|
|
15
15
|
end
|
16
16
|
|
17
17
|
it 'creates a new photo' do
|
18
|
-
response = live_photo.create(
|
18
|
+
response = live_photo.create(params)
|
19
|
+
|
19
20
|
expect(response['id']).not_to be_nil
|
20
21
|
end
|
21
22
|
end
|
@@ -24,37 +25,35 @@ describe Onfido::LivePhoto do
|
|
24
25
|
let(:file) { 'https://onfido.com/images/photo.jpg' }
|
25
26
|
|
26
27
|
it 'raises an ArgumentError' do
|
27
|
-
expect { live_photo.create(
|
28
|
+
expect { live_photo.create(params) }.
|
28
29
|
to raise_error(ArgumentError, /must be a `File`-like object/)
|
29
30
|
end
|
30
31
|
end
|
31
32
|
end
|
32
33
|
|
33
34
|
describe '#find' do
|
34
|
-
let(:applicant_id) { '1030303-123123-123123' }
|
35
|
-
let(:live_photo_id) { '3538c8f6-fdce-4745-9d34-fc246bc05aa1' }
|
36
|
-
|
37
35
|
it 'returns the expected live photo' do
|
38
|
-
|
36
|
+
live_photo_id = '3538c8f6-fdce-4745-9d34-fc246bc05aa1'
|
37
|
+
response = live_photo.find(live_photo_id)
|
38
|
+
|
39
39
|
expect(response['id']).to eq(live_photo_id)
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
43
|
describe '#all' do
|
44
|
-
let(:applicant_id) { '1030303-123123-123123' }
|
45
|
-
|
46
44
|
it 'returns list of documents' do
|
45
|
+
applicant_id = '1030303-123123-123123'
|
47
46
|
response = live_photo.all(applicant_id)
|
47
|
+
|
48
48
|
expect(response['live_photos']).not_to be_empty
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
52
52
|
describe '#download' do
|
53
|
-
let(:applicant_id) { '1030303-123123-123123' }
|
54
|
-
let(:live_photo_id) { '3538c8f6-fdce-4745-9d34-fc246bc05aa1' }
|
55
|
-
|
56
53
|
it 'returns the file data' do
|
57
|
-
|
54
|
+
live_photo_id = '3538c8f6-fdce-4745-9d34-fc246bc05aa1'
|
55
|
+
response = live_photo.download(live_photo_id)
|
56
|
+
|
58
57
|
expect(response).not_to be_nil
|
59
58
|
end
|
60
59
|
end
|
@@ -2,32 +2,29 @@ require 'tempfile'
|
|
2
2
|
|
3
3
|
describe Onfido::LiveVideo do
|
4
4
|
subject(:live_video) { described_class.new }
|
5
|
+
let(:live_video_id) { 'c9701e9b-83aa-442f-995b-20320ee8fb01' }
|
5
6
|
|
6
7
|
describe '#find' do
|
7
|
-
let(:applicant_id) { '1030303-123123-123123' }
|
8
|
-
let(:live_video_id) { 'c9701e9b-83aa-442f-995b-20320ee8fb01' }
|
9
|
-
|
10
8
|
it 'returns the expected live photo' do
|
11
|
-
response = live_video.find(
|
9
|
+
response = live_video.find(live_video_id)
|
10
|
+
|
12
11
|
expect(response['id']).to eq(live_video_id)
|
13
12
|
end
|
14
13
|
end
|
15
14
|
|
16
15
|
describe '#all' do
|
17
|
-
let(:applicant_id) { '1030303-123123-123123' }
|
18
|
-
|
19
16
|
it 'returns list of documents' do
|
17
|
+
applicant_id = '1030303-123123-123123'
|
20
18
|
response = live_video.all(applicant_id)
|
19
|
+
|
21
20
|
expect(response['live_videos']).not_to be_empty
|
22
21
|
end
|
23
22
|
end
|
24
23
|
|
25
24
|
describe '#download' do
|
26
|
-
let(:applicant_id) { '1030303-123123-123123' }
|
27
|
-
let(:live_video_id) { 'c9701e9b-83aa-442f-995b-20320ee8fb01' }
|
28
|
-
|
29
25
|
it 'returns the file data' do
|
30
|
-
response = live_video.download(
|
26
|
+
response = live_video.download(live_video_id)
|
27
|
+
|
31
28
|
expect(response).not_to be_nil
|
32
29
|
end
|
33
30
|
end
|
@@ -1,38 +1,36 @@
|
|
1
1
|
describe Onfido::Report do
|
2
2
|
subject(:report) { described_class.new }
|
3
|
-
let(:check_id) { '8546921-123123-123123' }
|
4
|
-
|
5
3
|
describe '#find' do
|
6
|
-
let(:report_id) { '6951786-123123-422221' }
|
7
|
-
|
8
4
|
it 'returns a report for an existing check' do
|
9
|
-
|
5
|
+
report_id = '6951786-123123-422221'
|
6
|
+
response = report.find(report_id)
|
7
|
+
|
10
8
|
expect(response['id']).to eq(report_id)
|
11
9
|
end
|
12
10
|
end
|
13
11
|
|
14
12
|
describe '#all' do
|
15
13
|
it 'lists all reports for an existing check' do
|
14
|
+
check_id = '8546921-123123-123123'
|
16
15
|
response = report.all(check_id)
|
16
|
+
|
17
17
|
expect(response['reports'].count).to eq(2)
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
21
|
describe '#resume' do
|
22
|
-
let(:report_id) { '6951786-123123-422221' }
|
23
|
-
let(:check_id) { '1212121-123123-422221' }
|
24
|
-
|
25
22
|
it 'returns a success response' do
|
26
|
-
|
23
|
+
report_id = '6951786-123123-422221'
|
24
|
+
|
25
|
+
expect { report.resume(report_id) }.not_to raise_error
|
27
26
|
end
|
28
27
|
end
|
29
28
|
|
30
29
|
describe '#cancel' do
|
31
|
-
let(:report_id) { '6951786-123123-422221' }
|
32
|
-
let(:check_id) { '1212121-123123-422221' }
|
33
|
-
|
34
30
|
it 'returns a success response' do
|
35
|
-
|
31
|
+
report_id = '6951786-123123-422221'
|
32
|
+
|
33
|
+
expect { report.cancel(report_id) }.not_to raise_error
|
36
34
|
end
|
37
35
|
end
|
38
36
|
end
|
@@ -1,13 +1,13 @@
|
|
1
1
|
describe Onfido::SdkToken do
|
2
2
|
subject(:sdk_token) { described_class.new }
|
3
|
-
let(:applicant_id) { '61f659cb-c90b-4067-808a-6136b5c01351' }
|
4
|
-
let(:referrer) { 'http://*.mywebsite.com/*' }
|
5
3
|
|
6
4
|
describe '#create' do
|
7
|
-
let(:params) { { applicant_id: applicant_id, referrer: referrer } }
|
8
|
-
|
9
5
|
it 'creates a new SDK token for the applicant' do
|
10
|
-
|
6
|
+
applicant_id = '61f659cb-c90b-4067-808a-6136b5c01351'
|
7
|
+
referrer = 'http://*.mywebsite.com/*'
|
8
|
+
|
9
|
+
response = sdk_token.create(applicant_id: applicant_id, referrer: referrer)
|
10
|
+
|
11
11
|
expect(response['token']).not_to be_nil
|
12
12
|
end
|
13
13
|
end
|
@@ -1,35 +1,37 @@
|
|
1
1
|
describe Onfido::Webhook do
|
2
2
|
subject(:webhook) { described_class.new }
|
3
|
-
let(:params) do
|
4
|
-
{
|
5
|
-
"url" => "https://webhookendpoint.url",
|
6
|
-
"enabled" => true,
|
7
|
-
"events" => [
|
8
|
-
"report completion",
|
9
|
-
"report withdrawal",
|
10
|
-
"check completion",
|
11
|
-
"check in progress"
|
12
|
-
]
|
13
|
-
}
|
14
|
-
end
|
15
3
|
|
16
4
|
describe "#create" do
|
17
|
-
|
5
|
+
let(:params) do
|
6
|
+
{
|
7
|
+
url: "https://webhookendpoint.url",
|
8
|
+
enabled: true,
|
9
|
+
events: [
|
10
|
+
"report.completed",
|
11
|
+
"check.completed"
|
12
|
+
]
|
13
|
+
}
|
14
|
+
end
|
15
|
+
|
16
|
+
it "creates the webhook" do
|
18
17
|
response = webhook.create(params)
|
18
|
+
|
19
19
|
expect(response['id']).to_not be_nil
|
20
20
|
end
|
21
21
|
|
22
22
|
it "responds with the right url" do
|
23
23
|
response = webhook.create(params)
|
24
|
-
|
24
|
+
|
25
|
+
expect(response["url"]).to eq params[:url]
|
25
26
|
end
|
26
27
|
end
|
27
28
|
|
28
29
|
describe '#find' do
|
29
|
-
let(:webhook_id) { 'fcb73186-0733-4f6f-9c57-d9d5ef979443' }
|
30
|
-
|
31
30
|
it 'returns the webhook' do
|
31
|
+
webhook_id = 'fcb73186-0733-4f6f-9c57-d9d5ef979443'
|
32
|
+
|
32
33
|
response = webhook.find(webhook_id)
|
34
|
+
|
33
35
|
expect(response['id']).to eq(webhook_id)
|
34
36
|
end
|
35
37
|
end
|
@@ -37,11 +39,13 @@ describe Onfido::Webhook do
|
|
37
39
|
describe "#all" do
|
38
40
|
it "returns all the registered webhooks" do
|
39
41
|
response = webhook.all
|
42
|
+
|
40
43
|
expect(response["webhooks"].count).to eq 2
|
41
44
|
end
|
42
45
|
|
43
46
|
it "returns with id" do
|
44
47
|
response = webhook.all
|
48
|
+
|
45
49
|
expect(response["webhooks"][0]["id"]).to_not be_nil
|
46
50
|
expect(response["webhooks"][1]["id"]).to_not be_nil
|
47
51
|
end
|
@@ -53,13 +57,17 @@ describe Onfido::Webhook do
|
|
53
57
|
end
|
54
58
|
|
55
59
|
let(:request_body) { '{"foo":"bar"}' }
|
56
|
-
let(:request_signature)
|
60
|
+
let(:request_signature) do
|
61
|
+
'89e60408fec20bfb26bb0f993d5e88307818982f50f23b361a00d679bae8b1dc'
|
62
|
+
end
|
57
63
|
let(:token) { 'very_secret_token' }
|
58
64
|
|
59
65
|
it { is_expected.to be(true) }
|
60
66
|
|
61
67
|
context "with an invalid signature" do
|
62
|
-
let(:request_signature)
|
68
|
+
let(:request_signature) do
|
69
|
+
's21fd54ew2w1f5d15642132f3d7727ff9a32a7c87072ce514df1f6d3228bec'
|
70
|
+
end
|
63
71
|
it { is_expected.to be(false) }
|
64
72
|
end
|
65
73
|
|
@@ -3,7 +3,7 @@ require 'onfido/errors/connection_error'
|
|
3
3
|
describe Onfido::Resource do
|
4
4
|
subject(:resource) { described_class.new }
|
5
5
|
|
6
|
-
let(:endpoint) { 'https://api.onfido.com/
|
6
|
+
let(:endpoint) { 'https://api.onfido.com/v3/' }
|
7
7
|
let(:path) { 'addresses/pick' }
|
8
8
|
let(:url) { endpoint + path }
|
9
9
|
let(:payload) { { postcode: 'SE1 4NG' } }
|
@@ -25,18 +25,12 @@ describe Onfido::Resource do
|
|
25
25
|
before { allow(Onfido).to receive(:endpoint).and_return(endpoint) }
|
26
26
|
before { allow(Onfido).to receive(:api_key).and_return(api_key) }
|
27
27
|
|
28
|
-
describe '#url_for' do
|
29
|
-
it 'composes the full api url' do
|
30
|
-
expect(resource.url_for(path)).to eq(endpoint + path)
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
28
|
describe '#method_missing' do
|
35
29
|
%i(patch).each do |method|
|
36
30
|
context "for unsupported HTTP method: #{method}" do
|
37
31
|
it 'raises an error' do
|
38
32
|
expect do
|
39
|
-
resource.public_send(method,
|
33
|
+
resource.public_send(method, path: endpoint)
|
40
34
|
end.to raise_error(NoMethodError)
|
41
35
|
end
|
42
36
|
end
|
@@ -64,7 +58,7 @@ describe Onfido::Resource do
|
|
64
58
|
let(:specific_api_key) { "specific_key" }
|
65
59
|
|
66
60
|
it "uses that key when making the request" do
|
67
|
-
resource.get(
|
61
|
+
resource.get(path: path, payload: payload)
|
68
62
|
|
69
63
|
expect(WebMock).to have_requested(:get, url).with(
|
70
64
|
headers: {
|
@@ -79,7 +73,7 @@ describe Onfido::Resource do
|
|
79
73
|
let(:specific_api_key) { nil }
|
80
74
|
|
81
75
|
it "uses the general config key when making the request" do
|
82
|
-
resource.get(
|
76
|
+
resource.get(path: path, payload: payload)
|
83
77
|
|
84
78
|
expect(WebMock).to have_requested(:get, url).with(
|
85
79
|
headers: {
|
@@ -113,7 +107,7 @@ describe Onfido::Resource do
|
|
113
107
|
end
|
114
108
|
|
115
109
|
it 'makes a request to an endpoint' do
|
116
|
-
expect(resource.public_send(method,
|
110
|
+
expect(resource.public_send(method, path: path, payload: payload)).
|
117
111
|
to eq(response)
|
118
112
|
end
|
119
113
|
end
|
@@ -127,7 +121,7 @@ describe Onfido::Resource do
|
|
127
121
|
end
|
128
122
|
|
129
123
|
it "raises a ConnectionError" do
|
130
|
-
expect { resource.public_send(method,
|
124
|
+
expect { resource.public_send(method, path: path, payload: payload) }.
|
131
125
|
to raise_error(Onfido::ConnectionError)
|
132
126
|
end
|
133
127
|
end
|
data/spec/onfido_spec.rb
CHANGED
@@ -11,7 +11,7 @@ describe Onfido do
|
|
11
11
|
|
12
12
|
describe ".endpoint" do
|
13
13
|
subject { onfido.endpoint }
|
14
|
-
it { is_expected.to eq('https://api.onfido.com/
|
14
|
+
it { is_expected.to eq('https://api.onfido.com/v3/') }
|
15
15
|
end
|
16
16
|
|
17
17
|
describe ".logger" do
|
@@ -27,18 +27,10 @@ describe Onfido do
|
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
|
-
describe "setting the API version" do
|
31
|
-
it 'changes the configuration to the new value' do
|
32
|
-
onfido.api_version = 'v1'
|
33
|
-
expect(onfido.api_version).to eq('v1')
|
34
|
-
expect(onfido.endpoint).to eq('https://api.onfido.com/v1/')
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
30
|
describe 'using the US region' do
|
39
31
|
it 'should change endpoint' do
|
40
32
|
onfido.region = 'us'
|
41
|
-
expect(onfido.endpoint).to eq('https://api.us.onfido.com/
|
33
|
+
expect(onfido.endpoint).to eq('https://api.us.onfido.com/v3/')
|
42
34
|
end
|
43
35
|
end
|
44
36
|
|
@@ -53,7 +45,7 @@ describe Onfido do
|
|
53
45
|
describe 'using an old API token' do
|
54
46
|
it 'should use old endpoint' do
|
55
47
|
onfido.api_key = "live_asdfghjkl1234567890qwertyuiop"
|
56
|
-
expect(onfido.endpoint).to eq('https://api.onfido.com/
|
48
|
+
expect(onfido.endpoint).to eq('https://api.onfido.com/v3/')
|
57
49
|
end
|
58
50
|
end
|
59
51
|
|
@@ -1,32 +1,32 @@
|
|
1
1
|
require 'sinatra/base'
|
2
2
|
|
3
3
|
class FakeOnfidoAPI < Sinatra::Base
|
4
|
-
get '/
|
4
|
+
get '/v3/addresses/pick' do
|
5
5
|
json_response(200, 'addresses.json')
|
6
6
|
end
|
7
7
|
|
8
|
-
post '/
|
8
|
+
post '/v3/applicants' do
|
9
9
|
json_response(201, 'applicant.json')
|
10
10
|
end
|
11
11
|
|
12
|
-
put '/
|
12
|
+
put '/v3/applicants/:id' do
|
13
13
|
json_response(200, 'applicant.json')
|
14
14
|
end
|
15
15
|
|
16
|
-
get '/
|
16
|
+
get '/v3/applicants/:id' do
|
17
17
|
json_response(200, 'applicant.json')
|
18
18
|
end
|
19
19
|
|
20
|
-
get '/
|
20
|
+
get '/v3/applicants' do
|
21
21
|
response = json_response(200, 'applicants.json')
|
22
22
|
{ applicants: JSON.parse(response)['applicants'][pagination_range] }.to_json
|
23
23
|
end
|
24
24
|
|
25
|
-
delete '/
|
25
|
+
delete '/v3/applicants/:id' do
|
26
26
|
status 204
|
27
27
|
end
|
28
28
|
|
29
|
-
post '/
|
29
|
+
post '/v3/applicants/:id/restore' do
|
30
30
|
if params["id"] == "a2fb9c62-ab10-4898-a8ec-342c4b552ad5"
|
31
31
|
json_response(422, 'not_scheduled_for_deletion_error.json')
|
32
32
|
else
|
@@ -34,37 +34,33 @@ class FakeOnfidoAPI < Sinatra::Base
|
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
|
-
post '/
|
37
|
+
post '/v3/documents' do
|
38
38
|
json_response(201, 'document.json')
|
39
39
|
end
|
40
40
|
|
41
|
-
get '/
|
41
|
+
get '/v3/documents/:id' do
|
42
42
|
json_response(200, 'document.json')
|
43
43
|
end
|
44
44
|
|
45
|
-
get '/
|
45
|
+
get '/v3/documents' do
|
46
46
|
json_response(200, 'documents.json')
|
47
47
|
end
|
48
48
|
|
49
|
-
get '/
|
49
|
+
get '/v3/documents/:id/download' do
|
50
50
|
status 200
|
51
51
|
content_type 'application/octet-stream'
|
52
52
|
"\x01\x02\x03" # acts as binary file data
|
53
53
|
end
|
54
54
|
|
55
|
-
post '/
|
55
|
+
post '/v3/live_photos' do
|
56
56
|
json_response(201, 'live_photo.json')
|
57
57
|
end
|
58
58
|
|
59
|
-
get '/
|
60
|
-
|
61
|
-
status 404
|
62
|
-
else
|
63
|
-
json_response(200, 'live_photo.json')
|
64
|
-
end
|
59
|
+
get '/v3/live_photos/:id' do
|
60
|
+
json_response(200, 'live_photo.json')
|
65
61
|
end
|
66
62
|
|
67
|
-
get '/
|
63
|
+
get '/v3/live_photos' do
|
68
64
|
if params["applicant_id"] != "1030303-123123-123123"
|
69
65
|
status 404
|
70
66
|
else
|
@@ -72,25 +68,17 @@ class FakeOnfidoAPI < Sinatra::Base
|
|
72
68
|
end
|
73
69
|
end
|
74
70
|
|
75
|
-
get '/
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
status 200
|
80
|
-
content_type 'image/jpeg'
|
81
|
-
"\x01\x02\x03" # acts as binary file data
|
82
|
-
end
|
71
|
+
get '/v3/live_photos/:id/download' do
|
72
|
+
status 200
|
73
|
+
content_type 'image/jpeg'
|
74
|
+
"\x01\x02\x03" # acts as binary file data
|
83
75
|
end
|
84
76
|
|
85
|
-
get '/
|
86
|
-
|
87
|
-
status 404
|
88
|
-
else
|
89
|
-
json_response(200, 'live_video.json')
|
90
|
-
end
|
77
|
+
get '/v3/live_videos/:id' do
|
78
|
+
json_response(200, 'live_video.json')
|
91
79
|
end
|
92
80
|
|
93
|
-
get '/
|
81
|
+
get '/v3/live_videos' do
|
94
82
|
if params["applicant_id"] != "1030303-123123-123123"
|
95
83
|
status 404
|
96
84
|
else
|
@@ -98,91 +86,69 @@ class FakeOnfidoAPI < Sinatra::Base
|
|
98
86
|
end
|
99
87
|
end
|
100
88
|
|
101
|
-
get '/
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
status 200
|
106
|
-
content_type 'video/quicktime'
|
107
|
-
"\x01\x02\x03" # acts as binary file data
|
108
|
-
end
|
89
|
+
get '/v3/live_videos/:id/download' do
|
90
|
+
status 200
|
91
|
+
content_type 'video/quicktime'
|
92
|
+
"\x01\x02\x03" # acts as binary file data
|
109
93
|
end
|
110
94
|
|
111
|
-
post '/
|
112
|
-
json_response(201, 'check.json')
|
95
|
+
post '/v3/checks' do
|
96
|
+
params["applicant_id"].nil? ? status(422) : json_response(201, 'check.json')
|
113
97
|
end
|
114
98
|
|
115
|
-
get '/
|
116
|
-
|
117
|
-
json_response(200, "check_with_expanded_reports.json")
|
118
|
-
else
|
119
|
-
json_response(200, "check.json")
|
120
|
-
end
|
99
|
+
get '/v3/checks/:id' do
|
100
|
+
json_response(200, "check.json")
|
121
101
|
end
|
122
102
|
|
123
|
-
get '/
|
124
|
-
|
125
|
-
json_response(200, "checks_with_expanded_reports.json")
|
126
|
-
else
|
127
|
-
json_response(200, "checks.json")
|
128
|
-
end
|
129
|
-
|
130
|
-
{ checks: JSON.parse(response)['checks'][pagination_range] }.to_json
|
103
|
+
get '/v3/checks' do
|
104
|
+
json_response(200, "checks.json")
|
131
105
|
end
|
132
106
|
|
133
|
-
post '/
|
107
|
+
post '/v3/checks/:id/resume' do
|
134
108
|
status 204 # no_content
|
135
109
|
end
|
136
110
|
|
137
|
-
get '/
|
111
|
+
get '/v3/reports' do
|
138
112
|
json_response(200, 'reports.json')
|
139
113
|
end
|
140
114
|
|
141
|
-
get '/
|
115
|
+
get '/v3/reports/:id' do
|
142
116
|
json_response(200, 'report.json')
|
143
117
|
end
|
144
118
|
|
145
|
-
post '/
|
119
|
+
post '/v3/reports/:id/resume' do
|
146
120
|
status 204
|
147
121
|
end
|
148
122
|
|
149
|
-
post '/
|
123
|
+
post '/v3/reports/:id/cancel' do
|
150
124
|
status 204
|
151
125
|
end
|
152
126
|
|
153
|
-
|
154
|
-
json_response(200, 'report_type_group.json')
|
155
|
-
end
|
156
|
-
|
157
|
-
get '/v2/report_type_groups' do
|
158
|
-
json_response(200, 'report_type_groups.json')
|
159
|
-
end
|
160
|
-
|
161
|
-
post '/v2/sdk_token' do
|
127
|
+
post '/v3/sdk_token' do
|
162
128
|
json_response(201, 'sdk_token.json')
|
163
129
|
end
|
164
130
|
|
165
|
-
post '/
|
131
|
+
post '/v3/webhooks' do
|
166
132
|
json_response(201, 'webhook.json')
|
167
133
|
end
|
168
134
|
|
169
|
-
get '/
|
135
|
+
get '/v3/webhooks/:id' do
|
170
136
|
json_response(200, 'webhook.json')
|
171
137
|
end
|
172
138
|
|
173
|
-
get '/
|
139
|
+
get '/v3/webhooks' do
|
174
140
|
json_response(200, 'webhooks.json')
|
175
141
|
end
|
176
142
|
|
177
|
-
get '/
|
143
|
+
get '/v3/4xx_response' do
|
178
144
|
json_response(422, '4xx_response.json')
|
179
145
|
end
|
180
146
|
|
181
|
-
get '/
|
147
|
+
get '/v3/unexpected_error_format' do
|
182
148
|
json_response(400, 'unexpected_error_format.json')
|
183
149
|
end
|
184
150
|
|
185
|
-
get '/
|
151
|
+
get '/v3/unparseable_response' do
|
186
152
|
content_type :json
|
187
153
|
status 504
|
188
154
|
''
|