Class: OnlinePayments::SDK::Merchant::PrivacyPolicy::PrivacyPolicyClient
- Inherits:
-
ApiResource
- Object
- ApiResource
- OnlinePayments::SDK::Merchant::PrivacyPolicy::PrivacyPolicyClient
- Defined in:
- lib/onlinepayments/sdk/merchant/privacypolicy/privacy_policy_client.rb
Overview
PrivacyPolicy client. Thread-safe.
Instance Attribute Summary
Attributes inherited from ApiResource
#client_meta_info, #communicator
Instance Method Summary collapse
-
#get_privacy_policy(query, context = nil) ⇒ OnlinePayments::SDK::Domain::GetPrivacyPolicyResponse
Resource /v2/{merchantId}/services/privacypolicy - Get Privacy Policy.
-
#initialize(parent, path_context) ⇒ PrivacyPolicyClient
constructor
A new instance of PrivacyPolicyClient.
Constructor Details
#initialize(parent, path_context) ⇒ PrivacyPolicyClient
Returns a new instance of PrivacyPolicyClient.
19 20 21 |
# File 'lib/onlinepayments/sdk/merchant/privacypolicy/privacy_policy_client.rb', line 19 def initialize(parent, path_context) super(parent: parent, path_context: path_context) end |
Instance Method Details
#get_privacy_policy(query, context = nil) ⇒ OnlinePayments::SDK::Domain::GetPrivacyPolicyResponse
Resource /v2/{merchantId}/services/privacypolicy - Get Privacy Policy
37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/onlinepayments/sdk/merchant/privacypolicy/privacy_policy_client.rb', line 37 def get_privacy_policy(query, context = nil) uri = instantiate_uri('/v2/{merchantId}/services/privacypolicy', nil) @communicator.get( uri, client_headers, query, OnlinePayments::SDK::Domain::GetPrivacyPolicyResponse, context) rescue OnlinePayments::SDK::Communication::ResponseException => e error_type = OnlinePayments::SDK::Domain::ErrorResponse error_object = @communicator.marshaller.unmarshal(e.body, error_type) raise OnlinePayments::SDK.create_exception(e.status_code, e.body, error_object, context) end |