Class: Yoti::Sandbox::DocScan::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/yoti_sandbox/doc_scan/client.rb

Overview

Client for the Doc Scan sandbox service

Instance Method Summary collapse

Constructor Details

#initialize(base_url: nil) ⇒ Client

Returns a new instance of Client.

Parameters:

  • base_url (String) (defaults to: nil)


13
14
15
# File 'lib/yoti_sandbox/doc_scan/client.rb', line 13

def initialize(base_url: nil)
  @base_url = base_url || "#{Yoti.configuration.api_url}/sandbox/idverify/v1"
end

Instance Method Details

#configure_application_response(response_config) ⇒ Object

Parameters:

  • response_config (Yoti::SandboxDocScan::Request::ResponseConfig)


36
37
38
39
40
41
42
43
44
45
# File 'lib/yoti_sandbox/doc_scan/client.rb', line 36

def configure_application_response(response_config)
  Yoti::Request
    .builder
    .with_http_method('PUT')
    .with_base_url(@base_url)
    .with_endpoint("apps/#{Yoti.configuration.client_sdk_id}/response-config")
    .with_payload(response_config)
    .build
    .execute
end

#configure_session_response(session_id, response_config) ⇒ Object

Parameters:

  • session_id (String)
  • response_config (Yoti::SandboxDocScan::Request::ResponseConfig)


21
22
23
24
25
26
27
28
29
30
31
# File 'lib/yoti_sandbox/doc_scan/client.rb', line 21

def configure_session_response(session_id, response_config)
  Yoti::Request
    .builder
    .with_http_method('PUT')
    .with_base_url(@base_url)
    .with_endpoint("sessions/#{session_id}/response-config")
    .with_query_param('sdkId', Yoti.configuration.client_sdk_id)
    .with_payload(response_config)
    .build
    .execute
end