在网站上整合epdq

时间:2014-12-02 20:59:54

标签: php payment-gateway

我正在我的网站上集成epdq支付网关并收到错误:

这是我的代码:

<?php
$amount = str_replace('&pound;', '', appthemes_get_price( $order->get_total(), $order->get_currency() ));
//str_replace('£', '', appthemes_get_price( $order->get_total())) * 100;
$hParams  = array();
          $hParams['ACCEPTURL']    = 'http://www.ukflightcottage.com/book-online/online-booking-done.php';
          $hParams['AMOUNT']       = round($amount) * 100;
          $hParams['CANCELURL']    = 'http://www.ukflightcottage.com/book-online/';
          $hParams['CURRENCY']     = 'GBP';
          $hParams['DECLINEURL']   = 'http://www.ukflightcottage.com/book-online/';
          $hParams['EXCEPTIONURL'] = 'http://www.ukflightcottage.com/book-online/';
          $hParams['LANGUAGE']     = 'en_US';
          $hParams['ORDERID']      = $order->get_id();
          $hParams['PSPID']        = 'epdq1111111';
          $hParams['WIN3DS']       = 'MAINW';

$aParams  = array();
          foreach( $hParams as $k=>$v ) {
               $aParams[]     = $k . '=' . $v;
          }
          $shain    = 'Abcdefghijkl1234';
          $string   = implode( $shain, $aParams ) . "{$shain}";
          $enc_string= ( sha1( ( $string ) ) );
          //print $string;
 $enc_string;
?>

<input type="hidden" name="ACCEPTURL" value="http://www.planetoftheads.com/bank-transfer-success/" />
<input type="hidden" name="AMOUNT" value="<?php echo round($amount) * 100;?>" />
<input type="hidden" name="CANCELURL" value="http://www.planetoftheads.com" />
<input type="hidden" name="CURRENCY" value="GBP" />
<input type="hidden" name="DECLINEURL" value="http://www.planetoftheads.com" />
<input type="hidden" name="EXCEPTIONURL" value="http://www.planetoftheads.com" />
<input type="hidden" name="LANGUAGE" value="en_US" />
<input type="hidden" name="ORDERID" value="<?php echo $order->get_id(); ?>" />
<input type="hidden" name="PSPID" value="epdq1234567" />
<input type="hidden" name="WIN3DS" value="MAINW" />
<input type="hidden" name="SHASIGN" value="<?php echo $enc_string; ?>" />
<input type="submit" value="Pay Now">

我不是在epdq页面上选择受益人和金额,但是当我更改金额格式时,如果我将任何错误的金额如16.80选择受益人而不是金额并在错误登录epdq页面上给出错误。

有什么建议吗?

1 个答案:

答案 0 :(得分:0)

我这样做是SHAIN问题。我生成了SHA-1,但在epdq中选择了SHA-256。

无论如何,谢谢,