How to Calculate hashValue?
-
When the ReturnHash parameter given when sending the payment
information is set to 1, the string created by adding “T” (capital letter) if the
payment was successful, “F” (capital letter) if the payment was
unsuccessful, to the end of the GUID value written in CodeForHash,
in the result returned after the payment request.
The hashValue is
calculated by HASHing the value with SHA256.
NOTE : The letters in CodeForHash must be in Uppercase !
Successful Result :
hashValue = SHA256(CodeForHash + “T”)
Example of successful result for CodeForHash mentioned above:
hashValue = SHA256(“9FDFBDFC-42C5-417E-AA93-E4D9D5312AAC” + “T”) = cdb7869505bdaaac2f4c891fc9ed889885fd7a0c880127ab5d508883efa3ee83
Click here to check Hash with SHA256
Failed Result :
hashValue = SHA256(CodeForHash + “F”)
Example of failing result for CodeForHash mentioned above:
hashValue= SHA256(“9FDFBDFC-42C5-417E-AA93-E4D9D5312AAC” + “F”) = acc929d261fdbf9c41de3db1ae854b1ee1e46344fad0292fd4bbbc43d094c2a3
In the code running in RedirectURL:
hashValue Merchant, by adding “T” to the end of the CodeForHash value it
has stored in its own database, if it is
successful, “F” if it is unsuccessful, then HASHing both with SHA256,
It will generate 2 values and the hashValue value returned from Moka,
whichever is equal, will learn the payment result in this way.
If a completely different hashValue is returned, this payment will be
considered FAILED.
NOTE : Also, if you want us to report the payment result to another URL, you will need to make the same change in the code of that URL!
Example PseudoCode :
hashValue1 = SHA256(CodeForHash + “T”);
hashValue2 = SHA256(CodeForHash + “F”);
if hashValue = hashValue1 then
     return “PAYMENT SUCCESSFUL”
else
     return “PAYMENT FAILED”