Take the following example message of a Paynow response message:
- Split the message into key/value pairs by splitting where you come across an ampersand (&) character
- Split each key/value pair into a key and a value by splitting where you come across an equal (=) character
- Join all values EXCEPT for the “hash” value into one long string, making sure to URL decode each value before joining it into the string e.g.
- Join your integration key to the end of the string from step 3 above
- Create a SHA512 hash of the string and convert the result to uppercase hexadecimal e.g.
- Compare the “hash” value from the inbound message to the hash you generated in step 5. If they match, then the inbound message hash is valid and you can be sure that the message came from Paynow.
N.B. For this example we were using an integration key of 3e9fed89-60e1-4ce5-ab6e-6b1eb2d4f977. You can test this with your hashing code to see if you get the same hash