Class: Ingenico::Connect::SDK::Merchant::Products::ProductsClient
- Inherits:
-
ApiResource
- Object
- ApiResource
- Ingenico::Connect::SDK::Merchant::Products::ProductsClient
- Defined in:
- lib/ingenico/connect/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
-
#customer_details(payment_product_id, body, context = nil) ⇒ Object
Resource /{merchantId}/products/{paymentProductId}/customerDetails.
-
#device_fingerprint(payment_product_id, body, context = nil) ⇒ Object
Resource /{merchantId}/products/{paymentProductId}/deviceFingerprint.
-
#directory(payment_product_id, query, context = nil) ⇒ Object
Resource /{merchantId}/products/{paymentProductId}/directory.
-
#find(query, context = nil) ⇒ Object
Resource /{merchantId}/products.
-
#get(payment_product_id, query, context = nil) ⇒ Object
Resource /{merchantId}/products/{paymentProductId}.
-
#initialize(parent, path_context) ⇒ ProductsClient
constructor
- parent
- ApiResource path_context
-
Hash of String to String.
-
#networks(payment_product_id, query, context = nil) ⇒ Object
Resource /{merchantId}/products/{paymentProductId}/networks.
-
#public_key(payment_product_id, context = nil) ⇒ Object
Resource /{merchantId}/products/{paymentProductId}/publicKey.
Constructor Details
#initialize(parent, path_context) ⇒ ProductsClient
- parent
- path_context
-
Hash of String to String
25 26 27 |
# File 'lib/ingenico/connect/sdk/merchant/products/products_client.rb', line 25 def initialize(parent, path_context) super(parent, path_context) end |
Instance Method Details
#customer_details(payment_product_id, body, context = nil) ⇒ Object
Resource /{merchantId}/products/{paymentProductId}/customerDetails
- payment_product_id
-
Integer
- body
- context
- Returns
- Raises
-
ValidationException if the request was not correct and couldn’t be processed (HTTP status code 400)
- Raises
-
AuthorizationException if the request was not allowed (HTTP status code 403)
- Raises
-
IdempotenceException if an idempotent request caused a conflict (HTTP status code 409)
- Raises
-
ReferenceException if an object was attempted to be referenced that doesn’t exist or has been removed,
or there was a conflict (HTTP status code 404, 409 or 410)
- Raises
-
GlobalCollectException if something went wrong at the Ingenico ePayments platform,
the Ingenico ePayments platform was unable to process a message from a downstream partner/acquirer,
or the service that you’re trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
- Raises
-
ApiException if the Ingenico ePayments platform returned any other error
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 |
# File 'lib/ingenico/connect/sdk/merchant/products/products_client.rb', line 140 def customer_details(payment_product_id, body, context=nil) path_context = { 'paymentProductId' => payment_product_id.to_s, } uri = instantiate_uri('/{apiVersion}/{merchantId}/products/{paymentProductId}/customerDetails', path_context) return @communicator.post( uri, client_headers, nil, body, Ingenico::Connect::SDK::Domain::Product::GetCustomerDetailsResponse, context) rescue ResponseException => e error_type = Ingenico::Connect::SDK::Domain::Errors::ErrorResponse error_object = @communicator.marshaller.unmarshal(e.body, error_type) raise create_exception(e.status_code, e.body, error_object, context) end |
#device_fingerprint(payment_product_id, body, context = nil) ⇒ Object
Resource /{merchantId}/products/{paymentProductId}/deviceFingerprint
- payment_product_id
-
Integer
- body
- context
- Returns
- Raises
-
ValidationException if the request was not correct and couldn’t be processed (HTTP status code 400)
- Raises
-
AuthorizationException if the request was not allowed (HTTP status code 403)
- Raises
-
IdempotenceException if an idempotent request caused a conflict (HTTP status code 409)
- Raises
-
ReferenceException if an object was attempted to be referenced that doesn’t exist or has been removed,
or there was a conflict (HTTP status code 404, 409 or 410)
- Raises
-
GlobalCollectException if something went wrong at the Ingenico ePayments platform,
the Ingenico ePayments platform was unable to process a message from a downstream partner/acquirer,
or the service that you’re trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
- Raises
-
ApiException if the Ingenico ePayments platform returned any other error
174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 |
# File 'lib/ingenico/connect/sdk/merchant/products/products_client.rb', line 174 def device_fingerprint(payment_product_id, body, context=nil) path_context = { 'paymentProductId' => payment_product_id.to_s, } uri = instantiate_uri('/{apiVersion}/{merchantId}/products/{paymentProductId}/deviceFingerprint', path_context) return @communicator.post( uri, client_headers, nil, body, Ingenico::Connect::SDK::Domain::Product::DeviceFingerprintResponse, context) rescue ResponseException => e error_type = Ingenico::Connect::SDK::Domain::Errors::ErrorResponse error_object = @communicator.marshaller.unmarshal(e.body, error_type) raise create_exception(e.status_code, e.body, error_object, context) end |
#directory(payment_product_id, query, context = nil) ⇒ Object
Resource /{merchantId}/products/{paymentProductId}/directory
- payment_product_id
-
Integer
- query
- context
- Returns
- Raises
-
ValidationException if the request was not correct and couldn’t be processed (HTTP status code 400)
- Raises
-
AuthorizationException if the request was not allowed (HTTP status code 403)
- Raises
-
IdempotenceException if an idempotent request caused a conflict (HTTP status code 409)
- Raises
-
ReferenceException if an object was attempted to be referenced that doesn’t exist or has been removed,
or there was a conflict (HTTP status code 404, 409 or 410)
- Raises
-
GlobalCollectException if something went wrong at the Ingenico ePayments platform,
the Ingenico ePayments platform was unable to process a message from a downstream partner/acquirer,
or the service that you’re trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
- Raises
-
ApiException if the Ingenico ePayments platform returned any other error
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
# File 'lib/ingenico/connect/sdk/merchant/products/products_client.rb', line 107 def directory(payment_product_id, query, context=nil) path_context = { 'paymentProductId' => payment_product_id.to_s, } uri = instantiate_uri('/{apiVersion}/{merchantId}/products/{paymentProductId}/directory', path_context) return @communicator.get( uri, client_headers, query, Ingenico::Connect::SDK::Domain::Product::Directory, context) rescue ResponseException => e error_type = Ingenico::Connect::SDK::Domain::Errors::ErrorResponse error_object = @communicator.marshaller.unmarshal(e.body, error_type) raise create_exception(e.status_code, e.body, error_object, context) end |
#find(query, context = nil) ⇒ Object
Resource /{merchantId}/products
- query
- context
- Returns
- Raises
-
ValidationException if the request was not correct and couldn’t be processed (HTTP status code 400)
- Raises
-
AuthorizationException if the request was not allowed (HTTP status code 403)
- Raises
-
IdempotenceException if an idempotent request caused a conflict (HTTP status code 409)
- Raises
-
ReferenceException if an object was attempted to be referenced that doesn’t exist or has been removed,
or there was a conflict (HTTP status code 404, 409 or 410)
- Raises
-
GlobalCollectException if something went wrong at the Ingenico ePayments platform,
the Ingenico ePayments platform was unable to process a message from a downstream partner/acquirer,
or the service that you’re trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
- Raises
-
ApiException if the Ingenico ePayments platform returned any other error
44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/ingenico/connect/sdk/merchant/products/products_client.rb', line 44 def find(query, context=nil) uri = instantiate_uri('/{apiVersion}/{merchantId}/products', nil) return @communicator.get( uri, client_headers, query, Ingenico::Connect::SDK::Domain::Product::PaymentProducts, context) rescue ResponseException => e error_type = Ingenico::Connect::SDK::Domain::Errors::ErrorResponse error_object = @communicator.marshaller.unmarshal(e.body, error_type) raise create_exception(e.status_code, e.body, error_object, context) end |
#get(payment_product_id, query, context = nil) ⇒ Object
Resource /{merchantId}/products/{paymentProductId}
- payment_product_id
-
Integer
- query
- context
- Returns
- Raises
-
ValidationException if the request was not correct and couldn’t be processed (HTTP status code 400)
- Raises
-
AuthorizationException if the request was not allowed (HTTP status code 403)
- Raises
-
IdempotenceException if an idempotent request caused a conflict (HTTP status code 409)
- Raises
-
ReferenceException if an object was attempted to be referenced that doesn’t exist or has been removed,
or there was a conflict (HTTP status code 404, 409 or 410)
- Raises
-
GlobalCollectException if something went wrong at the Ingenico ePayments platform,
the Ingenico ePayments platform was unable to process a message from a downstream partner/acquirer,
or the service that you’re trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
- Raises
-
ApiException if the Ingenico ePayments platform returned any other error
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/ingenico/connect/sdk/merchant/products/products_client.rb', line 74 def get(payment_product_id, query, context=nil) path_context = { 'paymentProductId' => payment_product_id.to_s, } uri = instantiate_uri('/{apiVersion}/{merchantId}/products/{paymentProductId}', path_context) return @communicator.get( uri, client_headers, query, Ingenico::Connect::SDK::Domain::Product::PaymentProductResponse, context) rescue ResponseException => e error_type = Ingenico::Connect::SDK::Domain::Errors::ErrorResponse error_object = @communicator.marshaller.unmarshal(e.body, error_type) raise create_exception(e.status_code, e.body, error_object, context) end |
#networks(payment_product_id, query, context = nil) ⇒ Object
Resource /{merchantId}/products/{paymentProductId}/networks
- payment_product_id
-
Integer
- query
- context
- Returns
- Raises
-
ValidationException if the request was not correct and couldn’t be processed (HTTP status code 400)
- Raises
-
AuthorizationException if the request was not allowed (HTTP status code 403)
- Raises
-
IdempotenceException if an idempotent request caused a conflict (HTTP status code 409)
- Raises
-
ReferenceException if an object was attempted to be referenced that doesn’t exist or has been removed,
or there was a conflict (HTTP status code 404, 409 or 410)
- Raises
-
GlobalCollectException if something went wrong at the Ingenico ePayments platform,
the Ingenico ePayments platform was unable to process a message from a downstream partner/acquirer,
or the service that you’re trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
- Raises
-
ApiException if the Ingenico ePayments platform returned any other error
208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 |
# File 'lib/ingenico/connect/sdk/merchant/products/products_client.rb', line 208 def networks(payment_product_id, query, context=nil) path_context = { 'paymentProductId' => payment_product_id.to_s, } uri = instantiate_uri('/{apiVersion}/{merchantId}/products/{paymentProductId}/networks', path_context) return @communicator.get( uri, client_headers, query, Ingenico::Connect::SDK::Domain::Product::PaymentProductNetworksResponse, context) rescue ResponseException => e error_type = Ingenico::Connect::SDK::Domain::Errors::ErrorResponse error_object = @communicator.marshaller.unmarshal(e.body, error_type) raise create_exception(e.status_code, e.body, error_object, context) end |
#public_key(payment_product_id, context = nil) ⇒ Object
Resource /{merchantId}/products/{paymentProductId}/publicKey
Get payment product specific public key
- payment_product_id
-
Integer
- context
- Returns
- Raises
-
ValidationException if the request was not correct and couldn’t be processed (HTTP status code 400)
- Raises
-
AuthorizationException if the request was not allowed (HTTP status code 403)
- Raises
-
IdempotenceException if an idempotent request caused a conflict (HTTP status code 409)
- Raises
-
ReferenceException if an object was attempted to be referenced that doesn’t exist or has been removed,
or there was a conflict (HTTP status code 404, 409 or 410)
- Raises
-
GlobalCollectException if something went wrong at the Ingenico ePayments platform,
the Ingenico ePayments platform was unable to process a message from a downstream partner/acquirer,
or the service that you’re trying to reach is temporary unavailable (HTTP status code 500, 502 or 503)
- Raises
-
ApiException if the Ingenico ePayments platform returned any other error
240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 |
# File 'lib/ingenico/connect/sdk/merchant/products/products_client.rb', line 240 def public_key(payment_product_id, context=nil) path_context = { 'paymentProductId' => payment_product_id.to_s, } uri = instantiate_uri('/{apiVersion}/{merchantId}/products/{paymentProductId}/publicKey', path_context) return @communicator.get( uri, client_headers, nil, Ingenico::Connect::SDK::Domain::Publickey::PublicKey, context) rescue ResponseException => e error_type = Ingenico::Connect::SDK::Domain::Errors::ErrorResponse error_object = @communicator.marshaller.unmarshal(e.body, error_type) raise create_exception(e.status_code, e.body, error_object, context) end |