I am working on Securepay Integration with my ASP.NET web page, as per their documentation I am generating SHA1 from following information:
The Fingerprint is a SHA1 hash of the above fields plus the SecurePay Transaction Password in this order with a pipe separator “|”:
- EPS_MERCHANTID
- Transaction Password (supplied by SecurePay Support)
- EPS_TXNTYPE (as 0)
- EPS_REFERENCEID (for testing purpose 123)
- EPS_AMOUNT (for testing purpose 100.00)
- EPS_TIMESTAMP (for testing purpose 20120910203805)
Though I have followed above given instruction but whenever I am doing payment it says “Invalid Fingerprint“. Example code:
FormsAuthentication
.HashPasswordForStoringInConfigFile("xxx|xxx|0|123|100.00|20120910203805","sha1")
.ToLower();`
Check that you are ending the line correctly, either with a trailing ‘|’ or removing unnecessary trailing ‘|’.
Also check that the method you are using doesn’t add anything else inside the method that would distort what you are expecting. (I am thinking a salt based upon the particular machine you are on don’t know if it does this or not)
I have been attempting to generate a hash here http://shagenerator.com/ using this:
gives:
Can you get the same key with your code using my input?
Update:
Can you try this method instead of
HashPasswordForStoringInConfigFile()and see if you get closer:UPDATE 2:
Check your encoding, I discovered that I can match the hash output with:
UPDATE 3:
The following code worked for me in a console app, I was seeing the hashes generate the same value and I was able to compare the output to http://shagenerator.com/ also: