phpDocumentor

HubClientKeysApiClient
in package
implements HubClientKeysApiClientInterface

Class HubClientKeysApiClient

Tags
category

System

subpackage

GambioHub

Interfaces, Classes and Traits

HubClientKeysApiClientInterface
Interface HubClientKeysApiClientInterface

Table of Contents

$curlRequest  : CurlRequest
$hubClientKeyConfiguration  : HubClientKeyConfigurationInterface
$hubSettings  : HubSettings
$logControl  : LogControl
$shopKeyConfiguration  : HubShopKeyConfigurationInterface
$url  : string
__construct()  : mixed
HubClientKeysApiClient constructor.
createClientKey()  : HubClientKey
Creates a client key in the Gambio Hub.

Properties

Methods

__construct()

HubClientKeysApiClient constructor.

public __construct(string $url, HubShopKeyConfigurationInterface $shopKeyConfiguration, HubClientKeyConfigurationInterface $hubClientKeyConfiguration, CurlRequest $curlRequest, LogControl $logControl, HubSettings $hubSettings) : mixed
Parameters
$url : string

Gambio Hub API URL

$shopKeyConfiguration : HubShopKeyConfigurationInterface

Retrieves the shop key from shop

$hubClientKeyConfiguration : HubClientKeyConfigurationInterface

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
throws
InvalidArgumentException

If the $url argument is not a valid URL.

Return values
mixed

createClientKey()

Creates a client key in the Gambio Hub.

public createClientKey(AuthHash $authHash, string $shopUrl, string $shopVersion) : HubClientKey

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.

$shopUrl : string

Shop URL (with trailing slash).

$shopVersion : string

Current shop version (without leading "v").

Tags
throws
UnexpectedValueException

If the server responses with status code different to 201.

Return values
HubClientKey

Returns the new client key.

Search results