i had to set this up about 3 or 4 years ago and after much angst was told by my host that EDPQ was not comptatible with CF (i had to use PERL) . I don't know if thats still the case though - worth a check with Barclays
Paul Marsden wrote: > Hi Paul, > > I've connected up a client to Barclays EPDQ via ColdFusion. If this is any > help, here is the code: > > <!--- set your variables to send to Barclays > example figures have been put in here - change them to your own values - PaulM > ---> > > <!--- the total amount of the order ---> > <cfparam name="mysite.orderamount" type="numeric" default="0"> > <cfset variables.total = "#mysite.orderamount#"> > > <!--- your own unique order ID for this order, if not provided Barclays will > send you back its own unique order ID ---> > <cfset variables.oid = "22"> > > <!--- Type of transaction, standard value is "Auth", check the documents for > the others ---> > <cfset variables.chargetype = "Auth"> > > <!--- the password you created in the Barclays ePDQ front end ---> > <cfset variables.password = "myPassword"> > > <!--- the currency code, set to 826 for pounds sterling ---> > <cfset variables.currencycode = "826"> > > <!--- your clientID, given by Barclays at setup ---> > <cfset variables.clientid = "123456"> > > <!--- this is the main form for the page ---> > <FORM ACTION="https://secure2.epdq.co.uk/cgi-bin/CcxBarclaysEpdq.e" > METHOD="post"> > <CFHTTP METHOD="POST" > URL="http://secure2.epdq.co.uk/cgi-bin/CcxBarclaysEpdqEncTool.e"> > <CFHTTPPARAM TYPE="FormField" NAME="total" VALUE="#variables.total#"> > <CFHTTPPARAM TYPE="FormField" NAME="oid" VALUE="#variables.oid#"> > <CFHTTPPARAM TYPE="FormField" NAME="chargetype" > VALUE="#variables.chargetype#"> > <CFHTTPPARAM TYPE="FormField" NAME="password" VALUE="#variables.password#"> > <CFHTTPPARAM TYPE="FormField" NAME="currencycode" > VALUE="#variables.currencycode#"> > <CFHTTPPARAM TYPE="FormField" NAME="clientid" VALUE="#variables.clientid#"> > </CFHTTP> > <CFOUTPUT> > #cfhttp.filecontent# > </CFOUTPUT> > > <!--- start of optional fields - if you want to collect billing and delivery > information to pre-fill the Barclays windows, add in the following input > variables - these are NOT required, just optional. I've sent these to the > page via a form called myform ---> > > <input type="hidden" name="baddr1" value="#myform.addressfield1#"> > > <!--- billing fields options are baddr1, baddr2, baddr3, bcity, > bcountyprovince, bcountry, bpostalcode, bstate, btelephonenumber ---> > <!--- devliery fields options are saddr1, saddr2, saddr3, scity, > scountyprovince, scountry, spostalcode, sstate, stelephonenumber ---> > > <!--- there is also the option for the email field ---> > > <input type="hidden" name="email" value="#myform.emailfield#"> > > <!--- end of additional optional fields ---> > > </FORM> > > > Once submitted, the form will send the user to Barclays page. If an error is > found, make sure you told the Barclays ePDQ front end the precise url you are > sending from e.g. if the page above is called transaction.cfm this is what > you must add to the ePDQ front end (found at > https://secure2.epdq.co.uk/cgi-bin/ClearCommerce_Engine/#your-account-number#) > > Also, make sure that there is the relevant security on the directory that > this file sits in (basic authentication). Not the best thing to do to your > directory, but required for this function nonetheless. > > Once the Barclays pages are filled out by the user they will be sent back to > your transaction.cfm page. At the same time, the order information will be > send to the page you specified in the ePDQ front end (the return URL). On > this page you can pick up the information as follows: > > > <!--- I'm creating a log file per order, so creating a unique log file per > order > The information is sent back from Barclays as form variables, so form.oid is > whatever > orderID was sent through by the first form, or if one wasn't sent through, it > is a > unique ID generated by Barclays for you - PaulM > ---> > <cfset variables.logID = #form.oid#> > > <!--- set the location of your log file directory ---> > <cfset variables.mylogfile = "d:\wwwroot\{your > site}\log\orderlog#variables.logID#.txt"> > > <cfheader name="Content-Type" value="text/html"> > > <cfset x = GetHttpRequestData()> > > <cfoutput> > > <cffile action="WRITE" file="#variables.mylogfile#" output="LOG FILE FOR > ORDER #variables.logID#" addnewline="Yes"> > > <cffile action="APPEND" file="#variables.mylogfile#" output="ORDER CREATED: > #x.method#, Status: #form.transactionstatus#, OrderID: #form.oid#, Total: > #form.total#, Datetime: #form.datetime#, Client ID: #form.clientid#" > addnewline="Yes"> > > <!--- at this point you will probably want to put the order into a database > or some other > order display method, so just use normal form.whatever to input or display it > ---> > > </cfoutput> > > > I hope this works for you. > > If I've made any mistakes or typos above, I apologise! > > Good luck. > > Paul M > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;203748912;27390454;j Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:310960 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4