Posted by Jon Moss on April 20, 2010 at 2:08pm
9 followers
Jump to:
| Project: | Ubercart Barclays EPDQ payment gateway |
| Version: | 6.x-1.0 |
| Component: | Documentation |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
Hi Crooke, thank you for your work on th ePDQ Payment Gateway, but I am having a little trouble. I can't find a link to any documentation and to get this working I need to know what the Update URL is to up date the database after an order has completed or failed and also the Request/From URL needs to be set in order to pass security. Could you please help with this as we have just finished a full production website and I have no way of processing the payments without setting up another gateway.
Thanks for you help.
Jon Moss
Comments
#1
Hello,
Like Jon, I was delighted to find an epdq module for Ubercart and I'd like to express my appreciation for your work. Like Jon, we couldn't find any documentation and had a problem identifying the request and update URLs.
We had a look in the module and used http://"site_address"/cart/checkout/review for the request URL or 'Allowed URL' as it is referred to in the epdq set up. This works.
We tried http://"site_address"/cart/epdq/save for the update or 'POST' url. This doesn't work.
Please advise the correct 'POST' URL that should be entered in the epdq set up form.
Regards
Clive Miller
clive@salessense.co.uk
#2
Hi Clive, thank you for your comment here. I have now managed to get the 'Allowed URL' to work as well.
I am still trying to work out this 'POST URL' and have noticed one odd thing in the .module code. Please correct me if I'm wrong but the code on lines 276 & 319 both reference 'trueuc_epdq' as the table. But when you look at the database the only table close to this is 'uc_epdq' (which also has the correct fields).
276 $sql = db_query("SELECT * FROM trueuc_epdq WHERE oid = %d", $_GET['oid']);
319 db_query("INSERT INTO trueuc_epdq VALUES(%d, '%s')", $_POST['oid'],$_POST['transactionstatus']);
I have tried changing the lines but the database still does not get updated. From what I can tell the URL you are suggesting for POST (http://"site_address"/cart/epdq/save) is correct.
Have you set the return URL to a custom page or have you returned the user to http://"site_address"/cart/epdq/complete ??? I have tried this and I just get a white screen. But it seems like this is what should be the correct URL.
Thank you for your suggestions and hopefully between us, Andrew Osiname (who has sent me an email with some ideas) and the Barclays team we can come up with a solution.
Regards
Jon Moss
#3
Hi Jon & Clive,
sorry that I didn't reply earlier, I was a bit overloaded :)
So I created a new version of the module that corrects the database name error, it was a little mistake on my side. You'll need to download the new module, completely uninstall the old one (disable the module and click "Uninstall" after refresh and uninstall it) and install the new one. This should take care of the database issue.
Regarding the URL settings:
Allowed URL should be: http://[hostname]/cart/checkout/review
Return URL: http://[hostname]/cart/epdq/save
I'm really sorry that I didn't have time to create a README, I'll do it as soon as I've got some time.
Please let me know if that solved your problems.
Rob
#4
Sorry,
this might be a bit confusing...
So in Drupal you set the Return URL to: http://[hostname]/cart/epdq/complete
On the CPI administration page you set the POST URL to: http://[hostname]/cart/epdq/save
That should do the trick.
Sorry again
#5
Hi Rob and Clive,
I am still unable to get the uc_epdq to work. I have uninstalled and reinstalled the mod several times via the normal route and by hand but the database still does not get updated once the payment has gone through and the user is just returned to a white screen with no content.
Am I missing something silly?
Could this be anything to do with having a multisite install?
Clive, have you got this working now?
Thanks, Jon.
#6
Hi All,
Im happy to announce ive just taken a live payment using this module.
My setup:
1. I created a CPI user account on the main barclays store administration site.
2. I then set up the cpi access https://cpiadmin.epdq.co.uk/cgi-bin/CcxBarclaysEpdqAdminTool.e
using the CPI user account created:
allowed url :http://www.mydomain.co.uk/cart/checkout/review
option1:no
option2:no
option3:no
post order result:yes
Post url :http://www.mydomain.co.uk/cart/epdq/save
post username and password i just used "none" and "none" just so it would submit this account is not setup in my drupal install
3. ubercart payment settings
I noticed here that the title and description do not change the payment panal when users checkout (Ive hacked in some code to make it work)
Full EPDQ URL: https://secure2.epdq.co.uk/cgi-bin/CcxBarclaysEpdq.e
Return URL: http://www.mydomain.co.uk/cart/epdq/complete
Issues:
It would appear that the module only marks payments as pending as the barclays system only captures payments ready for a batch process at the end of the day(please correct me if im wrong) there for the payment has to be manually added to the order the following day if the payment is cleared.
site: www.thymeatsouthrop.co.uk (this is a live site - payments will be taken)
Merch
#7
Hi Merch, this is how far we have all got with the pluging, but imagine you take 100's of orders a day, it would be impossible to reconsile all those payments. The system should update to show the payment is cleared. The code shows this should happen but for some reason does not write to the database.
Also when your user is returned to the site do you get a page saying thank you for your order and showing the order status or do you just get a plain white screen?
We are getting a white screen, as is everyone else as far as I know and I have even built my own custom page to return the customer to but still they get a white blank page. This is very bad for the customer experience as they would have to return to the front of the site (retyping the URL) and would have no idea if they have actually made a purchase or not.
Jon
#8
Hi All,
Thanks for the useful information in the posts. I have manged to link up the payment gateway now in a TEST environment.
That is really what I wanted to share as for anyone else who needs to do this as the module will only work in a live payment environment.
I spoke to Barclays as I was getting errors (very helpful by the way) and they siad I was using the wrong encryption URL. The payment server URL and encrption URL must match. This may be a good adition to the module for the future. If we get time to add a sensible patch to the admin area then we will. Maybe a tick box to indicate test environment.
Anyway the test encryption server is: "secure2.mde.epdq.co.uk" (live server is server="secure2.epdq.co.uk) and is on line 206 in the current module.
Thanks,
Ben.
#9
Hi All,
I have finally managed to get EPDQ working on my site.
For me the final key to the puzzle was the lines 276 & 319 that Jon mentioned in post #2. However in my database the table is called "drupal_uc_epdq".
After inserting the correct table name into my module everything works perfectly right now.
Thank you for building the module Rob.
#10
Thanks for your post warbital, just to clarify before I go making changes to a live site - you have changed these lines in uc_epdq.module
line 276 from:
$sql = db_query("SELECT * FROM uc_epdq WHERE oid = %d", $_GET['oid']);to:
$sql = db_query("SELECT * FROM drupal_uc_epdq WHERE oid = %d", $_GET['oid']);line 319 from:
db_query("INSERT INTO uc_epdq VALUES(%d, '%s')", $_POST['oid'],$_POST['transactionstatus']);to:
db_query("INSERT INTO drupal_uc_epdq VALUES(%d, '%s')", $_POST['oid'],$_POST['transactionstatus']);And your site now updates an orders status from 'pending' to 'complete' ?
I have just checked the tables on my site and I am also seeing drupal_uc_epdq , I have also made the leap to changing the lines on one of my live sites. I am now just waiting for a payment to come through. Can you please let me know if you are having any other problems. If everyone is happy with this I think we should take control of this module and commit the changes.
Again, thanks warbital - I have been reading books about module development and scratching my head on this issue for ages. I am now keeping my fingers crossed waiting for that first payment.
#11
Hi John,
Yes that is exactly what I changed the values to in uc_epdq.module.
No the status does not change from 'pending' to 'complete', the orders come in as 'pending' and stay that way. This is what I expect to happen. As Merch pointed out in post #6 the payment is actually still pending until the EPDQ batch process completes at whatever time of day you set it to complete. This is no issue for me as we change the status of every order to complete (shipped) when they are picked up by the postman at the end of the day. If you need the order staus to change to "complete" you could create a Conditional Action for this.
However since making that change you are no longer directed back to a blank page after making payment. You are directed to page that says:
Order Complete
Your order is complete! Your order number is ***.
Thank you for shopping at ******. While logged in, you may continue shopping or view your current order status and order history.
The order is now captured in my system, stock is deducted correctly, emails set out etc.
Just to be clear I have no idea about creating modules or even how to make a patch. Instead of just waiting for a payment come through just put in an order yourself, you can easily refund (credit) the payent in EPDQ.
#12
UPDATE:
Only one of my 5 sites has 'drupal_uc_epdq' tables which is strange. The site I chose to change the code on did not have the table named as 'drupal_uc_epdq' (should have checked first) and changing the .module file resulted in the cart/checkout not working at all.
Be sure to check before you change anything!
I installed uc_epdq on a clean site and the table is called 'uc_epdq' as it should be. I'm not sure where the 'drupal_uc_epdq' anomaly came from.
#13
I think it may have something to do with the install that determines whether the tables have this prefix or not.
However I think there is a limitation in the module that needs working out. All my tables have this "drupal_" prefix and the rest of my site and all other add on modules seem to work just fine.
#14
IIRC the table prefix is set during the install of Drupal. I've not done any module development so I'm not sure but should something like db_prefix_tables($sql) be used to determine the table prefix if one is there.
See http://api.drupal.org/api/drupal/includes--database.inc/function/db_pref...
#15
Hey guys,
I've had the same problem as Jon marked in post #2. However when I examine the uc_epdq.module file I find the table names stated in lines 276 & 319 are correct and matching yet when I process a transaction it fails to post it to an order and takes me to a blank screen.
My settings are as follows;
Allowed url: http://"site_address"/cart/checkout/review
Post URL: http://"site_address"/cart/epdq/save
Return URL: http://"site_address"/cart/epdq/complete
I fail to see where the error has come from.
Can anyone help?
#16
fes-fusion - I had the same problem but solved it by replacing trueuc_epdq with uc_epdq in line 276 and 319 of the module code.
All works fine for me now but am struggling to remove the Delivery Address within ePDQ (we're selling services rather than physical products so don't need to collect this info).
The integration guide says; "To remove the Delivery Information from the CPI page:
<INPUT type="HIDDEN" NAME="collectdeliveryaddress" VALUE="0">" but can't for the life of me work out how and where to put this within the module to send this value to ePDQ.Can anyone help?