Class: CheckoutSdk::OnboardingSimulator::OnboardingSimulatorClient

Inherits:
Client
  • Object
show all
Defined in:
lib/checkout_sdk/onboarding_simulator/onboarding_simulator_client.rb

Overview

Client for the Onboarding Simulator API (Sandbox only).

All endpoints require OAuth with the ‘accounts` scope. Calling these endpoints in Production returns 404.

Instance Attribute Summary

Attributes inherited from Client

#api_client, #authorization_type, #configuration

Instance Method Summary collapse

Constructor Details

#initialize(api_client, configuration) ⇒ OnboardingSimulatorClient

Returns a new instance of OnboardingSimulatorClient.

Parameters:



19
20
21
# File 'lib/checkout_sdk/onboarding_simulator/onboarding_simulator_client.rb', line 19

def initialize(api_client, configuration)
  super(api_client, configuration, CheckoutSdk::AuthorizationType::OAUTH)
end

Instance Method Details

#list_available_requirementsObject

Returns all requirement fields that can be set as due on an entity.



56
57
58
59
60
61
# File 'lib/checkout_sdk/onboarding_simulator/onboarding_simulator_client.rb', line 56

def list_available_requirements
  api_client.invoke_get(
    build_path(SIMULATE, REQUIREMENTS_DUE),
    sdk_authorization
  )
end

#list_scenariosObject

Returns all pre-defined scenarios available.



64
65
66
67
68
69
# File 'lib/checkout_sdk/onboarding_simulator/onboarding_simulator_client.rb', line 64

def list_scenarios
  api_client.invoke_get(
    build_path(SIMULATE, SCENARIOS),
    sdk_authorization
  )
end

#run_scenario(entity_id, scenario_id) ⇒ Object

Executes a pre-defined scenario against an entity.

Parameters:

  • entity_id (String)
  • scenario_id (String)


37
38
39
40
41
42
# File 'lib/checkout_sdk/onboarding_simulator/onboarding_simulator_client.rb', line 37

def run_scenario(entity_id, scenario_id)
  api_client.invoke_post(
    build_path(SIMULATE, ENTITIES, entity_id, SCENARIOS, scenario_id),
    sdk_authorization
  )
end

#set_entity_status(entity_id, request) ⇒ Object

Forces the entity to the specified status.

Parameters:



47
48
49
50
51
52
53
# File 'lib/checkout_sdk/onboarding_simulator/onboarding_simulator_client.rb', line 47

def set_entity_status(entity_id, request)
  api_client.invoke_post(
    build_path(SIMULATE, ENTITIES, entity_id, STATUS),
    sdk_authorization,
    request
  )
end

#set_requirements_due(entity_id, request) ⇒ Object

Marks the specified requirement fields as due on an entity.

Parameters:



26
27
28
29
30
31
32
# File 'lib/checkout_sdk/onboarding_simulator/onboarding_simulator_client.rb', line 26

def set_requirements_due(entity_id, request)
  api_client.invoke_post(
    build_path(SIMULATE, ENTITIES, entity_id, REQUIREMENTS_DUE),
    sdk_authorization,
    request
  )
end