This is an oscommerce payment module for Barclays epdq service.





ePDQ install
------------

1.
Add the following new line to your catalog\catalog\includes\filenames.php

define('FILENAME_EPDQ_SUCCESS', 'epdq_success.php');


2.
All of the included documents are new documents so they can be just dropped
into the specified folder.

epdq_success.php      needs to be placed into the catalog\catalog folder.
lang\epdq_success.php needs to be placed into the catalog\catalog\includes\languages\english folder.
ePDQ.php              needs to be placed into the folder catalog\catalog\includes\modules\payment.
lang\ePDQ.php         needs to be placed into the catalog\catalog\includes\languages\english\modules\payment folder.


3.
Configure the ePDQ end of the interface being sure that you enter the exact web page
address the request call will come from.
ie http://www.myshop.com/catalog/catalog/checkout_confirmation.php


4.
Go into the oSC admin section and turn on ePDQ payments. Dont forget to change the
configuration of the settings to work with your site.





Configuration:
-------------
There are two parts to the configuration osC end and ePDQ end.

oSC configuration should be via the admin interface, go to modules / payment and click to
enable ePDQ.
ePDQ configuration should be via https://secure2.epdq.co.uk/cgi-bin/ClearCommerce_Engine/{store id}

Configuration options.
 
1. ePDQ Password      = your password as configured at - https://secure2.epdq.co.uk/cgi-bin/ClearCommerce_Engine/xxxx <- where xxxx is your store ID allocated by barclays.
2. ePDQ Currency Code = 826 for GBP (the only currency supported at the moment)
3. ePDQ Charge Type   = PreAuth or Auth depending on whether you bill immeadiatly or after you've shipped the product.
4. ePDQ Merchant ID   = xxxx  <- Typically a four digit ID allocated by Barclays as above.
5. ePDQ Merchant PWD  = Password for the ID associated to the Barclays Merchant ID as above.





Using the ePDQ unique confirmation page
---------------------------------------
NOTE : THIS WILL NOT BE REQUIRED BY MOST PEOPLE...
If you only have one payment module and you want your own final confimation page, this can
be achieved by the following :-

1. 
Setting the standard system variable 'FILENAME_CHECKOUT_SUCCESS' in
'catalog\catalog\includes\application_top.php' to 'epdq_success.php'

define('FILENAME_CHECKOUT_SUCCESS', 'epdq_success.php');





What the hell happens
---------------------

This payment module works by creating a request to the ePDQ site containing all of the order
information. It receives back a response code on the checkout_confirmation.php page.
Then when the user clicks the "confirm order" button at the bottom of the page a call is made 
again to the ePDQ site but passing :-
    the previously received response code
    MODULE_PAYMENT_EPDQ_RETURNURL
    and this session id.

When the user has finished entering the payment details, the ePDQ site calls the return url
passed. BUT, if at this point the session has timed out or been lost/deleted you will
receive an error.

MODULE_PAYMENT_EPDQ_RETURNURL is the url the page will be returned to. This is set by default
to the standard osC checkout_process.php page which is located in your catalog/catalog area.
This can be changed by just changing MODULE_PAYMENT_EPDQ_RETURNURL = "rtn/epd/epdq_checkout.php"
which should then return to catalog/catalog/rtn/epd/epdq_checkout.php





So what to do if I have problems
--------------------------------
In the payment module program (ePDQ.php) you will notice unix comments (/* and */) remove
these and you will get all of the variables displayed before and after the posts via echo
commands.





Still To Do:
------------
Ability to pass data the customer has already entered from their account.