EPG PHP SDK
Loading...
Searching...
No Matches
CreateRedirectionRequest Class Reference

Public Member Functions

 __construct (callable $ivGenerator=null)
 
 initRedirectionPaymentRequest (int $merchantId, string $merchantPassword, array $otherConfigurations, bool|null $production, string|null $baseUrl)
 Initializes the payment request with necessary parameters.
 
 encryption ()
 Encrypts the request data using AES-256-CBC encryption.
 
 requestCurl (string $url, array $data_url, array $headers)
 
 sendRequest ()
 Sends the encrypted request to the Addon Payments API and processes the response.
 
 getHttpQuery ()
 Gets the HTTP query string of the request.
 
 getFormattedReq ()
 Gets the formatted request data.
 
 getOtherConfigurations ()
 Gets the payment request data.
 
 getEncryptedRequest ()
 Gets the encrypted request data.
 
 getResponse ()
 Retrieves the response of the Hosted request.
 

Public Attributes

int $merchantId = null
 
string $merchantPassword = ''
 
string $httpQuery = ''
 
string $formattedRequest = null
 
string $iv = null
 
string $base64Iv = null
 
string $encryptedRequest = null
 
string $signature = null
 
string $redirectUrl = null
 

Constructor & Destructor Documentation

◆ __construct()

__construct ( callable  $ivGenerator = null)

Member Function Documentation

◆ encryption()

encryption ( )

Encrypts the request data using AES-256-CBC encryption.

This method generates an IV (initialization vector) and encrypts the request data along with it. It also computes a SHA256 hash signature of the formatted request data.

Exceptions

Exception If encryption fails or IV generation fails.

@psalm-suppress TypeDoesNotContainType

◆ getEncryptedRequest()

getEncryptedRequest ( )

Gets the encrypted request data.

Returns
string|null Returns the encrypted request data or null if not set.

◆ getFormattedReq()

getFormattedReq ( )

Gets the formatted request data.

Returns
string|null Returns the formatted request data or null if not set.

◆ getHttpQuery()

getHttpQuery ( )

Gets the HTTP query string of the request.

Returns
string|bool Returns the HTTP query string or false if not set.

◆ getOtherConfigurations()

getOtherConfigurations ( )

Gets the payment request data.

Returns
array Returns payment request data array.

◆ getResponse()

getResponse ( )

Retrieves the response of the Hosted request.

Returns
Response|null The response or null if not set.

◆ initRedirectionPaymentRequest()

initRedirectionPaymentRequest ( int  $merchantId,
string  $merchantPassword,
array  $otherConfigurations,
bool|null  $production,
string|null  $baseUrl 
)

Initializes the payment request with necessary parameters.

Parameters
int$merchantIdMerchant ID provided by the Addon Payments platform.
string$merchantPasswordMerchant password for authentication.
array$otherConfigurationsAdditional configurations for the request.
bool | null$productionFlag to indicate if the environment is production or staging.
string | null$baseUrlBase URL for the API requests.

◆ requestCurl()

requestCurl ( string  $url,
array  $data_url,
array  $headers 
)

◆ sendRequest()

sendRequest ( )

Sends the encrypted request to the Addon Payments API and processes the response.

This method constructs the full request with headers and encrypted data, sends it using cURL, and processes the response.

Returns
array Contains the result and response data from the API.
Exceptions
NetworkExceptionIf a network-related error occurs.

Exception If response handling fails or no response data is received.

Member Data Documentation

◆ $base64Iv

string $base64Iv = null

◆ $encryptedRequest

string $encryptedRequest = null

◆ $formattedRequest

string $formattedRequest = null

◆ $httpQuery

string $httpQuery = ''

◆ $iv

string $iv = null

◆ $merchantId

int $merchantId = null

◆ $merchantPassword

string $merchantPassword = ''

◆ $redirectUrl

string $redirectUrl = null

◆ $signature

string $signature = null

The documentation for this class was generated from the following file: