Class: CheckoutSdk::Forward::ForwardClient

Inherits:
Client
  • Object
show all
Defined in:
lib/checkout_sdk/forward/forward_client.rb

Instance Attribute Summary

Attributes inherited from Client

#api_client, #authorization_type, #configuration

Instance Method Summary collapse

Constructor Details

#initialize(api_client, configuration) ⇒ ForwardClient

Returns a new instance of ForwardClient.

Parameters:



12
13
14
# File 'lib/checkout_sdk/forward/forward_client.rb', line 12

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

Instance Method Details

#create_secret(create_secret_request) ⇒ Object

Parameters:



27
28
29
30
31
# File 'lib/checkout_sdk/forward/forward_client.rb', line 27

def create_secret(create_secret_request)
  api_client.invoke_post(build_path(FORWARD, SECRETS),
                         sdk_authorization,
                         create_secret_request)
end

#delete_secret(name) ⇒ Object

Parameters:

  • name (String)


46
47
48
49
# File 'lib/checkout_sdk/forward/forward_client.rb', line 46

def delete_secret(name)
  api_client.invoke_delete(build_path(FORWARD, SECRETS, name),
                           sdk_authorization)
end

#forward_request(forward_request) ⇒ Object

Parameters:

  • forward_request (Hash)


17
18
19
# File 'lib/checkout_sdk/forward/forward_client.rb', line 17

def forward_request(forward_request)
  api_client.invoke_post(build_path(FORWARD), sdk_authorization, forward_request)
end

#get(forward_id) ⇒ Object

Parameters:

  • forward_id (String)


22
23
24
# File 'lib/checkout_sdk/forward/forward_client.rb', line 22

def get(forward_id)
  api_client.invoke_get(build_path(FORWARD, forward_id), sdk_authorization)
end

#get_secretsObject



33
34
35
# File 'lib/checkout_sdk/forward/forward_client.rb', line 33

def get_secrets
  api_client.invoke_get(build_path(FORWARD, SECRETS), sdk_authorization)
end

#update_secret(name, update_secret_request) ⇒ Object

Parameters:



39
40
41
42
43
# File 'lib/checkout_sdk/forward/forward_client.rb', line 39

def update_secret(name, update_secret_request)
  api_client.invoke_patch(build_path(FORWARD, SECRETS, name),
                          sdk_authorization,
                          update_secret_request)
end