PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
Copy Clear
Copy Format Clear
<?php $values = [ "id"=>17105, "reference"=>"ref_12344", "amount"=>10.00, "additionalinfo"=>"A test ticket transaction", "returnurl"=>"http://www.google.com/search?q=returnurl", "resulturl"=>"http://www.google.com/search?q=resulturl", "status"=>"Message" ]; $IntegrationKey = '89e2c960-6382-45ba-8341-530e2fbb8944'; // Call the function to generate the hash $hashed = CreateHash($values, $IntegrationKey); function CreateHash($values, $IntegrationKey) { $string = ""; foreach($values as $key=>$value) { if( strtoupper($key) != "HASH" ){ $string .= $value; } } $string .= $IntegrationKey; $hash = hash("sha512", $string); return strtoupper($hash); } echo $hashed; ?>
Show:  
Copy Clear