4

I am trying to integrate payu payment gateway and I have included all the mandatory fields but it's showing me an error after redirecting to payu's official site.

Error. We are sorry we are unable to process your payment.
Checksum Failed. Please contact your merchant.

I have included following fields:

<input type="hidden" name="key" value="key here" />
<input type="hidden" name="txnid" value="67c778f0eed" />
<input type="hidden" name="hash" value="sdfdsfsdfsdfgsdrgsdf"/>
<input type="hidden" class="user2" name="firstname" value="sunil">
<input type="hidden" name="surl" value="abc.com" size="64" />
<input type="hidden" name="furl" value="abc.com" size="64" /></td>
<input type="hidden" name="service_provider" value="payu_paisa" size="64" /> 
<input id="pay_amoumt" type="hidden" name="amount" value="10">
<input id="pay_amoumt" type="hidden" name="productinfo" value="general">

I have assigned a static string to hash key. Is this a problem? Or is there anything else I have to do?

Sunil Kumar
  • 311
  • 1
  • 5
  • 16
  • 1
    Read the docs, `hash` should be the hash of all the other values you are sending. – elssar Jul 16 '15 at 10:03
  • Now i got it. Its a string generated with key,salt and many more . – Sunil Kumar Jul 16 '15 at 13:14
  • 1
    @sunil..can u tell me how u solved this issue? – Asif Sb Nov 19 '15 at 09:34
  • @AsifSb Hey are you able to figure this out? :( – Dipak Mar 15 '16 at 12:25
  • It usually happens if the merchant profile is not verified. It happened on my end too but when i verified all the details then the error was gone – saurabh yadav Apr 20 '18 at 18:26
  • Are you using the correct format for the hash string? If you are not, you will encounter this error. Please make sure that the hash is calculated in the following format - hashSequence= key|txnid|amount|productinfo|firstname|email|udf1|udf2|udf3|udf4|udf5|salt Please make sure that in the above sequence use the UDFs which have also been posted to our server. In case you haven't posted any UDFs, the hash sequence should look like this - hashSequence= key|txnid|amount|productinfo|firstname|email|salt. – shashikant kuswaha Sep 01 '20 at 14:51

4 Answers4

6

Your checksum is not exact check variable that all are compulsory. Formula for checksum before transaction:

sha512 (key|txnid|amount|productinfo|firstname|email|udf1|udf2|udf3|udf4|udf5||||||<SALT>)

SALT will be provided by PayUMoney. The algorithm used is SHA2 which is globally well known algorithm. Use Google to find the desired function library for your implementation. Some example code is also mentioned below:

Example code for PHP:

$output = hash("sha512", $text);

http://softbuiltsolutions.com/uploads/readme/sZuRrXnkRVQXqv47f3hgy4LCmekcry-1443511890.pdf

m00am
  • 5,910
  • 11
  • 53
  • 69
Mr.Javed Multani
  • 12,549
  • 4
  • 53
  • 52
3

Not sure if this was fixed , but could not find the answer anywhere, so thought will share what worked for me. Please make sure the amount is a float like 10.00 . This worked for me. Thanks

New2SAPUI5
  • 33
  • 5
  • This is the case for me also. In documentation it mentioned. But I thought float is only for generating hash. – ashoksl Apr 14 '21 at 17:01
1

The POST must include the following keys compulsorily

"key" "txnid" "amount" "productinfo" "firstname" "email" "phone" "surl" "furl" "hash" "service_provider"

This information is in the documentation.

Mogsdad
  • 44,709
  • 21
  • 151
  • 275
Vijay Kumar Kanta
  • 1,111
  • 1
  • 15
  • 25
0

check your frontend and backend field name of object are matching to each other.if its not matching it will give error while generating hash code.

Nithesh P
  • 51
  • 1
  • 8