Class: Ingenico::Connect::SDK::Session
- Inherits:
-
Object
- Object
- Ingenico::Connect::SDK::Session
- Defined in:
- lib/ingenico/connect/sdk/session.rb
Overview
Contains networking and authentication data needed to communicate with the Ingenico ePayments platform
Instance Attribute Summary collapse
-
#api_endpoint ⇒ Object
readonly
The base URI to the Ingenico ePayments platform as a URI object.
-
#authenticator ⇒ Object
readonly
An instance of the Authenticator class used for authenticating messages sent.
-
#connection ⇒ Object
readonly
An instance of the Connection class used to communicate with.
-
#meta_data_provider ⇒ Object
readonly
An instance of the MetaDataProvider class containing information relevant for sending requests.
Instance Method Summary collapse
-
#initialize(api_endpoint, connection, authenticator, meta_data_provider) ⇒ Session
constructor
Construct a new Session.
Constructor Details
#initialize(api_endpoint, connection, authenticator, meta_data_provider) ⇒ Session
Construct a new Session. The session object stores the following:
- api_endpoint
-
The base url to the Ingenico ePayments platform, given as a string and converted to a URI object
- connection
-
An instance of the Connection class used to communicate with
- authenticator
-
An instance of the Authenticator class used for authenticating messages sent
- meta_data_provider
-
An instance of the MetaDataProvider class containing information relevant for sending requests
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/ingenico/connect/sdk/session.rb', line 14 def initialize(api_endpoint, connection, authenticator, ) raise ArgumentError.new('api_endpoint is required') unless api_endpoint raise ArgumentError.new('connection is required') unless connection raise ArgumentError.new('authenticator is required') unless authenticator raise ArgumentError.new('meta_data_provider is required') unless uri = URI(api_endpoint) if uri.path.length > 0 || uri.query || uri.fragment raise ArgumentError.new("Base url should not contain a path, query or fragment #{uri.to_s}") end @api_endpoint = uri @connection = connection @authenticator = authenticator = end |
Instance Attribute Details
#api_endpoint ⇒ Object (readonly)
The base URI to the Ingenico ePayments platform as a URI object
31 32 33 |
# File 'lib/ingenico/connect/sdk/session.rb', line 31 def api_endpoint @api_endpoint end |
#authenticator ⇒ Object (readonly)
An instance of the Authenticator class used for authenticating messages sent
35 36 37 |
# File 'lib/ingenico/connect/sdk/session.rb', line 35 def authenticator @authenticator end |
#connection ⇒ Object (readonly)
An instance of the Connection class used to communicate with
33 34 35 |
# File 'lib/ingenico/connect/sdk/session.rb', line 33 def connection @connection end |
#meta_data_provider ⇒ Object (readonly)
An instance of the MetaDataProvider class containing information relevant for sending requests
37 38 39 |
# File 'lib/ingenico/connect/sdk/session.rb', line 37 def end |