Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Checksum Failed error in payu

Tags:

php

payu

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?

like image 706
Sunil Kumar Avatar asked Dec 24 '22 16:12

Sunil Kumar


2 Answers

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

like image 66
Mr.Javed Multani Avatar answered Dec 27 '22 21:12

Mr.Javed Multani


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

like image 29
New2SAPUI5 Avatar answered Dec 27 '22 19:12

New2SAPUI5