Hash Generation
Every request is accompanied by a secure Hash that verifies the request’s Integrity as well as merchant identity. The secure Hash algorithm is SHA-512.
- To generate secure Hash, use the following method: Take all the request parameters that are to be sent to us and sort them in ascending order according to the name of each field.
- Now prepare a String of these sorted name value params with Tiled (~) as the separator like:
Example: Step1
AMOUNT=1000~APP_ID=1000221129001154~CARD_EXP_DT=122030~CARD_NUMBER=4111110000000211~CURRENCY_CODE=840~CUST_CITY=Winterfell~CUST_COUNTRY=US~CUST_EMAIL=johnsnow@test.com~CUST_NAME=John Snow~CUST_PHONE=9454243567~CUST_SHIP_FIRST_NAME=John~CUST_SHIP_LAST_NAME=Snow~CUST_STATE=The North~CUST_STREET_ADDRESS1=Great Wall~CUST_ZIP=32546~CVV=123~INITIATE_SEAMLESS_TRANSACTION=Y~ ORDER_ID=7773428492547592~PAYMENT_TYPE=CC~PRODUCT_DESC=Valerian Streel Blades~RETURN_URL=https://www.merchant.com/response.jsp~TXNTYPE=SALE
- Next step is to append the Salt Key at the end of the parameter string given Payment Gateway to you. After adding you will get the following output (If salt key is 5cd925b2d0254be0)
Example: Step2
AMOUNT=1000~APP_ID=1000221129001154~CARD_EXP_DT=122030~CARD_NUMBER=4111110000000211~CURRENCY_CODE=840~CUST_CITY=Winterfell~CUST_COUNTRY=US~CUST_EMAIL=johnsnow@test.com~CUST_NAME=John Snow~CUST_PHONE=9454243567~CUST_SHIP_FIRST_NAME=John~CUST_SHIP_LAST_NAME=Snow~CUST_STATE=The North~CUST_STREET_ADDRESS1=Great Wall~CUST_ZIP=32546~CVV=123~INITIATE_SEAMLESS_TRANSACTION=Y~ORDER_ID=7773428492547592~PAYMENT_TYPE=CC~PRODUCT_DESC=Valerian Streel Blades~RETURN_URL=https://www.merchant.com/response.jsp~TXNTYPE=SALE5cd925b2d0254be0
info
Please append the secret key in lower case without any separator after the last value.
- After completing the above-mentioned process, you will have to call SHA 512 algorithm and pass the parameter string to the same and the SHA will return you the desired result as
Hash Value
1ed4fc3edf91e2d991a47a3d0492fe21e21195ff5ea20322c27fbc1bb3d09f56f03d6a24bf1138eaaceeffa9b6d16b381731ab330b1654e39d1c9711862744bc
- Now you must convert the generated value to the Upper Case, and you will get the result.
Final Hash Value
1ED4FC3EDF91E2D991A47A3D0492FE21E21195FF5EA20322C27FBC1BB3D09F56F03D6A24BF1138EAACEEFFA9B6D16B381731AB330B1654E39D1C9711862744BC