Exception: Ingenico::Direct::SDK::IdempotenceException

Inherits:
ApiException
  • Object
show all
Defined in:
lib/ingenico/direct/sdk/idempotence_exception.rb

Overview

This exception is thrown when a response from the Ingenico ePayments platform indicates a request with the same idempotence_key was received earlier. The idempotence_request_timestamp indicates the time when the first request with this idempotence_key arrived.

Instance Attribute Summary collapse

Attributes inherited from ApiException

#error_id, #errors, #response_body, #status_code

Instance Method Summary collapse

Methods inherited from ApiException

#to_s

Constructor Details

#initialize(status_code, response_body, error_id, errors, idempotence_key, idempotence_request_timestamp, message = 'the Ingenico ePayments platform returned a duplicate request error response') ⇒ IdempotenceException

Create a new IdempotenceException



13
14
15
16
17
18
19
# File 'lib/ingenico/direct/sdk/idempotence_exception.rb', line 13

def initialize(status_code, response_body, error_id, errors, idempotence_key,
               idempotence_request_timestamp,
               message='the Ingenico ePayments platform returned a duplicate request error response')
  super(status_code, response_body, error_id, errors, message)
  @idempotence_key = idempotence_key
  @idempotence_request_timestamp = idempotence_request_timestamp
end

Instance Attribute Details

#idempotence_keyString (readonly)

The idempotence key used in the request.

Returns:

  • (String)

    the current value of idempotence_key



9
10
11
# File 'lib/ingenico/direct/sdk/idempotence_exception.rb', line 9

def idempotence_key
  @idempotence_key
end

#idempotence_request_timestampInteger (readonly)

A timestamp indicating the arrival time of the request that conflicts with the request just sent.

Returns:

  • (Integer)

    the current value of idempotence_request_timestamp



9
10
11
# File 'lib/ingenico/direct/sdk/idempotence_exception.rb', line 9

def idempotence_request_timestamp
  @idempotence_request_timestamp
end