我正在使用 Barclay 的 CPI ePDQ 系统从我的网站收取款项。
我已经阅读了文档,并且在cURL
示例中使用了相同的代码,因此我将付款发送到付款页面。
我遇到的问题分为两部分。
1. Payments are always declined
2. I have configured the post url as http://example.com/payment-response.php with an echoing out $_POST - which returns nothing
有什么我做错了吗?我看到有人提到使用 .htpasswd,但我不确定。
付款/卡被拒绝似乎没有任何理由。
这是我的 cURL 请求:
$url = 'https://secure2.epdq.co.uk/cgi-bin/CcxBarclaysEpdqEncTool.e';
$params = "clientid=xxxxxx&password=xxxxxxxxx&oid=".$orderId."&chargetype=Auth&total=".$total."¤cycode=826";
$user_agent = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"; $ch = curl_init();
curl_setopt($ch, CURLOPT_POST,1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$params);
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); // this line makes it work under https
$result=curl_exec($ch);
<FORM action="https://secure2.epdq.co.uk/cgi-bin/CcxBarclaysEpdq.e" method="POST">
<?php print "$result"; ?>
<INPUT type="hidden" name="returnurl" value="http://example.com/payment-response.php">
<INPUT type="hidden" name="merchantdisplayname" value="TEST">
<INPUT TYPE="submit" VALUE="purchase">
</FORM>
payment-response.php
- var_dumping 时返回一个空白数组$_POST
。
有没有其他方法可以从 ePDQ 获取帖子数据?
谢谢