【发布时间】:2014-12-02 20:59:54
【问题描述】:
我正在我的网站上集成 epdq 支付网关并出现错误:
这是我的代码:
<?php
$amount = str_replace('£', '', 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 页面上的错误日志中给出错误。
有什么建议吗?
【问题讨论】:
标签: php payment-gateway