巴克莱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

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

Some of the steps i had to follow:

1) download the extension: Barclaycard ePDQ CPI payment module magentocommerce.com/magento-connect/config/extension/2050/barclaycard-epdq-cpi-payment-module#releases

if you cant then download from freegento.com/ddl-magento-extension.php with the key for Magento Connect 1.0.

2) after you copy all app to your magento instalation in case you have your own template be sure you move the folder epdq from: design/frontend/default/template/epdq to: design/frontend/your-package/default/template/epdq

you can check it is in the right place if you type: your-domain.com/epdq/cpi/redirect/

3) change the app/code/community/Barclaycard/Epdq/Model/Cpi.php with the attached file (i just change it with the Markus and validBen)

4) go to the barclays page to add your url: secure2.mde.epdq.co.uk/cgi-bin/CcxBarclaysEpdqAdminTool.e

You have to use the merchant or client ID and the credentials you got from barclays.

At the allowed URL add: your-domain.com/epdq/cpi/redirect/ Post URL your-domain.com/epdq/cpi/postUrl/

Dont foreget the last “/” is not in the documentation.

add any pass-phrase you like

the continue Options in yes and your paswords and mail

5) go to the method payment configuration for the module and add the same details you added in the form.

6) do some kine of persignation according to your belives.

I take a beer and give some generose drops to the pachamama before i drink it then i test the payment with one of the credit card details i got from barkleys.

Good luck

Eduardo

!how to configure ePDQ]1