Class: CheckoutSdk::NetworkTokens::NetworkTokensClient

Inherits:
Client
  • Object
show all
Defined in:
lib/checkout_sdk/network_tokens/network_tokens_client.rb

Overview

Client for the Network Tokens API.

Instance Attribute Summary

Attributes inherited from Client

#api_client, #authorization_type, #configuration

Instance Method Summary collapse

Constructor Details

#initialize(api_client, configuration) ⇒ NetworkTokensClient

Returns a new instance of NetworkTokensClient.

Parameters:



14
15
16
# File 'lib/checkout_sdk/network_tokens/network_tokens_client.rb', line 14

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

Instance Method Details

#delete_network_token(network_token_id) ⇒ Object

Soft-delete a Network Token. The API uses PATCH on …/delete.

Parameters:

  • network_token_id (String)


43
44
45
46
47
48
# File 'lib/checkout_sdk/network_tokens/network_tokens_client.rb', line 43

def delete_network_token(network_token_id)
  api_client.invoke_patch(
    build_path(NETWORK_TOKENS, network_token_id, DELETE),
    sdk_authorization
  )
end

#get_network_token(network_token_id) ⇒ Object

Retrieve a Network Token.

Parameters:

  • network_token_id (String)


26
27
28
# File 'lib/checkout_sdk/network_tokens/network_tokens_client.rb', line 26

def get_network_token(network_token_id)
  api_client.invoke_get(build_path(NETWORK_TOKENS, network_token_id), sdk_authorization)
end

#provision_network_token(provision_request) ⇒ Object

Provision a Network Token.

Parameters:



20
21
22
# File 'lib/checkout_sdk/network_tokens/network_tokens_client.rb', line 20

def provision_network_token(provision_request)
  api_client.invoke_post(NETWORK_TOKENS, sdk_authorization, provision_request)
end

#request_cryptograms(network_token_id, cryptogram_request = nil) ⇒ Object

Request a fresh cryptogram for a Network Token (for SCA / fresh payment flows).

Parameters:



33
34
35
36
37
38
39
# File 'lib/checkout_sdk/network_tokens/network_tokens_client.rb', line 33

def request_cryptograms(network_token_id, cryptogram_request = nil)
  api_client.invoke_post(
    build_path(NETWORK_TOKENS, network_token_id, CRYPTOGRAMS),
    sdk_authorization,
    cryptogram_request
  )
end