payfast.co.za signature: Generated signature does not match submitted signature. code example

Example: signature: Generated signature does not match submitted signature.

<?php
$str = "merchant_id=10000100&merchant_key=46f0cd694581a&return_url=http%3A%2F%2Fwww.ioss.in%2Fpayment-gateway-integration&cancel_url=http%3A%2F%2Fwww.ioss.in¬ify_url=http%3A%2F%2Fwww.ioss.in%2Ffacebook%2Fpayfast_success.php&name_first=Bob&name_last=Smith&email_address=sbtu01%40payfast.co.za&m_payment_id=TRN123456789&amount=200.00&item_name=Widget+Model+123&item_description=Widget+Model+123";
$md5 = md5($str);

?>

<form action="https://sandbox.payfast.co.za/eng/process" method="post" name="frmPay" id="frmPay">

<!-- Receiver Details -->
<input type="hidden" name="merchant_id" value="10000100">
<input type="hidden" name="merchant_key" value="46f0cd694581a">


<input type="hidden" name="return_url" value="http://www.ioss.in/payment-gateway-integration/">
<input type="hidden" name="cancel_url" value="http://www.ioss.in">
<input type="hidden" name="notify_url" value="http://www.ioss.in/facebook/payfast_success.php">

<!-- Payer Details -->
<input type="hidden" name="name_first" value="Bob">
<input type="hidden" name="name_last" value="Smith">
<input type="hidden" name="email_address" value="[email protected]"> 

<!-- Transaction Details -->
<input type="hidden" name="m_payment_id" value="TRN123456789">
<input type="hidden" name="amount" value="200.00">
<input type="hidden" name="item_name" value="Widget Model 123">
<input type="hidden" name="item_description" value="Widget Model 123">

<!-- Transaction Options -->
<input type="hidden" name="email_confirmation" value="">

<!-- Security -->
<input type="hidden" name="signature" value="<?php echo $md5; ?>">

<input type="submit" name="submit" value="submit">

</form>

Tags:

Html Example