doudang4857 2011-08-16 10:20
浏览 328
已采纳

巴克莱ePDQ和PHP - 拒付款?

I am using the Barclay's CPI ePDQ system to take payments from my website.

I have read the docs and I have used the same code for the cURL example and I thus I send the payment to the payment page.

The problem I have though is in 2 parts.

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

Is there anything I'm doing wrong? I have seen some mention of using .htpasswd but I'm not sure.

There doesn't seem to be any reason why the payment/card was declined.

Here is my cURL request:

$url = 'https://secure2.epdq.co.uk/cgi-bin/CcxBarclaysEpdqEncTool.e';
$params = "clientid=xxxxxx&password=xxxxxxxxx&oid=".$orderId."&chargetype=Auth&total=".$total."&currencycode=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 - returns a blank array when var_dumping the $_POST.

Is there any other way of getting the post data back from ePDQ?

Thanks

  • 写回答

2条回答 默认 最新

  • duanshan1511 2011-08-17 09:20
    关注

    Ok, so it seems that you need to activate the account first. Barclay's do not activate the account by default, so you have to fill in a form to tell them.

    Spent all morning trying to figure that out.

    Probably easier to ring them up since they can see all the requests to their system and all the errors your requests produce

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效