Class: OnlinePayments::SDK::Merchant::Products::ProductsClient
- Inherits:
-
ApiResource
- Object
- ApiResource
- OnlinePayments::SDK::Merchant::Products::ProductsClient
- Defined in:
- lib/onlinepayments/sdk/merchant/products/products_client.rb
Overview
Products client. Thread-safe.
Instance Attribute Summary
Attributes inherited from ApiResource
#client_meta_info, #communicator
Instance Method Summary collapse
-
#get_payment_product(payment_product_id, query, context = nil) ⇒ OnlinePayments::SDK::Domain::PaymentProduct
Resource /v2/{merchantId}/products/{paymentProductId} - Get payment product.
-
#get_payment_product_networks(payment_product_id, query, context = nil) ⇒ OnlinePayments::SDK::Domain::PaymentProductNetworksResponse
Resource /v2/{merchantId}/products/{paymentProductId}/networks - Get payment product networks.
-
#get_payment_products(query, context = nil) ⇒ OnlinePayments::SDK::Domain::GetPaymentProductsResponse
Resource /v2/{merchantId}/products - Get payment products.
-
#get_product_directory(payment_product_id, query, context = nil) ⇒ OnlinePayments::SDK::Domain::ProductDirectory
Resource /v2/{merchantId}/products/{paymentProductId}/directory - Get payment product directory.
-
#initialize(parent, path_context) ⇒ ProductsClient
constructor
A new instance of ProductsClient.
Constructor Details
#initialize(parent, path_context) ⇒ ProductsClient
Returns a new instance of ProductsClient.
22 23 24 |
# File 'lib/onlinepayments/sdk/merchant/products/products_client.rb', line 22 def initialize(parent, path_context) super(parent: parent, path_context: path_context) end |
Instance Method Details
#get_payment_product(payment_product_id, query, context = nil) ⇒ OnlinePayments::SDK::Domain::PaymentProduct
Resource /v2/{merchantId}/products/{paymentProductId} - Get payment product
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/onlinepayments/sdk/merchant/products/products_client.rb', line 69 def get_payment_product(payment_product_id, query, context = nil) path_context = { 'paymentProductId'.freeze => payment_product_id.to_s, } uri = instantiate_uri('/v2/{merchantId}/products/{paymentProductId}', path_context) @communicator.get( uri, client_headers, query, OnlinePayments::SDK::Domain::PaymentProduct, 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 |
#get_payment_product_networks(payment_product_id, query, context = nil) ⇒ OnlinePayments::SDK::Domain::PaymentProductNetworksResponse
Resource /v2/{merchantId}/products/{paymentProductId}/networks - Get payment product networks
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/onlinepayments/sdk/merchant/products/products_client.rb', line 101 def get_payment_product_networks(payment_product_id, query, context = nil) path_context = { 'paymentProductId'.freeze => payment_product_id.to_s, } uri = instantiate_uri('/v2/{merchantId}/products/{paymentProductId}/networks', path_context) @communicator.get( uri, client_headers, query, OnlinePayments::SDK::Domain::PaymentProductNetworksResponse, 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 |
#get_payment_products(query, context = nil) ⇒ OnlinePayments::SDK::Domain::GetPaymentProductsResponse
Resource /v2/{merchantId}/products - Get payment products
40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/onlinepayments/sdk/merchant/products/products_client.rb', line 40 def get_payment_products(query, context = nil) uri = instantiate_uri('/v2/{merchantId}/products', nil) @communicator.get( uri, client_headers, query, OnlinePayments::SDK::Domain::GetPaymentProductsResponse, 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 |
#get_product_directory(payment_product_id, query, context = nil) ⇒ OnlinePayments::SDK::Domain::ProductDirectory
Resource /v2/{merchantId}/products/{paymentProductId}/directory - Get payment product directory
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 |
# File 'lib/onlinepayments/sdk/merchant/products/products_client.rb', line 133 def get_product_directory(payment_product_id, query, context = nil) path_context = { 'paymentProductId'.freeze => payment_product_id.to_s, } uri = instantiate_uri('/v2/{merchantId}/products/{paymentProductId}/directory', path_context) @communicator.get( uri, client_headers, query, OnlinePayments::SDK::Domain::ProductDirectory, 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 |