Class: Worldline::Connect::SDK::V1::Merchant::Services::ServicesClient

Inherits:
ApiResource
  • Object
show all
Defined in:
lib/worldline/connect/sdk/v1/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

Returns a new instance of ServicesClient.

Parameters:



26
27
28
# File 'lib/worldline/connect/sdk/v1/merchant/services/services_client.rb', line 26

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

Instance Method Details

#bankaccount(body, context = nil) ⇒ Worldline::Connect::SDK::V1::Domain::BankDetailsResponse

Resource /{merchantId}/services/convert/bankaccount - Convert bankaccount

Parameters:

Returns:

Raises:



72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/worldline/connect/sdk/v1/merchant/services/services_client.rb', line 72

def bankaccount(body, context = nil)
  uri = instantiate_uri('/v1/{merchantId}/services/convert/bankaccount', nil)
  @communicator.post(
    uri,
    client_headers,
    nil,
    body,
    Worldline::Connect::SDK::V1::Domain::BankDetailsResponse,
    context)
rescue ResponseException => e
  error_type = Worldline::Connect::SDK::V1::Domain::ErrorResponse
  error_object = @communicator.marshaller.unmarshal(e.body, error_type)
  raise Worldline::Connect::SDK::V1.create_exception(e.status_code, e.body, error_object, context)
end

#convert_amount(query, context = nil) ⇒ Worldline::Connect::SDK::V1::Domain::ConvertAmount

Resource /{merchantId}/services/convert/amount - Convert amount

Parameters:

Returns:

Raises:



44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/worldline/connect/sdk/v1/merchant/services/services_client.rb', line 44

def convert_amount(query, context = nil)
  uri = instantiate_uri('/v1/{merchantId}/services/convert/amount', nil)
  @communicator.get(
    uri,
    client_headers,
    query,
    Worldline::Connect::SDK::V1::Domain::ConvertAmount,
    context)
rescue ResponseException => e
  error_type = Worldline::Connect::SDK::V1::Domain::ErrorResponse
  error_object = @communicator.marshaller.unmarshal(e.body, error_type)
  raise Worldline::Connect::SDK::V1.create_exception(e.status_code, e.body, error_object, context)
end

#get_iin_details(body, context = nil) ⇒ Worldline::Connect::SDK::V1::Domain::GetIINDetailsResponse

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

Parameters:

Returns:

Raises:



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

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

#privacypolicy(query, context = nil) ⇒ Worldline::Connect::SDK::V1::Domain::GetPrivacyPolicyResponse

Resource /{merchantId}/services/privacypolicy - Get privacy policy

Parameters:

Returns:

Raises:



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

def privacypolicy(query, context = nil)
  uri = instantiate_uri('/v1/{merchantId}/services/privacypolicy', nil)
  @communicator.get(
    uri,
    client_headers,
    query,
    Worldline::Connect::SDK::V1::Domain::GetPrivacyPolicyResponse,
    context)
rescue ResponseException => e
  error_type = Worldline::Connect::SDK::V1::Domain::ErrorResponse
  error_object = @communicator.marshaller.unmarshal(e.body, error_type)
  raise Worldline::Connect::SDK::V1.create_exception(e.status_code, e.body, error_object, context)
end

#testconnection(context = nil) ⇒ Worldline::Connect::SDK::V1::Domain::TestConnection

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

Parameters:

Returns:

Raises:



157
158
159
160
161
162
163
164
165
166
167
168
169
# File 'lib/worldline/connect/sdk/v1/merchant/services/services_client.rb', line 157

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