Use the following data to unit test your hashing methods.

merchant_key=8c39c6ac-6c45-4cf5-a5b8-1955cc9d5e47

Initiating a Transaction Example

1. Example data: using this data as the values to be used when creating the hash for an initiate transaction request

resulturl = ‘http://localhost/sellingmilk.aspx?action=notify&order_id=2′
returnurl = ‘http://localhost/sellingmilk.aspx?action=return&order_id=2′
reference = ‘Order Number: #Mil140′
amount = 1
id = 1169
additionalinfo = ‘Some Info: milk tastes good.’
authemail = ”
status = ‘Message’

2. Concatenate

The above values concatenated should look like this:

http://localhost/sellingmilk.aspx?action=notify&order_id=2http://localhost/sellingmilk.aspx?action=return&order_id=2Order Number: #Mil14011169Some Info: milk tastes good.Message8c39c6ac-6c45-4cf5-a5b8-1955cc9d5e47

*This is the Order of concatenation:
resulturl + returnurl + reference + amount + id + additionalinfo + authemail + status + merchant_key as specified in the developer document

3. HASH it

If you properly implement YOUR method, you should get this simple hash value. Play around with your code until it gives the hash value below for the values given above, you will be good to go.

hash

6C98405080809A80A38231A6E9E412656F09961B3BBDAC823B6F975CD2B89925C7A8FC8B8AE9DF3A6BD488314AC75BCE1590FE5596115663BB59DA249E52DB8E

*You may need to just uppercase the hash value (using an uppercasing method such as “strtoupper” in PHP), its not necessarily automatic.

4. URL Encode

Now use a URLENCODE function to url encode your values like this. The message to send as a POST would be:

resulturl=http%3A%2F%2Flocalhost%2Fsellingmilk.aspx%3Faction%3Dnotify%26order_id%3D2&returnurl=http%3A%2F%2Flocalhost%2Fsellingmilk.aspx%3Faction%3Dreturn%26order_id%3D2&reference=Order+Number%3A+%23Mil140&amount=1&id=1169&additionalinfo=Some+Info%3A+milk+tastes+good.&authemail=&status=Message&hash=6C98405080809A80A38231A6E9E412656F09961B3BBDAC823B6F975CD2B89925C7A8FC8B8AE9DF3A6BD488314AC75BCE1590FE5596115663BB59DA249E52DB8E