Class: Ingenico::Direct::SDK::Merchant::Sessions::SessionsClient
- Inherits:
-
ApiResource
- Object
- ApiResource
- Ingenico::Direct::SDK::Merchant::Sessions::SessionsClient
- Defined in:
- lib/ingenico/direct/sdk/merchant/sessions/sessions_client.rb
Overview
Sessions client. Thread-safe.
Instance Attribute Summary
Attributes inherited from ApiResource
#client_meta_info, #communicator
Instance Method Summary collapse
-
#create_session(body, context = nil) ⇒ Ingenico::Direct::SDK::Domain::SessionResponse
Resource /v2/{merchantId}/sessions - Create session.
-
#initialize(parent, path_context = nil) ⇒ SessionsClient
constructor
A new instance of SessionsClient.
Constructor Details
#initialize(parent, path_context = nil) ⇒ SessionsClient
Returns a new instance of SessionsClient.
20 21 22 |
# File 'lib/ingenico/direct/sdk/merchant/sessions/sessions_client.rb', line 20 def initialize(parent, path_context = nil) super(parent, path_context) end |
Instance Method Details
#create_session(body, context = nil) ⇒ Ingenico::Direct::SDK::Domain::SessionResponse
Resource /v2/{merchantId}/sessions - Create session
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/ingenico/direct/sdk/merchant/sessions/sessions_client.rb', line 37 def create_session(body, context = nil) uri = instantiate_uri('/v2/{merchantId}/sessions') @communicator.post( uri, client_headers, nil, body, Ingenico::Direct::SDK::Domain::SessionResponse, context ) rescue ResponseException => e error_type = Ingenico::Direct::SDK::Domain::ErrorResponse error_object = @communicator.marshaller.unmarshal(e.body, error_type) raise create_exception(e.status_code, e.body, error_object, context) end |