Class: Ingenico::Connect::SDK::Merchant::Productgroups::ProductgroupsClient

Inherits:
ApiResource
  • Object
show all
Defined in:
lib/ingenico/connect/sdk/merchant/productgroups/productgroups_client.rb

Overview

Productgroups client. Thread-safe.

Instance Attribute Summary

Attributes inherited from ApiResource

#client_meta_info, #communicator

Instance Method Summary collapse

Constructor Details

#initialize(parent, path_context) ⇒ ProductgroupsClient

Returns a new instance of ProductgroupsClient.

Parameters:



21
22
23
# File 'lib/ingenico/connect/sdk/merchant/productgroups/productgroups_client.rb', line 21

def initialize(parent, path_context)
  super(parent, path_context)
end

Instance Method Details

#device_fingerprint(payment_product_group_id, body, context = nil) ⇒ Ingenico::Connect::SDK::Domain::Product::DeviceFingerprintResponse

Resource /{merchantId}/productgroups/{paymentProductGroupId}/deviceFingerprint - Get device fingerprint

Parameters:

Returns:

Raises:



97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# File 'lib/ingenico/connect/sdk/merchant/productgroups/productgroups_client.rb', line 97

def device_fingerprint(payment_product_group_id, body, context=nil)
  path_context = {
    'paymentProductGroupId'.freeze => payment_product_group_id,
  }
  uri = instantiate_uri('/v1/{merchantId}/productgroups/{paymentProductGroupId}/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

#find(query, context = nil) ⇒ Ingenico::Connect::SDK::Domain::Product::PaymentProductGroups

Resource /{merchantId}/productgroups - Get payment product groups

Parameters:

Returns:

Raises:



38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/ingenico/connect/sdk/merchant/productgroups/productgroups_client.rb', line 38

def find(query, context=nil)
  uri = instantiate_uri('/v1/{merchantId}/productgroups', nil)
  return @communicator.get(
    uri,
    client_headers,
    query,
    Ingenico::Connect::SDK::Domain::Product::PaymentProductGroups,
    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_group_id, query, context = nil) ⇒ Ingenico::Connect::SDK::Domain::Product::PaymentProductGroupResponse

Resource /{merchantId}/productgroups/{paymentProductGroupId} - Get payment product group

Parameters:

Returns:

Raises:



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/ingenico/connect/sdk/merchant/productgroups/productgroups_client.rb', line 66

def get(payment_product_group_id, query, context=nil)
  path_context = {
    'paymentProductGroupId'.freeze => payment_product_group_id,
  }
  uri = instantiate_uri('/v1/{merchantId}/productgroups/{paymentProductGroupId}', path_context)
  return @communicator.get(
    uri,
    client_headers,
    query,
    Ingenico::Connect::SDK::Domain::Product::PaymentProductGroupResponse,
    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