Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Urgent Help Needed with ePDQ Payments


rickhudson

Recommended Posts

Hi

 

Im using ePDQv2 and my problem is that I cannot find out what people have ordered on my site?!

 

All I am getting when I log onto my barclays account is the amount the transaction was for, the customers address and an order id...........nothing to show me what the actual order id relates to or what it is. There is also nothing showing up in the admin#orders section on the osc section.

 

If anyone can help please do! I need to get this thing finished by the end of the week :blush:

Link to comment
Share on other sites

  • Replies 388
  • Created
  • Last Reply

Top Posters In This Topic

Barclays won't record the ordered items. They just do the transaction.

 

The order should be saved into the osCommerce database tables and the order status updated when they move through the checkout procedures.

 

Please list all the steps you have taken to install this in great detail so we can start helping you.

Johan a.k.a. T0PS3O elsewhere.

 

Contributed Barclay's ePDQ Payment Module though not originally mine. Made it work though...

Link to comment
Share on other sites

hey joe,

 

Just reading the comments about orders not showing up and we've had a few here. Not many - probably about 4 in the several hundred orders we've had to date. We get exactly the same symptoms as mac - barclays have recorded the details but there is nothing in the osc database. Currently i've got all the diagnostic emails on and i'm waiting to see it happen again.

 

I think it's when a customer gets as far as barclays showing them the trasaction accepted screen and then closng the browser or using the back button- but this is only a guess.

 

gary

Link to comment
Share on other sites

Now you mention that, I know how that happens and I have a semi-working bug fix. It's not so much a bug but more unpredictable human behaviour combined with what was intended to be a feature. Here's the scenario:

 

Customer submits the form on checkout_payment (chooses epdq) which saves the order as 'awaiting transaction' (stores it to be independant of the last epdq button being pressed or not). If they now change their mind and want to pay by bank transfer and they get to the checkout_confirmation again the order is deleted and replaced by a new one. That was planned behaviour but based on no experience back in the days I was getting to know this stuff.

 

Here's how people phook it up:

 

They are on checkout_confirmation and go to barclays pages. Fill out their stuff and get to the 'success' page on epdq and their transaction is recorded (and shows in back-end). Now they decide it's a good idea to hit the back-button multiple times (??!!). They go back to checkout_payment which thinks "hey, they are changing their minds - lets delete this order". Order is wiped but is still in the epdq back-end.

 

That's how it happens. I indeed get it once every couple hundred orders too. But I half fixed it now but made a note to properly think it through. I am in fact planning to release the latest and greatest of this contrib soon.

 

Here's the semi-proper fix. It assumes you use the cpi/complete.php to update the order status. It basically won't delete if payment is received. Remember to match this against the order statusses you use. I completely overhauled all of that again so do make sure if you use this to match it up to your environment.

 

In checkout_payment, find the first instance of (approx line 31)

 

// [sEE HERE - ePDQ]

 

That batch of code that's following should be changed to something like:

 

// if the payment method was previously chosen as ePDQ OsC set a session and stored   // [SEE HERE - ePDQ]
// the order in the orders table already. But now they changed their mind so this can
// all be destroyed now.
//
// this is a bug since if the customer completes the ePDQ transaction
// and then heads back here to have a poke around, they can delete their own
// order leaving the merchant with a ghost ePDQ entry but no osCommerce order!
// So we'll have to limit deleting to those where orders_status != received.
// It's probably a good idea to kill the temp_id session so they can order again right away. 
//
///*		 ------ Still works if commented out
 if (tep_session_is_registered('cart_ePDQ_temp_id'))
 {
	$tmp_order_id = substr($cart_ePDQ_temp_id, strpos($cart_ePDQ_temp_id, '-')+1);	
  $order_status_check_query = tep_db_query("select orders_status from " . TABLE_ORDERS . " where orders_id = '" . (int)$tmp_order_id . "'");
	$orders_status_check = tep_db_fetch_array($order_status_check_query);
	if($orders_status_check['orders_status'] == 1 || $orders_status_check['orders_status'] == 4 || $orders_status_check['orders_status'] == 7) //1 = Awaiting Payment - 4 = Awaiting Card Transaction - 7 is Payment Declined
	{
		//delete the temp order where oid=temp_id
	  tep_db_query("delete from " . TABLE_ORDERS . " where orders_id = '" . (int)$tmp_order_id . "'");
	  tep_db_query("delete from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$tmp_order_id . "'");
	  tep_db_query("delete from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . (int)$tmp_order_id . "'");
	  tep_db_query("delete from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . (int)$tmp_order_id . "'");
	  tep_db_query("delete from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$tmp_order_id . "'");
	}
  //unregister session
  tep_session_unregister('cart_ePDQ_temp_id');
 }
//*/

 

Like I said, be careful with this. It has hard-coded variables. And I haven't thought this through properly yet. Once again, I will do a proper bundling up of what I think is good enough production code early January hopefully.

 

If you can see improvements, please post them!

Johan a.k.a. T0PS3O elsewhere.

 

Contributed Barclay's ePDQ Payment Module though not originally mine. Made it work though...

Link to comment
Share on other sites

Hello all,

 

I successfully installed the module to one osCommerce shop and it is processing orders quite well.

I have 1 question.

 

Here is the email that is generated by Barclaycards when the order is completed:

Thank you for your online order from *************************
Your order details follow: 
Order #: 1-20051220175819 

Tax: 
Shipping: 
Total: ?8.40

 

Is it possible to transfer Price, Tax & Shipping amounts seperately from osC (not just total amount), so that this email would be generated properly?

 

Tnx in advance.

Link to comment
Share on other sites

No, it isn't. Besides the interaction between checkout_confirm and barclays plus the POST there is no communication between the two. And indeed, pricing isn't discriminating between net, tax, shipping and total. You need MPI for that. With CPI only a total value is passed on to them which they use in their email.

 

I don't use that Barclays email confirmation anyway since they get a proper e-mail confirmation from osCommerce on checkout_process (if they indeed press that alst button though I am trying to get cpi/complete to send that in case of card payment). OsCommerce's confirmation can be formatted exactly how you want it so I'd just turn Barclays' email off.

Johan a.k.a. T0PS3O elsewhere.

 

Contributed Barclay's ePDQ Payment Module though not originally mine. Made it work though...

Link to comment
Share on other sites

Great! Thank you very much Joe for quick reply.

 

I'll do just that: disable Barclays notification (first I must find out how, because there is no option in ClearCommerce Engine) and then I'll modify cpi/complete.php to send proper notification in case of payment success or failure...

Link to comment
Share on other sites

Just go Administration -> Digital Receipt and untick all (that's what I have).

 

The Customer gets email notification if and when reaching checkout_process(sson to be taken over by complete if I can get to it).

 

The Merchant, you, gets a transaction confirmation via cpi/complete.php and a copy of the customer order confirmation on checkout_process. At least, that's how I have it. Can;t quite remember whether that's standard or a mod I did.

 

This ClearCommerce lite has more bells and whistles than it needs. Why record delivery address trying to pretend and be a full ecommerce tool whilst they don't accept an actual breakdown of the order (price, VAT, delivery, products etc.)?! Then just skip the delivery address page.

 

It seems half-finished or over done to me. I'd love for them to just stick to the necessary payment stuff. Delete delivery and even billing address, we pass it to them anyway. Then add AVS and CV2 response to the POST and it's perfect. Well, almost. If they made the Complete Order link more prominent or an actual button, or they allowed custom text there it would be smooth as can be.

 

BTW How does a Croatian developer get involved with Barclays? Do they bank there or are you in the UK?

Johan a.k.a. T0PS3O elsewhere.

 

Contributed Barclay's ePDQ Payment Module though not originally mine. Made it work though...

Link to comment
Share on other sites

  • 3 weeks later...

Hello

 

I need some help please as I have a problem with implementing the epdq contribution.

 

I have almost managed to get epdq working, as Barclays have put my account live and oscommerce is passing the information to epdq ok, epdq is taking money from bank accounts and allowing me to refund it.

 

The problem is that oscommerce does not record any of the orders and after clicking complete in epdq I am returned to shopping_cart.php?err=NotFound=38, no error message is shown.

 

Does any one know what the problem might be?

 

Dave

Link to comment
Share on other sites

Does it save the order when you hit checkout_confirmation.php with a temp status like Awaiting Card Transaction? Check that first.

 

Next thing to check is that your POST to cpi/complete.php is set up correctly and that it passes the oid and transaction status to complete.php so that file can take the temp order and update the order status.

 

Please report back with your findings.

Edited by JoeMcManus

Johan a.k.a. T0PS3O elsewhere.

 

Contributed Barclay's ePDQ Payment Module though not originally mine. Made it work though...

Link to comment
Share on other sites

Hello, thanks for super quick responce

 

All the orders are in the orders table with order status 4, I just noticed that order status 4-Awaiting Card Transaction was not in the orders_status table so I added it and now all my test orders are showing up in oscommerce admin (great). epdq still returns to shopping_cart.php?err=NotFound=39 though.

 

Next thing to check is that your POST to cpi/complete.php is set up correctly and that it passes the oid and transaction status to complete.php so that file can take the temp order and update the order status.

 

How do I check the above? epdq post url points to cpi/complete.php and epdq.php return url points to epdq_success.php.

Link to comment
Share on other sites

Good, that's a start. So it is actually recording the sale.

 

In cpi/complete.php - do you have it set it so it e-mails you the transaction status? If so, did you get e-mails (that way we know that script was requested by the POST successfully).

 

Also what I need to know is, in ePDQ.php in the payment modules folder, what is your return URL? Is it epdq_success?

 

It seems now as though the order gets recorded initially, cpi/complete isn't called so there is no entry in the epdq_transactions table and that's why, if indeed the return URL is epdq_success, that page can't find a successful transaction so it assumes error and redirects to the basket.

 

So please check e-mail, return url, and whether you have entries in the table called epdq_transactions.

Edited by JoeMcManus

Johan a.k.a. T0PS3O elsewhere.

 

Contributed Barclay's ePDQ Payment Module though not originally mine. Made it work though...

Link to comment
Share on other sites

Hello and thank you

 

The emails I get are:

 

Thank you for your online order from *****.

Your order details follow:

Order #: 38

 

Tax:

Shipping:

Total: ?11.11

 

If you have any questions regarding this order, contact our customer service at ******.

 

I presumed this was from epdq.

 

My email address is in complete.php, the return URL in the admin module is epdq_success but it is hardcoded in epdq.php aswell, the epdq_transactions table is completely empty.

 

I have just added 5 =Success and 6 = Error to orders_status table (not sure if this was needed). Still not working.

Link to comment
Share on other sites

That e-mail is not the one I was looking for.

 

My remote diagnosis is this: ePDQ does not perform the POST correctly or it can't reach cpi/complete. Otherwise you would have had an email and you would have found rows in epdq_transactions table.

 

Do you have detailed log files? To eliminate whether it's the ePDQ set-up or your htaccess etup, check your logs and see if access to complete.php was denied. If you find 403 - not authorized in your logs for cpi/complete.php you have errors in either your htaccess file for that folder or in your ePDQ setup.

 

Eliminate the first part if problems persist then you can ring Barclays support to run you through those settings. Your code seems fine, just your folder access or settings are screwd.

Johan a.k.a. T0PS3O elsewhere.

 

Contributed Barclay's ePDQ Payment Module though not originally mine. Made it work though...

Link to comment
Share on other sites

That e-mail is not the one I was looking for.

 

My remote diagnosis is this: ePDQ does not perform the POST correctly or it can't reach cpi/complete. Otherwise you would have had an email and you would have found rows in epdq_transactions table.

 

Do you have detailed log files? To eliminate whether it's the ePDQ set-up or your htaccess etup, check your logs and see if access to complete.php was denied. If you find 403 - not authorized in your logs for cpi/complete.php you have errors in either your htaccess file for that folder or in your ePDQ setup.

 

Eliminate the first part if problems persist then you can ring Barclays support to run you through those settings. Your code seems fine, just your folder access or settings are screwd.

 

Hello Joe

 

I'm having very similar problems and have just followed through on your advice.....

 

1. My orders so get their status updated.

2. Barclays DOES process the payment OK

 

However, I also get a fail error (where the number is the OSC order number) as there are no transactions to delete from the epdq table.

 

I have checked that the user name password in the Barclays CPI config are 100% equal to the name and password of the htaccess file. I do, however, note that the complete.php is not sending an email.

 

I have check my logs and have no access errors

 

I hope you can help!

 

Regards and Thanks in advance

 

Stuart

Link to comment
Share on other sites

Stuart (and Dave),

 

Can you access cpi/complete.php manually in the browser? If so, do you get an e-mail?

 

In the browser I get an error (expected since there's no oid in the GET) but before the error occurs it puts this in the database in epdq_transactions:

oid transaction_status transaction_time

manual call 2006-01-12 13:35:37

I also get an email that says:

CPI complete received

 

oid=

 

Posted variables

 

 

Get variables

cid = bad12-Jan-06 13:35:37

INSERT INTO epdq_transactions (oid, transaction_status, transaction_time) VALUES ('','manual call',NOW());

Result1 = 1

UPDATE orders SET orders_status = '7', last_modified = NOW() WHERE orders_id = ''

Result2 = 1

Err =

 

Please confirm you get something similar so I know your complete file is working.

Johan a.k.a. T0PS3O elsewhere.

 

Contributed Barclay's ePDQ Payment Module though not originally mine. Made it work though...

Link to comment
Share on other sites

Stuart (and Dave),

 

Can you access cpi/complete.php manually in the browser? If so, do you get an e-mail?

 

In the browser I get an error (expected since there's no oid in the GET) but before the error occurs it puts this in the database in epdq_transactions:

 

I also get an email that says:

Please confirm you get something similar so I know your complete file is working.

 

Hi Joe - thanks for answering

 

If I access http://www.store.com/cpi/complete.php, I first get the htaccess logon dialog. Once I enter the username and password I simlpy get a blamk page.

 

If I do a VIEW_SOURCE all that is present is:

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<HTML><HEAD>

<META http-equiv=Content-Type content="text/html; charset=iso-8859-1"></HEAD>

<BODY></BODY></HTML>

 

Hope this gives you some clues!

 

Regards

 

Stuart

Link to comment
Share on other sites

OK, please paste your complete.php script here then (in code brackets please) so I can have a look. Might want to obscure your e-mail address from it, otherwise there's nothing sensitive in there. Alternatively, PM me.

Johan a.k.a. T0PS3O elsewhere.

 

Contributed Barclay's ePDQ Payment Module though not originally mine. Made it work though...

Link to comment
Share on other sites

Hello and thanks for the help.

 

I made a change in epdq and ticked yes to post order result in cpi administraion and added an email address and the order went through to checkout_success.php and says success in admin even before clicking Complete Order.

 

I inititaly had not done this because in the epdq instalation guide it says POST Email is not supported and should be left blank, and if email is blank Post order result must be off. I know it seems obviously now.

 

There is still nothing in epdq_transactions though, is this correct?

 

One other thing, in firefox when I click complete order it pops up an unsecured conection warning, does this always happen?

 

Joe, is this the email you ment:

 

CPI complete received

 

oid=41

 

Posted variables

transactionstatus => Success

total => 11.11

clientid => *****

oid => 41

datetime => Jan 11 2006 17:05:13

chargetype => Auth

 

 

Get variables

Connect to db ****

Server ****

U: ****

P: ****

cid = 41

INSERT INTO epdq_transactions (oid, transaction_status, transaction_time) VALUES ('41','Success',NOW());

Result1 = 1

UPDATE orders SET orders_status = '5', last_modified = NOW() WHERE orders_id = '41'

Result2 = 1

Err =

 

I'm off to test it some more now.

Link to comment
Share on other sites

Dave, glad to hear it works for you. Yeah it does require the POST to work properly. Some people use it without the POST but that limits your possibilities. Indeed, everything is already stored as needed before the final complete button is pressed.

 

Your browser warning will be because your return URL isn't httpS. Make sure in ePDQ.php you set that correctly to a secure file like you did with the logo.

 

epdq_transactions get wiped right away again if all went through fine, so that being empty is OK.

 

To test, just complete a payment from start to finish and after every new pageload, refresh your tables to see what happened.

 

When you hit checkout_confirmation you should see a new order at the preliminary order_status. At the barclays confirmation page you should find that the POST together with complete.php have update the status to payment received or whatever you call it. Etc.

 

Besides the httpS, it seems like you are all set.

 

Stuart, make sure you check your POST settings as well.

Johan a.k.a. T0PS3O elsewhere.

 

Contributed Barclay's ePDQ Payment Module though not originally mine. Made it work though...

Link to comment
Share on other sites

OK, please paste your complete.php script here then (in code brackets please) so I can have a look. Might want to obscure your e-mail address from it, otherwise there's nothing sensitive in there. Alternatively, PM me.

 

Jo - have sent you PM

 

Regards

Link to comment
Share on other sites

Dave, glad to hear it works for you. Yeah it does require the POST to work properly. Some people use it without the POST but that limits your possibilities. Indeed, everything is already stored as needed before the final complete button is pressed.

 

Your browser warning will be because your return URL isn't httpS. Make sure in ePDQ.php you set that correctly to a secure file like you did with the logo.

 

epdq_transactions get wiped right away again if all went through fine, so that being empty is OK.

 

To test, just complete a payment from start to finish and after every new pageload, refresh your tables to see what happened.

 

When you hit checkout_confirmation you should see a new order at the preliminary order_status. At the barclays confirmation page you should find that the POST together with complete.php have update the status to payment received or whatever you call it. Etc.

 

Besides the httpS, it seems like you are all set.

 

Stuart, make sure you check your POST settings as well.

 

Hi Jo - I also had the POST set off based on what I've read. If I set it to YES, what do the Post USERNAME and PASSWORD refer to? Must these align with any existing access controls elsewhere?

 

Thanks

 

Stuart

Link to comment
Share on other sites

OK there must be some confusoin somewhere then. That POST setup screen of Barclays HAS to be filled out completely with the username and password you set in the htaccess file of the cpi/ folder. That setup is you telling barclays how and where to send the POST.

 

When you checked the logs, I assumed you actually found successful requests from a Barclays IP to cpi/complete.php but if it's switched off then it can't be that way.

 

Switch it on and see how you go. If problems persist, I'll attend to your PM.

 

BTW Where does Barclays say not to use POST? And rest assured, I took 15K+ orders since using this contrib and all of them successfully used the POST.

Johan a.k.a. T0PS3O elsewhere.

 

Contributed Barclay's ePDQ Payment Module though not originally mine. Made it work though...

Link to comment
Share on other sites

Hi Jo - I also had the POST set off based on what I've read. If I set it to YES, what do the Post USERNAME and PASSWORD refer to? Must these align with any existing access controls elsewhere?

 

Thanks

 

Stuart

 

Jo

 

just had this email turn-up!

 

CPI complete received

 

oid=

 

Posted variables

 

 

Get variables

Connect to db xxxxxxxx

Server localhost

U: username

P: password

cid = bad12-Jan-06 14:39:47

INSERT INTO epdq_transactions (oid, transaction_status, transaction_time) VALUES ('','manual call',NOW()); Result1 =

UPDATE orders SET orders_status = '1', last_modified = NOW() WHERE orders_id = '' Result2 = Not updated, transaction not successful. Please follow up. Err = Duplicate entry '' for key 1

 

 

On checking my epdq table - there is one entry

 

-> manual call 2006-01-12 11:16:05

 

 

Stuart

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...