HubSessionsApiClient
in package
implements
HubSessionsApiClientInterface
Class HubSessionApiClient
Tags
Interfaces, Classes and Traits
- HubSessionsApiClientInterface
- Interface HubSessionApiClientInterface
Table of Contents
- $clientKeyConfiguration : HubClientKeyConfiguration
- $curlRequest : CurlRequest
- $hubSessionKeyService : HubSessionKeyService
- $hubSettings : HubSettings
- $logControl : LogControl
- $secondsBetweenNotifications : int
- $url : string
- __construct() : mixed
- HubSessionApiClient constructor.
- startSession() : string
- Starts a session in the Gambio Hub.
- _sendUrlChangedNotification() : $this|HubSessionsApiClient
- Sends a request to the hub that the shop url could be changed.
- determineConnectorVersion() : string
- Checks the version_info folder for the latest connector version and returns it
Properties
$clientKeyConfiguration
protected
HubClientKeyConfiguration
$clientKeyConfiguration
$curlRequest
protected
CurlRequest
$curlRequest
$hubSessionKeyService
protected
HubSessionKeyService
$hubSessionKeyService
$hubSettings
protected
HubSettings
$hubSettings
$logControl
protected
LogControl
$logControl
$secondsBetweenNotifications
protected
int
$secondsBetweenNotifications
$url
protected
string
$url
Methods
__construct()
HubSessionApiClient constructor.
public
__construct(string $url, HubSessionKeyService $hubSessionKeyService, HubClientKeyConfiguration $hubClientKeyConfiguration, CurlRequest $curlRequest, LogControl $logControl, HubSettings $hubSettings) : mixed
Parameters
- $url : string
-
Gambio Hub API URL
- $hubSessionKeyService : HubSessionKeyService
-
Used for retrieving the session key.
- $hubClientKeyConfiguration : HubClientKeyConfiguration
-
Stores or retrieves the hub client key from shop configuration.
- $curlRequest : CurlRequest
-
Make cURL requests to the Hub API.
- $logControl : LogControl
-
Log communication error information.
- $hubSettings : HubSettings
-
Hub settings.
Tags
Return values
mixed —startSession()
Starts a session in the Gambio Hub.
public
startSession(AuthHash $authHash, string $shopUrl, LanguageCode $languageCode) : string
Provide an authorization hash that can be later used in the hub callbacks to determine where each session key belongs to. This method will additionally save the AuthHash value to the PHP session with the key 'gambio_hub_auth_hash' for later reference.
Parameters
- $authHash : AuthHash
-
The authorization hash to be used for the session start.
- $shopUrl : string
-
Shop url with trailing slash.
- $languageCode : LanguageCode
Tags
Return values
string —Returns the new session key.
_sendUrlChangedNotification()
Sends a request to the hub that the shop url could be changed.
protected
_sendUrlChangedNotification(string $clientKey) : $this|HubSessionsApiClient
Parameters
- $clientKey : string
-
Client key of the shop.
Tags
Return values
$this|HubSessionsApiClient —Same instance for chained method calls.
determineConnectorVersion()
Checks the version_info folder for the latest connector version and returns it
private
determineConnectorVersion() : string