Payfort提交中的签名不匹配

时间:2019-10-16 08:22:29

标签: php payfort

我正在使用Payfort,并且得到:

  

签名不匹配

怎么了?

<?php

// How to calculate request signature
$shaString  = '';

// array request
$arrData = array(
    'command'            => 'AUTHORIZATION',
    'access_code'        => '',
    'language'           => 'en',
    'merchant_identifier'=> '',
    'merchant_reference' => '',
    'return_url'         => '',
);

// sort an array by key`
ksort($arrData);
foreach ($arrData as $key => $value) {
   $shaString .= "$key=$value";
}

// make sure to fill your sha request pass phrase
$shaString = '' . $shaString . '';
$signature = hash('sha256', $shaString);

// your request signature
echo $signature;

?> Giving signature
<form id="simulatorForm" action="https://sbcheckout.PayFort.com/FortAPI/paymentPage" method="post"><input id="service_command" name="service_command" type="hidden" value="TOKENIZATION" />
  <input id="access_code" name="access_code" type="hidden" value="" />
  <input id="language" name="language" type="hidden" value="en" />
  <input id="merchant_identifier" name="merchant_identifier" type="hidden" value="" />
  <input id="merchant_reference" name="merchant_reference" type="hidden" value="" />
  <input id="return_url" name="return_url" type="hidden" value="" />
  <input id="signature" name="signature" type="hidden" value="" />
  <input type="SUBMIT" value="Pay" />
</form>

0 个答案:

没有答案