HubCallbackHandler
in package
implements
HubCallbackHandlerInterface
Class HubCallbackHandler
Interfaces, Classes and Traits
- HubCallbackHandlerInterface
- Interface HubCallbackHandlerInterface
Table of Contents
- $curlRequest : CurlRequest
- Curl Request
- $hubClientKeyConfiguration : HubClientKeyConfigurationInterface
- Hub client key configuration
- $hubServiceFactory : HubServiceFactoryInterface
- Hub service factory
- $ipListUrl : string
- IP-list URL
- $orderStatusColor : string
- Order status Color
- $isLegacyConfiguration : bool
- Indicates legacy mode (old configuration tables)
- __construct() : mixed
- HubCallbackHandler constructor.
- proceedClientKeyCallback() : array<string|int, mixed>
- Stores the hub client key and the shop key, sends a http response code header and returns a json response array.
- proceedCreateOrderStatusCallback() : array<string|int, mixed>
- Inserts a new order status name, sends a http response code header and returns a json response array.
- proceedGetConfiguration() : array<string|int, mixed>
- Reads from gm_configuration with given key, sends a http response code header and returns a json response array.
- proceedSessionKeyCallback() : array<string|int, mixed>
- Stores the hub session key, sends a http response code header and returns a json response array.
- proceedUpdateConfiguration() : array<string|int, mixed>
- Inserts into gm_configuration or updates gm_configuration with given key and value, sends a http response code header and returns a json response array.
- proceedUpdateOrderStatusCallback() : array<string|int, mixed>
- Updates the status of an order, sends a http response code header and resurns a json response array.
- _activateGambioHubPaymentModule() : mixed
- Activates the gambio_hub payment module
- _authByClientKey() : bool
- Authenticates the request with the "X-Client-Key" header.
- _authByHash() : bool
- Authenticates the request with the "X-Auth-Hash" header.
- _deactivateGambioHubPaymentModule() : mixed
- Deactivates the gambio_hub payment module
- _getIpList() : HttpResponse
- Returns the IP list data (either from cache or from a cURL request).
- _isIpValid() : mixed
- Validates the IP.
- _validateCallbackRequest() : $this
- Validate request IP
- clearPayPalSettingsCache() : mixed
Properties
$curlRequest
Curl Request
protected
CurlRequest
$curlRequest
$hubClientKeyConfiguration
Hub client key configuration
protected
HubClientKeyConfigurationInterface
$hubClientKeyConfiguration
$hubServiceFactory
Hub service factory
protected
HubServiceFactoryInterface
$hubServiceFactory
$ipListUrl
IP-list URL
protected
string
$ipListUrl
= ''
$orderStatusColor
Order status Color
protected
string
$orderStatusColor
= '897b65'
$isLegacyConfiguration
Indicates legacy mode (old configuration tables)
private
bool
$isLegacyConfiguration
Methods
__construct()
HubCallbackHandler constructor.
public
__construct(HubServiceFactoryInterface $hubServiceFactory, HubClientKeyConfigurationInterface $hubClientKeyConfiguration, CurlRequest $curlRequest, $ipListUrl) : mixed
Parameters
- $hubServiceFactory : HubServiceFactoryInterface
- $hubClientKeyConfiguration : HubClientKeyConfigurationInterface
- $curlRequest : CurlRequest
- $ipListUrl :
Return values
mixed —proceedClientKeyCallback()
Stores the hub client key and the shop key, sends a http response code header and returns a json response array.
public
proceedClientKeyCallback(string $authHash, string $clientKey, string $shopKey) : array<string|int, mixed>
Parameters
- $authHash : string
- $clientKey : string
- $shopKey : string
Return values
array<string|int, mixed> —Json response array
proceedCreateOrderStatusCallback()
Inserts a new order status name, sends a http response code header and returns a json response array.
public
proceedCreateOrderStatusCallback(string $clientKey, array<string|int, mixed> $orderStatusArray) : array<string|int, mixed>
Parameters
- $clientKey : string
-
Client Key.
- $orderStatusArray : array<string|int, mixed>
-
Order status array.
Return values
array<string|int, mixed> —Json Response Array
proceedGetConfiguration()
Reads from gm_configuration with given key, sends a http response code header and returns a json response array.
public
proceedGetConfiguration(string $clientKey, string $configurationKey) : array<string|int, mixed>
Parameters
- $clientKey : string
-
HubClientKey
- $configurationKey : string
-
Determines which gm_configuration key should be retrieved
Return values
array<string|int, mixed> —Json Response Array
proceedSessionKeyCallback()
Stores the hub session key, sends a http response code header and returns a json response array.
public
proceedSessionKeyCallback(string $authHash, string $sessionKey) : array<string|int, mixed>
Parameters
- $authHash : string
- $sessionKey : string
Return values
array<string|int, mixed> —Json Response Array
proceedUpdateConfiguration()
Inserts into gm_configuration or updates gm_configuration with given key and value, sends a http response code header and returns a json response array.
public
proceedUpdateConfiguration(string $clientKey, string $configurationKey, string $configurationValue) : array<string|int, mixed>
Parameters
- $clientKey : string
-
HubClientKey
- $configurationKey : string
-
Determines which gm_configuration key should be updated
- $configurationValue : string
-
Determines to which value the key should be set
Return values
array<string|int, mixed> —Json Response Array
proceedUpdateOrderStatusCallback()
Updates the status of an order, sends a http response code header and resurns a json response array.
public
proceedUpdateOrderStatusCallback(string $clientKey, int $orderId, int $orderStatusId) : array<string|int, mixed>
Parameters
- $clientKey : string
- $orderId : int
- $orderStatusId : int
Return values
array<string|int, mixed> —Json Response Array
_activateGambioHubPaymentModule()
Activates the gambio_hub payment module
protected
_activateGambioHubPaymentModule() : mixed
Return values
mixed —_authByClientKey()
Authenticates the request with the "X-Client-Key" header.
protected
_authByClientKey(string $clientKey) : bool
Parameters
- $clientKey : string
Return values
bool —The authentication result.
_authByHash()
Authenticates the request with the "X-Auth-Hash" header.
protected
_authByHash(AuthHash $authHash) : bool
Parameters
- $authHash : AuthHash
Return values
bool —The authentication result.
_deactivateGambioHubPaymentModule()
Deactivates the gambio_hub payment module
protected
_deactivateGambioHubPaymentModule() : mixed
Return values
mixed —_getIpList()
Returns the IP list data (either from cache or from a cURL request).
protected
_getIpList([bool $bypassCacheValue = false ]) : HttpResponse
The Hub Connector accepts many callbacks which will trigger many requests to the IP lists file of the Hub servers. In order to save some requests the contents of the IP list must be stored in cache and only be called when no cached data were found.
Parameters
- $bypassCacheValue : bool = false
-
Disable cache when fetching the list.
Return values
HttpResponse —_isIpValid()
Validates the IP.
protected
_isIpValid(array<string|int, mixed> $ipList) : mixed
Parameters
- $ipList : array<string|int, mixed>
Return values
mixed —_validateCallbackRequest()
Validate request IP
protected
_validateCallbackRequest() : $this
Tags
Return values
$this —clearPayPalSettingsCache()
protected
clearPayPalSettingsCache() : mixed