Class: Ingenico::Direct::SDK::Merchant::Services::ServicesClient

Inherits:
ApiResource
  • Object
show all
Defined in:
lib/ingenico/direct/sdk/merchant/services/services_client.rb

Overview

Services client. Thread-safe.

Instance Attribute Summary

Attributes inherited from ApiResource

#client_meta_info, #communicator

Instance Method Summary collapse

Constructor Details

#initialize(parent, path_context = nil) ⇒ ServicesClient

Returns a new instance of ServicesClient.

Parameters:



21
22
23
# File 'lib/ingenico/direct/sdk/merchant/services/services_client.rb', line 21

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

Instance Method Details

#get_iin_details(body, context = nil) ⇒ Ingenico::Direct::SDK::Domain::GetIINDetailsResponse

Resource /v2/{merchantId}/services/getIINdetails - Get IIN details

Parameters:

Returns:

Raises:



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/ingenico/direct/sdk/merchant/services/services_client.rb', line 65

def get_iin_details(body, context = nil)
  uri = instantiate_uri('/v2/{merchantId}/services/getIINdetails')
  @communicator.post(
    uri,
    client_headers,
    nil,
    body,
    Ingenico::Direct::SDK::Domain::GetIINDetailsResponse,
    context
  )
rescue ResponseException => e
  error_type = Ingenico::Direct::SDK::Domain::ErrorResponse
  error_object = @communicator.marshaller.unmarshal(e.body, error_type)
  raise create_exception(e.status_code, e.body, error_object, context)
end

#test_connection(context = nil) ⇒ Ingenico::Direct::SDK::Domain::TestConnection

Resource /v2/{merchantId}/services/testconnection - Test connection

Parameters:

Returns:

Raises:



37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/ingenico/direct/sdk/merchant/services/services_client.rb', line 37

def test_connection(context = nil)
  uri = instantiate_uri('/v2/{merchantId}/services/testconnection')
  @communicator.get(
    uri,
    client_headers,
    nil,
    Ingenico::Direct::SDK::Domain::TestConnection,
    context
  )
rescue ResponseException => e
  error_type = Ingenico::Direct::SDK::Domain::ErrorResponse
  error_object = @communicator.marshaller.unmarshal(e.body, error_type)
  raise create_exception(e.status_code, e.body, error_object, context)
end