ePages 7.37.0 - DE_EPAGES/RealexPayment/API/Payment.pm

Package DE_EPAGES::RealexPayment::API::Payment

Payment functions for RealexPayment.

@EXPORT_OK
UpdateTransactionStatus
GetRealexSha1Hash
CreateOrderHash

Functions

CreateOrderHash
GetRealexSha1Hash
UpdateTransactionStatus

CreateOrderHash

creates the OrderHash from the given Input-Arguments and the CPI Secret

Syntax
$OrderHash = CreateOrderHash( {'OrderId' => '123456', 'CpiDirectResultUrl' => '...'}
                              'dP/7KdtiuALL8ofLqCjlKDK7NBNfbmCa' );
Input
$Hash
Contains all HSBC CPI Payment Arguments
$CPIHashKey
CPI Secret
$Shop (Object)
Shop (optional, needed for debugging)
Return
(CPI-OrderHash (Check Sum of all Arguments))
$OrderHash

GetRealexSha1Hash

Concatenates all strings in $aFieldArray. A '.' is as used delimeter symbol between the fields. For this string a SHA1 hash value is generated. The generated hash value is appended with a '.' and the shared secret to produce a new string. For this new string a SHA1 hash value is generated and returned as result.

Syntax
GetRealexSha1Hash( $aFieldsArray, $sharedSecret );
Example
$sha1Hash = GetRealexSha1Hash( ['field1', 'field2'], 'sharedSecret' );
Input
$aFieldsArray (array)
field array
$sharedSecret (string)
shared secret
Return
$hash (string)
SHA1 hash value

UpdateTransactionStatus

Update TransStatus, TransTime, TransTimeMod and returns upated values.

Syntax
UpdateTransactionStatus( $LineItemPayment );
Example
$hValues = UpdateTransactionStatus( $LineItemPayment );
Input
$LineItemPayment (object)
LineItemPayment
$NewStatus (string)
new status value
Return
$hValues (hash.ref)
Status Values. Returned keys are:
  • TransTime- transaction time
  • TransStatus - transaction status
  • TransTimeMod - modification time