Class: Worldline::Acquiring::SDK::V1::Acquirer::Merchant::Technicalreversals::TechnicalReversalsClient

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

Overview

TechnicalReversals client. Thread-safe.

Instance Attribute Summary

Attributes inherited from ApiResource

#communicator

Instance Method Summary collapse

Constructor Details

#initialize(parent, path_context) ⇒ TechnicalReversalsClient

Returns a new instance of TechnicalReversalsClient.

Parameters:



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

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

Instance Method Details

#technical_reversal(operation_id, body, context = nil) ⇒ Worldline::Acquiring::SDK::V1::Domain::ApiTechnicalReversalResponse

Resource /processing/v1/{acquirerId}/{merchantId}/operations/{operationId}/reverse - Technical reversal

Parameters:

Returns:

Raises:



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/worldline/acquiring/sdk/v1/acquirer/merchant/technicalreversals/technical_reversals_client.rb', line 40

def technical_reversal(operation_id, body, context = nil)
  path_context = {
    'operationId'.freeze => operation_id,
  }
  uri = instantiate_uri('/processing/v1/{acquirerId}/{merchantId}/operations/{operationId}/reverse', path_context)
  @communicator.post(
    uri,
nil,
    nil,
    body,
    Worldline::Acquiring::SDK::V1::Domain::ApiTechnicalReversalResponse,
    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