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

Public Member Functions

 __construct (callable $ivGenerator=null)
 
 initH2hPaymentRequest (int $merchantId, string $merchantPassword, array $otherConfigurations, bool|null $production, string|null $baseUrl)
 Initializes an H2H payment request with the necessary parameters.
 
 encryption ()
 Encrypts the H2H request data for secure transmission.
 
 requestCurl (string $url, array $data_url, array $headers)
 
 sendRequest ()
 Sends the H2H request to the configured URL.
 
 getHttpQuery ()
 Gets the HTTP query string of the request.
 
 getFormattedReq ()
 Gets the formatted request string.
 
 getOtherConfigurations ()
 Gets the payment request data.
 
 getEncryptedRequest ()
 Gets the encrypted request string.
 
 getResponse ()
 Retrieves the response of the refund 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
 
mixed $response = null
 

Constructor & Destructor Documentation

◆ __construct()

__construct ( callable  $ivGenerator = null)

Member Function Documentation

◆ encryption()

encryption ( )

Encrypts the H2H request data for secure transmission.

Exceptions

Exception If encryption fails or IV generation fails.

@psalm-suppress TypeDoesNotContainType

◆ getEncryptedRequest()

getEncryptedRequest ( )

Gets the encrypted request string.

Returns
string|null The encrypted request or null if not set.

◆ getFormattedReq()

getFormattedReq ( )

Gets the formatted request string.

Returns
string|null The formatted request or null if not set.

◆ getHttpQuery()

getHttpQuery ( )

Gets the HTTP query string of the request.

Returns
string|bool 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 refund request.

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

◆ initH2hPaymentRequest()

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

Initializes an H2H payment request with the necessary parameters.

Parameters
int$merchantIdThe merchant ID.
string$merchantPasswordThe merchant password.
array$otherConfigurationsAdditional configurations.
bool | null$productionIndicates if the request is for production.
string | null$baseUrlThe base URL for the request.

◆ requestCurl()

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

◆ sendRequest()

sendRequest ( )

Sends the H2H request to the configured URL.

Returns
array An array containing the result and response of the request.
Exceptions
NetworkExceptionIf a network error occurs during the request.

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

◆ $response

mixed $response = null

◆ $signature

string $signature = null

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