title: PayFast Payment Integration in PHP - signature error
body: <p>Can any one help me in this PayFast payment gateway integration?
  I have tried the below code, but the signature is not generating correctly I can't understand why.</p>
  <pre><code>&lt;?php
  $str = &quot;merchant_id=10000100&amp;merchant_key=46f0cd694581a&amp;return_url=http%3A%2F%2Fwww.ioss.in%2Fpayment-gateway-integration&amp;cancel_url=http%3A%2F%2Fwww.ioss.in&amp;notify_url=http%3A%2F%2Fwww.ioss.in%2Ffacebook%2Fpayfast_success.php&amp;name_first=Bob&amp;name_last=Smith&amp;email_address=sbtu01%40payfast.co.za&amp;m_payment_id=TRN123456789&amp;amount=200.00&amp;item_name=Widget+Model+123&amp;item_description=Widget+Model+123&quot;;
  $md5 = md5($str);
  
  ?&gt;
  
  &lt;form action=&quot;https://sandbox.payfast.co.za/eng/process&quot; method=&quot;post&quot; name=&quot;frmPay&quot; id=&quot;frmPay&quot;&gt;
  
  &lt;!-- Receiver Details --&gt;
  &lt;input type=&quot;hidden&quot; name=&quot;merchant_id&quot; value=&quot;10000100&quot;&gt;
  &lt;input type=&quot;hidden&quot; name=&quot;merchant_key&quot; value=&quot;46f0cd694581a&quot;&gt;
  
  
  &lt;input type=&quot;hidden&quot; name=&quot;return_url&quot; value=&quot;http://www.ioss.in/payment-gateway-integration/&quot;&gt;
  &lt;input type=&quot;hidden&quot; name=&quot;cancel_url&quot; value=&quot;http://www.ioss.in&quot;&gt;
  &lt;input type=&quot;hidden&quot; name=&quot;notify_url&quot; value=&quot;http://www.ioss.in/facebook/payfast_success.php&quot;&gt;
  
  &lt;!-- Payer Details --&gt;
  &lt;input type=&quot;hidden&quot; name=&quot;name_first&quot; value=&quot;Bob&quot;&gt;
  &lt;input type=&quot;hidden&quot; name=&quot;name_last&quot; value=&quot;Smith&quot;&gt;
  &lt;input type=&quot;hidden&quot; name=&quot;email_address&quot; value=&quot;sbtu01@payfast.co.za&quot;&gt; 
  
  &lt;!-- Transaction Details --&gt;
  &lt;input type=&quot;hidden&quot; name=&quot;m_payment_id&quot; value=&quot;TRN123456789&quot;&gt;
  &lt;input type=&quot;hidden&quot; name=&quot;amount&quot; value=&quot;200.00&quot;&gt;
  &lt;input type=&quot;hidden&quot; name=&quot;item_name&quot; value=&quot;Widget Model 123&quot;&gt;
  &lt;input type=&quot;hidden&quot; name=&quot;item_description&quot; value=&quot;Widget Model 123&quot;&gt;
  
  &lt;!-- Transaction Options --&gt;
  &lt;input type=&quot;hidden&quot; name=&quot;email_confirmation&quot; value=&quot;&quot;&gt;
  
  &lt;!-- Security --&gt;
  &lt;input type=&quot;hidden&quot; name=&quot;signature&quot; value=&quot;&lt;?php echo $md5; ?&gt;&quot;&gt;
  
  &lt;input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;submit&quot;&gt;
  
  &lt;/form&gt;
  </code></pre>
  <p>This is the code that I have tried.</p>
  <p>The supplied variables are not according to specification:</p>
  <p>signature : Generated signature does not match submitted signature</p>
  <p>This is the error I am getting.</p>