Class: CheckoutSdk::Tokens::TokensClient
- Defined in:
- lib/checkout_sdk/tokens/tokens_client.rb
Instance Attribute Summary
Attributes inherited from Client
#api_client, #authorization_type, #configuration
Instance Method Summary collapse
-
#get_token_metadata(token_id) ⇒ Object
Returns the details for an active token without consuming it.
-
#initialize(api_client, configuration) ⇒ TokensClient
constructor
A new instance of TokensClient.
- #request_token(token_request) ⇒ Object
Constructor Details
#initialize(api_client, configuration) ⇒ TokensClient
Returns a new instance of TokensClient.
11 12 13 |
# File 'lib/checkout_sdk/tokens/tokens_client.rb', line 11 def initialize(api_client, configuration) super(api_client, configuration, CheckoutSdk::AuthorizationType::PUBLIC_KEY) end |
Instance Method Details
#get_token_metadata(token_id) ⇒ Object
Returns the details for an active token without consuming it. The token remains usable after this call. Requires SecretKey or OAuth (not PublicKey).
24 25 26 27 28 29 |
# File 'lib/checkout_sdk/tokens/tokens_client.rb', line 24 def (token_id) api_client.invoke_get( build_path(TOKENS, token_id, 'metadata'), (CheckoutSdk::AuthorizationType::SECRET_KEY_OR_OAUTH) ) end |
#request_token(token_request) ⇒ Object
16 17 18 |
# File 'lib/checkout_sdk/tokens/tokens_client.rb', line 16 def request_token(token_request) api_client.invoke_post(TOKENS, , token_request) end |