Class: Ingenico::Direct::SDK::CallContext
- Inherits:
-
Object
- Object
- Ingenico::Direct::SDK::CallContext
- Defined in:
- lib/ingenico/direct/sdk/call_context.rb
Overview
A CallContext is used to identify requests and manage idempotent requests. A CallContext contains the following:
- idempotence_key
-
A randomly generated key used to identify requests
- idempotence_request_timestamp
-
If a previous request arrived with the same idempotence key, this value will be set to a timestamp of that request.
Instance Attribute Summary collapse
-
#idempotence_key ⇒ String
readonly
The idempotence key used to identify this request.
-
#idempotence_request_timestamp ⇒ Integer
If two or more requests arrive at the Ingenico ePayments platform with the same idempotence_key, the idempotence_request_timestamp will be set to the arrival time of the first of these requests.
Instance Method Summary collapse
-
#initialize(idempotence_key = nil) ⇒ CallContext
constructor
A new instance of CallContext.
Constructor Details
#initialize(idempotence_key = nil) ⇒ CallContext
Returns a new instance of CallContext.
19 20 21 |
# File 'lib/ingenico/direct/sdk/call_context.rb', line 19 def initialize(idempotence_key = nil) @idempotence_key = idempotence_key end |
Instance Attribute Details
#idempotence_key ⇒ String (readonly)
The idempotence key used to identify this request. If two requests share the same idempotence_key, they are considered to be the same request and only the first request will be processed.
15 16 17 |
# File 'lib/ingenico/direct/sdk/call_context.rb', line 15 def idempotence_key @idempotence_key end |
#idempotence_request_timestamp ⇒ Integer
If two or more requests arrive at the Ingenico ePayments platform with the same idempotence_key, the idempotence_request_timestamp will be set to the arrival time of the first of these requests.
15 16 17 |
# File 'lib/ingenico/direct/sdk/call_context.rb', line 15 def @idempotence_request_timestamp end |