Checksum Failed error in payu

Sunil Kumar picture Sunil Kumar · Jul 16, 2015 · Viewed 22.8k times · Source

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?

Answer

Mr.Javed Multani picture Mr.Javed Multani · Sep 2, 2016

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