Generate Hash

We need to generate the hash signature id that is to be sent to the Pokea Pay system for authentication against the transaction values that are also to be received on the same URL call.

We are using the hash_hmac function in PHP as example to digitally sign the transaction data.

Depending on the programming language of your choice, please feel free to use it or the equivalent HMAC function in your programming language.

Here is a PHP example below: There are two important parameters that are required by this function.

  • Secret key this key is generated by you in your Pokea Payaccount.
  • The string to be hashed - $datastring - this string is composed of ALL the parameters you are passing to Pokea Pay in the following CONCATENATED format. The order of the transaction variables is VERY IMPORTANT and MUST be followed. There are NO SPACES between the different values below.

$datastring =  $live.$oref.$amt.$tel.$eml.$cc
$hashkey = "yoursecretkey"; //we provide this during registration;
$datastring; //This is a string generated from the data to be posted (see above)
$hashid = hash_hmac("sha1", $datastring, $hashkey); //Set hashing algorithm to SHA1;