phpDocumentor

HubTransactionsApiClient
in package
implements HubTransactionsApiClientInterface

Class HubTransactionsApiClient

Tags
category

System

subpackage

GambioHub

Interfaces, Classes and Traits

HubTransactionsApiClientInterface
Interface HubTransactionsApiClientInterface

Table of Contents

$cartContentSerializer  : CartContentSerializer
Cart content serializer.
$clientSessionInformationSerializer  : ClientSessionInformationSerializer
Session information serializer.
$customerInformationSerializer  : CustomerInformationSerializer
Customer information serializer.
$hubClientInformationSerializer  : HubClientInformationSerializer
Hub client information serializer.
$hubSettings  : HubSettings
Hub settings
$logControl  : LogControl
Shop logger instance.
$orderContentSerializer  : OrderContentSerializer
Order content serializer.
$request  : CurlRequest
cURL request class.
$sessionKey  : HubSessionKey
Provide a session key for the transactions.
$url  : string
URL to hub endpoint.
__construct()  : mixed
HubTransactionsApiClient constructor.
getAllowedPaymentModules()  : array<string|int, mixed>
Returns an array of allowed payment modules for the respective client.
getBeforeTransactionPageContent()  : string
Returns a string containing html or nothing if payment module has no extra page before confirmation.
getConfirmationContents()  : string
Returns an array of confirmation contents served by the selected payment module.
getTransactionDetails()  : array<string|int, mixed>
Returns the transaction details.
startTransaction()  : string
Starts an transaction and returns the transaction code.

Properties

$clientSessionInformationSerializer

Session information serializer.

protected ClientSessionInformationSerializer $clientSessionInformationSerializer

$customerInformationSerializer

Customer information serializer.

protected CustomerInformationSerializer $customerInformationSerializer

$hubClientInformationSerializer

Hub client information serializer.

protected HubClientInformationSerializer $hubClientInformationSerializer

Methods

__construct()

HubTransactionsApiClient constructor.

public __construct(string $url, HubSessionKey $sessionKey, CurlRequest $request, CartContentSerializer $cartContentSerializer, CustomerInformationSerializer $customerInformationSerializer, HubClientInformationSerializer $hubClientInformationSerializer, ClientSessionInformationSerializer $clientSessionInformationSerializer, OrderContentSerializer $orderContentSerializer, LogControl $logControl, HubSettings $hubSettings) : mixed
Parameters
$url : string

URL to hub endpoint.

$sessionKey : HubSessionKey

An active Gambio Hub session key.

$request : CurlRequest

cURL request class.

$cartContentSerializer : CartContentSerializer

Cart content serializer.

$customerInformationSerializer : CustomerInformationSerializer

Customer information serializer.

$hubClientInformationSerializer : HubClientInformationSerializer

Hub client information serializer.

$clientSessionInformationSerializer : ClientSessionInformationSerializer

Session information serializer.

$orderContentSerializer : OrderContentSerializer

Order content serializer.

$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

getAllowedPaymentModules()

Returns an array of allowed payment modules for the respective client.

public getAllowedPaymentModules(CartContent $cartContent, CustomerInformation $customerInformation, HubClientInformation $hubClientInformation, ClientSessionInformation $clientSessionInformation, array<string|int, mixed> $unallowedModuleCodes) : array<string|int, mixed>
Parameters
$cartContent : CartContent

Cart content.

$customerInformation : CustomerInformation

Customer information.

$hubClientInformation : HubClientInformation

Hub client information.

$clientSessionInformation : ClientSessionInformation

Session information.

$unallowedModuleCodes : array<string|int, mixed>

Array of unallowed module codes.

Tags
throws
UnexpectedValueException

If Hub returns an error response.

Return values
array<string|int, mixed>

Returns an array with the available modules information.

getBeforeTransactionPageContent()

Returns a string containing html or nothing if payment module has no extra page before confirmation.

public getBeforeTransactionPageContent(CartContent $cartContent, CustomerInformation $customerInformation, HubClientInformation $hubClientInformation, ClientSessionInformation $clientSessionInformation, array<string|int, mixed> $getData, array<string|int, mixed> $postData, string $moduleCode) : string
Parameters
$cartContent : CartContent

Cart content.

$customerInformation : CustomerInformation

Customer information.

$hubClientInformation : HubClientInformation

Hub client information.

$clientSessionInformation : ClientSessionInformation

Session information.

$getData : array<string|int, mixed>

GET-Request data.

$postData : array<string|int, mixed>

POST-Request data.

$moduleCode : string

Module Code.

Tags
throws
UnexpectedValueException

If Hub returns an error response.

Return values
string

Returns a string containing html or nothing.

getConfirmationContents()

Returns an array of confirmation contents served by the selected payment module.

public getConfirmationContents(CartContent $cartContent, CustomerInformation $customerInformation, HubClientInformation $hubClientInformation, ClientSessionInformation $clientSessionInformation, array<string|int, mixed> $getData, array<string|int, mixed> $postData, string $moduleCode) : string
Parameters
$cartContent : CartContent

Cart content.

$customerInformation : CustomerInformation

Customer information.

$hubClientInformation : HubClientInformation

Hub client information.

$clientSessionInformation : ClientSessionInformation

Session information.

$getData : array<string|int, mixed>

GET-Request data.

$postData : array<string|int, mixed>

POST-Request data.

$moduleCode : string

Module Code.

Tags
throws
UnexpectedValueException

If Hub returns an error response.

Return values
string

Returns an confirmation contents array.

getTransactionDetails()

Returns the transaction details.

public getTransactionDetails(HubTransactionCode $transactionCode) : array<string|int, mixed>
Parameters
$transactionCode : HubTransactionCode

Transaction code.

Tags
throws
UnexpectedValueException

If Hub returns an error response.

Return values
array<string|int, mixed>

Returns the transaction details.

startTransaction()

Starts an transaction and returns the transaction code.

public startTransaction(HubClientInformation $hubClientInformation, OrderContent $orderContent, ClientSessionInformation $clientSessionInformation) : string
Parameters
$hubClientInformation : HubClientInformation

Hub client information.

$orderContent : OrderContent

Order content.

$clientSessionInformation : ClientSessionInformation

Session information.

Tags
throws
UnexpectedValueException

If Hub returns an error response.

Return values
string

Return the transaction code.

Search results