Class: Ingenico::Connect::SDK::Merchant::Services::ServicesClient

Inherits:
ApiResource
  • Object
show all
Defined in:
lib/ingenico/connect/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) ⇒ ServicesClient

parent

ApiResource

path_context

Hash of String to String



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

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

Instance Method Details

#bankaccount(body, context = nil) ⇒ Object

Resource /{merchantId}/services/convert/bankaccount

Convert bankaccount

body

Domain::Services::BankDetailsRequest

context

CallContext

Returns

Domain::Services::BankDetailsResponse

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



70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/ingenico/connect/sdk/merchant/services/services_client.rb', line 70

def bankaccount(body, context=nil)
  uri = instantiate_uri('/{apiVersion}/{merchantId}/services/convert/bankaccount', nil)
  return @communicator.post(
    uri,
    client_headers,
    nil,
    body,
    Ingenico::Connect::SDK::Domain::Services::BankDetailsResponse,
    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

#convert_amount(query, context = nil) ⇒ Object

Resource /{merchantId}/services/convert/amount

Convert amount

query

ConvertAmountParams

context

CallContext

Returns

Domain::Services::ConvertAmount

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



41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/ingenico/connect/sdk/merchant/services/services_client.rb', line 41

def convert_amount(query, context=nil)
  uri = instantiate_uri('/{apiVersion}/{merchantId}/services/convert/amount', nil)
  return @communicator.get(
    uri,
    client_headers,
    query,
    Ingenico::Connect::SDK::Domain::Services::ConvertAmount,
    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_iin_details(body, context = nil) ⇒ Object

Resource /{merchantId}/services/getIINdetails

Get IIN details

body

Domain::Services::GetIINDetailsRequest

context

CallContext

Returns

Domain::Services::GetIINDetailsResponse

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



100
101
102
103
104
105
106
107
108
109
110
111
112
113
# File 'lib/ingenico/connect/sdk/merchant/services/services_client.rb', line 100

def get_iin_details(body, context=nil)
  uri = instantiate_uri('/{apiVersion}/{merchantId}/services/getIINdetails', nil)
  return @communicator.post(
    uri,
    client_headers,
    nil,
    body,
    Ingenico::Connect::SDK::Domain::Services::GetIINDetailsResponse,
    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

#testconnection(context = nil) ⇒ Object

Resource /{merchantId}/services/testconnection

Test connection

context

CallContext

Returns

Domain::Services::TestConnection

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



129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/ingenico/connect/sdk/merchant/services/services_client.rb', line 129

def testconnection(context=nil)
  uri = instantiate_uri('/{apiVersion}/{merchantId}/services/testconnection', nil)
  return @communicator.get(
    uri,
    client_headers,
    nil,
    Ingenico::Connect::SDK::Domain::Services::TestConnection,
    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