4

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

user896428
  • 65
  • 2
  • 10
  • The response from barclays only works if its setup to post to a url that requires authentication, have you set that up? (there is a separate config url they should have given you for this; mine is under https://cpiadmin.epdq.co.uk/) – Alex K. Aug 16 '11 at 10:35
  • Also their sample code has a PHP + fsockopen example – Alex K. Aug 16 '11 at 10:37
  • I have the URL and I have configured all the details in the form, i.e. `Pass-phrase:*`, `Allowed URL:` and `Post URL:` etc. So I need to have the `payment-response.php` under authentication? – user896428 Aug 16 '11 at 10:52
  • yes if you access payment-response.php in a browser for example it needs to prompt for authentication – Alex K. Aug 16 '11 at 10:53
  • ah right ok. Still quite hard to diagnose if you haven't used it before. Would be nice if they gave a better response other than 'DECLINED' – user896428 Aug 16 '11 at 10:56
  • If the script/config is wrong and they cant post a response you should get an automated "your stuff is broken" email from them with some details (at least I get one when I break something) – Alex K. Aug 16 '11 at 10:58
  • I don't get any emails when it's broken. So I'm not so sure. Just implementing the htpasswd/htaccess stuff now – user896428 Aug 16 '11 at 11:00
  • Ok, so I still get my payments are `DECLINED`, with `Approval Code:-` Any ideas? – user896428 Aug 16 '11 at 12:43
  • I pass, they are quite helpful if you give them a call (have you checked the encrypted payload in $result is present?) – Alex K. Aug 16 '11 at 13:32
  • $result has an encrypted string. looking in clearcommerce, it seems there is no 'processor' setup. could this be a problem? – user896428 Aug 16 '11 at 13:44
  • That's what I get too. I'm going to have to ring them I think. I'm totally lost. – user896428 Aug 16 '11 at 13:51
  • I get: Payment routing configuration must be completed first. – user896428 Aug 16 '11 at 13:52
  • I think you can ignore that - ClearCommerce is a great lumbering pile of junk they bought in because its "Enterprisey" - have you tried using their PHP example? – Alex K. Aug 16 '11 at 13:57
  • Think I may have found the problem. Seems the account activation hasn't been completed. – user896428 Aug 16 '11 at 14:07
  • Yeah, had to ring up to confirm. Great. Just wasted a whole morning on that! – user896428 Aug 16 '11 at 14:13

2 Answers2

1

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

user896428
  • 65
  • 2
  • 10
0

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

open-ecommerce.org
  • 1,763
  • 1
  • 25
  • 41