Class: Worldline::Acquiring::SDK::V1::Acquirer::Merchant::Dynamiccurrencyconversion::DynamicCurrencyConversionClient

Inherits:
ApiResource
  • Object
show all
Defined in:
lib/worldline/acquiring/sdk/v1/acquirer/merchant/dynamiccurrencyconversion/dynamic_currency_conversion_client.rb

Overview

DynamicCurrencyConversion client. Thread-safe.

Instance Attribute Summary

Attributes inherited from ApiResource

#communicator

Instance Method Summary collapse

Constructor Details

#initialize(parent, path_context) ⇒ DynamicCurrencyConversionClient

Returns a new instance of DynamicCurrencyConversionClient.

Parameters:



22
23
24
# File 'lib/worldline/acquiring/sdk/v1/acquirer/merchant/dynamiccurrencyconversion/dynamic_currency_conversion_client.rb', line 22

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

Instance Method Details

#request_dcc_rate(body, context = nil) ⇒ Worldline::Acquiring::SDK::V1::Domain::GetDccRateResponse

Resource /services/v1/{acquirerId}/{merchantId}/dcc-rates - Request DCC rate

Parameters:

Returns:

Raises:



39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/worldline/acquiring/sdk/v1/acquirer/merchant/dynamiccurrencyconversion/dynamic_currency_conversion_client.rb', line 39

def request_dcc_rate(body, context = nil)
  uri = instantiate_uri('/services/v1/{acquirerId}/{merchantId}/dcc-rates', nil)
  @communicator.post(
    uri,
nil,
    nil,
    body,
    Worldline::Acquiring::SDK::V1::Domain::GetDccRateResponse,
    context)
rescue Worldline::Acquiring::SDK::Communication::ResponseException => e
  error_type = Worldline::Acquiring::SDK::V1::Domain::ApiPaymentErrorResponse
  error_object = @communicator.marshaller.unmarshal(e.body, error_type)
  raise Worldline::Acquiring::SDK::V1.create_exception(e.status_code, e.body, error_object, context)
end