Hash is not generating when initiate transaction


#1

currently i am just using api on postman for initiate transaction i am getting error on postman

status=Error&error=Invalid+Hash.++Hash+should+start+with%3a+467AFB

I am using the function for converting the hash as provided in doc and it converts correct

as the hash which is generated is same as provided in doc so I use that same way and generate our hash according to data

What will be the issue


#2

Good Day Rachit, Which language or framework are you using and also kindly paste your request body without integration key and hash


#3

Api=>(POST)
https://www.paynow.co.zw/interface/initiatetransaction

request_param=>
id:""
reference:ref_1234
amount:10.00
returnurl:http://www.google.com/search?q=returnurl
status:Message
hash:""
additionalinfo:A test ticket transaction
resulturl:http://www.google.com/search?q=resulturl

Currently I am checking via postman directly

but for implementation I am using php laravel framework

Also for make Hash I have used this way on editor

<?php $values = [ "id"=>1201, "reference"=>"TEST REF", "amount"=>99.99, "additionalinfo"=>"A test ticket transaction", "returnurl"=>"http://www.google.com/search?q=returnurl", "resulturl"=>"http://www.google.com/search?q=resulturl", "status"=>"Message" ]; $IntegrationKey = '3e9fed89-60e1-4ce5-ab6e-6b1eb2d4f977'; // 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; ?>

I have to implement via api


#4

Did you manage to solve this? Currently facing the same error