Class: OnlinePayments::SDK::Merchant::HostedTokenization::HostedTokenizationClient
- Inherits:
-
ApiResource
- Object
- ApiResource
- OnlinePayments::SDK::Merchant::HostedTokenization::HostedTokenizationClient
- Defined in:
- lib/onlinepayments/sdk/merchant/hostedtokenization/hosted_tokenization_client.rb
Overview
HostedTokenization client. Thread-safe.
Instance Attribute Summary
Attributes inherited from ApiResource
#client_meta_info, #communicator
Instance Method Summary collapse
-
#create_hosted_tokenization(body, context = nil) ⇒ OnlinePayments::SDK::Domain::CreateHostedTokenizationResponse
Resource /v2/{merchantId}/hostedtokenizations.
-
#get_hosted_tokenization(hosted_tokenization_id, context = nil) ⇒ OnlinePayments::SDK::Domain::GetHostedTokenizationResponse
Resource /v2/{merchantId}/hostedtokenizations/{hostedTokenizationId}.
-
#initialize(parent, path_context = nil) ⇒ HostedTokenizationClient
constructor
A new instance of HostedTokenizationClient.
Constructor Details
#initialize(parent, path_context = nil) ⇒ HostedTokenizationClient
Returns a new instance of HostedTokenizationClient.
20 21 22 |
# File 'lib/onlinepayments/sdk/merchant/hostedtokenization/hosted_tokenization_client.rb', line 20 def initialize(parent, path_context = nil) super(parent, path_context) end |
Instance Method Details
#create_hosted_tokenization(body, context = nil) ⇒ OnlinePayments::SDK::Domain::CreateHostedTokenizationResponse
Resource /v2/{merchantId}/hostedtokenizations
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/onlinepayments/sdk/merchant/hostedtokenization/hosted_tokenization_client.rb', line 37 def create_hosted_tokenization(body, context = nil) uri = instantiate_uri('/v2/{merchantId}/hostedtokenizations') @communicator.post( uri, client_headers, nil, body, OnlinePayments::SDK::Domain::CreateHostedTokenizationResponse, context ) rescue ResponseException => e error_type = OnlinePayments::SDK::Domain::ErrorResponse error_object = @communicator.marshaller.unmarshal(e.body, error_type) raise create_exception(e.status_code, e.body, error_object, context) end |
#get_hosted_tokenization(hosted_tokenization_id, context = nil) ⇒ OnlinePayments::SDK::Domain::GetHostedTokenizationResponse
Resource /v2/{merchantId}/hostedtokenizations/{hostedTokenizationId}
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/onlinepayments/sdk/merchant/hostedtokenization/hosted_tokenization_client.rb', line 66 def get_hosted_tokenization(hosted_tokenization_id, context = nil) path_context = { 'hostedTokenizationId'.freeze => hosted_tokenization_id, } uri = instantiate_uri('/v2/{merchantId}/hostedtokenizations/{hostedTokenizationId}', path_context) @communicator.get( uri, client_headers, nil, OnlinePayments::SDK::Domain::GetHostedTokenizationResponse, context ) rescue ResponseException => e error_type = OnlinePayments::SDK::Domain::ErrorResponse error_object = @communicator.marshaller.unmarshal(e.body, error_type) raise create_exception(e.status_code, e.body, error_object, context) end |