How hash validation Work ?

How hash validation Work ?

Let give you an example:

Lets,

Verify Key given by the gateway is given below

Verify Key="[verify_key] => amount,bank_tran_id,base_fair,card_brand,card_issuer,card_issuer_country,card_issuer_country_code,card_no,card_type,currency,currency_amount,currency_rate,currency_type,risk_level,risk_title,status,store_amount,store_id,tran_date,tran_id,val_id,value_a,value_b,value_c,value_d [verify_sign_sha2] => d349cb08d7bd3012ecb2b2290390000597bc4da0414ae11a804c2cd764551b1d [currency_type] => BDT [currency_amount] => 100.00 [currency_rate] => 1.0000 [base_fair] => 0.00 
";

 

1. First I copy the verify_key values from the Post values given by the gateway, in a new array.

2. Then I add the store password in the new array. Before add the password, we have to encrypt the password with MD5, like md5(store password);

3. Then I reorder the index of that new array in ascending order.

4. Then make the below hash string from the new array.

 

My Hash String= "amount=100&bank_tran_id=1805131320550oksE6CAEWWlpTd&base_fair=0.00&card_brand=VISA&card_issuer=STANDARD CHARTERED BANK&card_issuer_country=Bangladesh&card_issuer_country_code=BD&card_no=455445XXXXXX4326&card_type=VISA-Dutch Bangla¤cy=BDT¤cy_amount=100.00¤cy_rate=1.0000¤cy_type=BDT&risk_level=0&risk_title=Safe&status=VALID&store_amount=97&store_id=testbox&store_passwd=d8578edf8458ce06fbc5bb76a58c5ca4&tran_date=2018-05-13 13:20:47&tran_id=5af7e7a5aa2a8&val_id=1805131320551DK3gXH3uHP3WiX&value_a=ref001&value_b=ref002&value_c=ref003&value_d=ref004
"

5. Then encrypt this hash_string with MD5 and compare with the Post parameter verify_sign.


    • Related Articles

    • SOME FREQUENTLY ASKED QUESTIONS

      What is a Payment Gateway? Payment Gateway is a service that allows merchant to accept secure credit card transactions online. It is a system that accepts, verifies and processes transactions on behalf of the merchant from the customers. There are ...
    • What type of EMI SSLCOMMERZ support?

      Two types of EMI option are available in our gateway. 1. Selected Product:               Merchant can set product wise EMI option. Like Merchant has 10 product, he can give EMI option for 2 products. To do this when you initiate the payment for these ...