payu-intrepos / payu-non-seamless-react

Non-Seamless SDK for React Native
5 stars 9 forks source link

{"errorCode": "5019", "errorMsg": "Invalid Hash."} #38

Open mptechjolly opened 2 years ago

mptechjolly commented 2 years ago

Hello, Please help me out about hash issue, I m calling generate hash function on react native and each and every time receive invalid hash.

generateHash = (e) => { console.log(e.hashName); console.log(e.hashString); var hashStringWithoutSalt = e.hashString; var hashName = e.hashName;

var hashValue = e.hashString+"8pGhk7y2yCw1ZSEyKL0BKJI6zZ4duML6"; sha512(hashValue).then( hash => { hashValue = hash }) var result = { [hashName]: hashValue}; PayUBizSdk.hashGenerated(result);

}

also try to generate sha256 static hash, If I m not using any backend server then where I need to generate hash.

Ex : HAq16d|12345|1000|Shopping|Jolly|jolly@test.com|8pGhk7y2yCw1ZSEyKL0BKJI6zZ4duML6 response : abe48a93c8c3d16c25c0710b6edd47eb79bd3dbc84497a25395da0dc111614340aeaaac747d01af9d8aa65668adce7597f771de85abc1b903a16d1c7f441488c

Where I need to pass this generated hash and what about generateHash function?

Screenshot 2022-07-05 at 9 58 58 PM

I m use same way to generate hash but receive invalid hash each time

Jananijann commented 2 years ago

@mptechjolly You should have the pipes even if you are not using any values for it.

Try using it like this: HAq16d|12345|1000|Shopping|Jolly|jolly@test.com|||||||||||8pGhk7y2yCw1ZSEyKL0BKJI6zZ4duML6

Also check the SHA512 hash value with some online SHA generator, to see if its producing the right value.