【发布时间】:2011-10-27 22:44:46
【问题描述】:
我正在使用 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 获取帖子数据吗?
谢谢
【问题讨论】:
-
巴克莱的响应只有在设置发布到需要身份验证的网址时才有效,您设置了吗? (他们应该为此提供一个单独的配置 url;我的在 cpiadmin.epdq.co.uk 下)
-
他们的示例代码也有一个 PHP + fsockopen 示例
-
我有 URL 并且我已经配置了表单中的所有详细信息,即
Pass-phrase:*、Allowed URL:和Post URL:等。所以我需要让payment-response.php进行身份验证? -
是的,例如,如果您在浏览器中访问 payment-response.php,它需要提示进行身份验证
-
啊,好吧。如果您以前没有使用过它,仍然很难诊断。如果他们给出比“拒绝”更好的回应,那就太好了
标签: php payment-gateway payment-processing