Zen Cart Logo
Forums / General Questions / Order Confirmation Processing Block .. vs duplicate orders

Order Confirmation Processing Block .. vs duplicate orders

Views: 3,124

Results 1 to 20 of 35
15 Dec 2015, 3:25 PM
#1
lindasdd avatar

lindasdd

Zen Follower

Join Date:
Jun 2007
Posts:
474
Plugin Contributions:
0

Order Confirmation Processing Block .. vs duplicate orders

I recently switched from Fast and Easy Checkout page to the native checkout.

Although I prefer the native, I am getting a lot of duplicate orders - presumably from people clicking the button multiple times or some other impatient actions.

Does anyone have a link to tools that throw up the 'processing' image and block activity on the page while checkout is processing?

I believe this is usually handled by using BlockUI, but I haven't found the right implementation yet.

16 Dec 2015, 4:50 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Order Confirmation Processing Block .. vs duplicate orders

The default/native checkout in v1.5.4 already does "double-click prevention" on the checkout_confirmation page (where final payment is usually submitted) ... by using some brief javascript to disable the Submit button after it is clicked.

14 Jan 2016, 3:34 PM
#3
lindasdd avatar

lindasdd

Zen Follower

Join Date:
Jun 2007
Posts:
474
Plugin Contributions:
0

Re: Order Confirmation Processing Block .. vs duplicate orders

When an order is placed, what is it that clears the cart?

I'm trying to figure out how a duplicate is even possible since normally when an order goes in everything gets cleared from the cart,etc.

Thanks for any help you can give in pointing me in the right direction.

In some instances it seems the customer was given a 'decline' message in regards to their credit card - even though the order apparently went through.

14 Jan 2016, 4:19 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Order Confirmation Processing Block .. vs duplicate orders

After the order is created, a command is run to tell the cart to clear itself.
So, if yours isn't clearing it, then that suggests the order isn't being saved properly due to some error which is stopping all further actions.
You need to address those errors.

6 Jul 2016, 1:04 PM
#5
lindasdd avatar

lindasdd

Zen Follower

Join Date:
Jun 2007
Posts:
474
Plugin Contributions:
0

Re: Order Confirmation Processing Block .. vs duplicate orders

I am still having a duplicate order issue.

The template I'm using is Tableau and I have suspicions it is related to that (a Numinix rep also guessed as much as they are attempting to troubleshoot for me with no luck.)

Zen Cart 1.5.4
Using both Paypal Payments Pro and Express Checkout

I dug into the access logs based on comments from DrByte in another thread. Here is the logs related to one duplicate:

71.205.104.180 - - [06/Jul/2016:00:33:37 -0400] "POST /index.php?main_page=checkout_process HTTP/1.1" 302 20 "https://www.-----.com/index.php?main_page=checkout_confirmation" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36"
173.0.81.1 - - [06/Jul/2016:00:33:49 -0400] "POST /ipn_main_handler.php HTTP/1.1" 200 - "-" "PayPal IPN ( https://www.paypal.com/ipn )"
71.205.104.180 - - [06/Jul/2016:00:33:40 -0400] "POST /index.php?main_page=checkout_process HTTP/1.1" 302 20 "https://www.-----.com/index.php?main_page=checkout_confirmation" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36"
71.205.104.180 - - [06/Jul/2016:00:33:54 -0400] "GET /index.php?main_page=checkout_success&zenid=4d31995ddc8f20af217bb11c1a297c95 HTTP/1.1" 200 9623 "https://www.-----.com/index.php?main_page=checkout_confirmation" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36"
71.205.104.180 - - [06/Jul/2016:00:33:55 -0400] "GET /min/?f=/includes/templates/tableau/css/checkout_success.css,/includes/templates/tableau/css/auto_loaders/ajaxcartslide.css,/includes/templates/tableau/css/auto_loaders/jquery.fancybox.css&1444859563 HTTP/1.1" 200 2740 "https://www.-----.com/index.php?main_page=checkout_success&zenid=4d31995ddc8f20af217bb11c1a297c95" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36"
173.0.81.1 - - [06/Jul/2016:00:33:53 -0400] "POST /ipn_main_handler.php HTTP/1.1" 200 - "-" "PayPal IPN ( https://www.paypal.com/ipn )"

I realize this is a near impossible issue to dig into given I have a lot of custom coding, but any help would be appreciated. Just point me in the direction to dig.

6 Jul 2016, 1:48 PM
#6
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,100
Plugin Contributions:
56

Re: Order Confirmation Processing Block .. vs duplicate orders

Does the issue occur for both PayPal payment methods?

You could try turning on the payment methods' debug so that you'll see the processing performed by the ipn_main_handler; that would give you some clues as to how/why that processing is being invoked after the checkout_success page.

6 Jul 2016, 2:01 PM
#7
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Order Confirmation Processing Block .. vs duplicate orders

Maybe the IPN from PayPal is inserting a duplicate. The PHP code protects against that, but if you've altered the way checkout works then the processing of IPN notices might not be able to detect the duplicate so is inserting a new order for you.
Affected files are:
/ipn_main_handler.php
/includes/auto_loaders/paypal.core.php (and all the files mentioned inside it)
/includes/modules/payment/paypal/functions_paypal.php

One quick test (assuming you're always getting duplicates, and can trigger the problem on-demand) might be:

  1. Disable IPN Notifications within your PayPal Account
  2. Then do a transaction that's previously been triggering duplicates and see whether a duplicate appears.

The downside to turning off the IPN notifications is that your store will not be notified of updates/alterations to transactions, such as refunds, or payments that weren't fully authorized until reviewed or captured. In those cases you'll need to manually add your own notes to affected orders and update the status of those orders whenever an update is done on the PayPal end (usually they email you, but not always).

Another test is to use the Admin->Customers->PayPal report to look at the activity related to those duplicate orders. The "memo" field of the paypal history record will say something like "Order added due to incoming IPN notice" when an order is created via IPN.

Unfortunately the v155 versions of the above files cannot be used on v154 without accommodating some db changes and some new functions that were added, so applying bugfixes would have to be done manually. (Notable fixes are changing $scheme to https instead of http, and changing $ipn_logging to ipn_logging).

That said, if you were to investigate the code in ipn_main_handler and paypal_functions to understand how it attempts to detect "new" vs "existing" orders and come up with more data to help identify duplicates, perhaps PayPal has been changing something that needs to be accounted for. This would require enabling debug logging within PayPal Express/Pro, and perhaps a manual override to trigger IPN logging in order to monitor how it's treating incoming transactions and determine whether it's missing certain signals that could help identify duplicates vs believing it needs to insert a new record.

Hope that's helpful.

6 Jul 2016, 2:11 PM
#8
lindasdd avatar

lindasdd

Zen Follower

Join Date:
Jun 2007
Posts:
474
Plugin Contributions:
0

Re: Order Confirmation Processing Block .. vs duplicate orders

lat9:

Does the issue occur for both PayPal payment methods?

You could try turning on the payment methods' debug so that you'll see the processing performed by the ipn_main_handler; that would give you some clues as to how/why that processing is being invoked after the checkout_success page.

Yes. And it used to occur for the authorize.net module as well.

6 Jul 2016, 2:28 PM
#9
lindasdd avatar

lindasdd

Zen Follower

Join Date:
Jun 2007
Posts:
474
Plugin Contributions:
0

Re: Order Confirmation Processing Block .. vs duplicate orders

DrByte,
The duplicate issue doesn't occur on every order and has occurred in the past when using Authorize.net so I don't think it is related to Paypal. That being said I did look into the things you mentioned.

**The solution here is probably for me to switch away from Tableau and use the new one provided in 1.5.5. The problem is that getting my existing site(s) to look the same using a new template isn't a quick fix. I'm also surprised, because I couldn't find any other mention of this issue related to Tableau. I'm going to custom replace the includes/templates/tableau/templates/tpl_checkout_confirmation_default.php and see if that fixes anything.
**

When looking at Admin->Customers->PayPal there are no notes, only a link to the order (whereas refunded items include additional notes.)

There are no changes to:
/ipn_main_handler.php
/includes/auto_loaders/paypal.core.php (and all the files mentioned inside it)
/includes/modules/payment/paypal/functions_paypal.php

Although the part 'ad all the files mentioned inside it' was not double checked.

6 Jul 2016, 2:36 PM
#10
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,965
Plugin Contributions:
8

Re: Order Confirmation Processing Block .. vs duplicate orders

have you tried placing any test orders? in my experience, duplicate orders are related to problems with sending the order email.

the sequence goes something like this:

  • customer hits button to place order
  • timeout issue occurs due to email problem
  • customer sees error on screen, and browser asks if customer wants to resubmit form.
  • customer proceeds to do so; and second order is placed.

ZC does NOT clear the cart after the order gets created: that happens after the email gets sent.

see:

https://www.zen-cart.com/showthread.php?220384-Sudden-duplicate-authorize-net-transactions-%28Single-order-double-CC-charges%29&p=1312911#post1312911
https://www.zen-cart.com/showthread.php?216010-Duplicate-orders-in-1-5-3&p=1311441#post1311441
https://www.zen-cart.com/showthread.php?207877-Duplicate-Orders&p=1302345#post1302345

good luck!

6 Jul 2016, 3:54 PM
#11
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Order Confirmation Processing Block .. vs duplicate orders

lindasdd:

DrByte,
The duplicate issue doesn't occur on every order and has occurred in the past when using Authorize.net so I don't think it is related to Paypal. That being said I did look into the things you mentioned.

**The solution here is probably for me to switch away from Tableau and use the new one provided in 1.5.5. The problem is that getting my existing site(s) to look the same using a new template isn't a quick fix. I'm also surprised, because I couldn't find any other mention of this issue related to Tableau. I'm going to custom replace the includes/templates/tableau/templates/tpl_checkout_confirmation_default.php and see if that fixes anything.
**
Good point. It's VERY IMPORTANT that all customizations to your tpl_checkout_confirmation_default.php ALSO be added to tpl_ajax_checkout_confirmation if you're using Authnet AIM or PayPal Pro or any other module that collects card numbers directly on-site, because the ajax template is used to re-draw the page without transmitting the data back and forth to the server, thus avoiding any risk of unsafely handling card data ... but if your templates are out of sync odd things can happen.

6 Jul 2016, 9:26 PM
#12
lindasdd avatar

lindasdd

Zen Follower

Join Date:
Jun 2007
Posts:
474
Plugin Contributions:
0

Re: Order Confirmation Processing Block .. vs duplicate orders

carlwhat:

have you tried placing any test orders? in my experience, duplicate orders are related to problems with sending the order email.

the sequence goes something like this:

  • customer hits button to place order
  • timeout issue occurs due to email problem
  • customer sees error on screen, and browser asks if customer wants to resubmit form.
  • customer proceeds to do so; and second order is placed.

ZC does NOT clear the cart after the order gets created: that happens after the email gets sent.

see:

https://www.zen-cart.com/showthread.php?220384-Sudden-duplicate-authorize-net-transactions-%28Single-order-double-CC-charges%29&p=1312911#post1312911
https://www.zen-cart.com/showthread.php?216010-Duplicate-orders-in-1-5-3&p=1311441#post1311441
https://www.zen-cart.com/showthread.php?207877-Duplicate-Orders&p=1302345#post1302345

good luck!

I have order confirmation emails send to an admin email as well and emails were received for all orders (meaning the first in the duplicate did not fail - at least for the admin portion). I'm wondering if that means this isn't related to an email failure issue.

6 Jul 2016, 9:31 PM
#13
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,965
Plugin Contributions:
8

Re: Order Confirmation Processing Block .. vs duplicate orders

what are the time differences between the original order and the duplicate orders?

6 Jul 2016, 9:49 PM
#14
lindasdd avatar

lindasdd

Zen Follower

Join Date:
Jun 2007
Posts:
474
Plugin Contributions:
0

Re: Order Confirmation Processing Block .. vs duplicate orders

carlwhat:

what are the time differences between the original order and the duplicate orders?

One this morning was 11 seconds and another was 9 seconds.

6 Jul 2016, 9:56 PM
#15
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,965
Plugin Contributions:
8

Re: Order Confirmation Processing Block .. vs duplicate orders

ok. in my experience, i think we can safely safe it's "probably" not related to an email problem. most of the times when i would see this kind of error, the time differences were significantly greater.

best.

6 Jul 2016, 10:11 PM
#16
lindasdd avatar

lindasdd

Zen Follower

Join Date:
Jun 2007
Posts:
474
Plugin Contributions:
0

Re: Order Confirmation Processing Block .. vs duplicate orders

It is interesting that non duplicates have an access log like this:
"POST /index.php?main_page=checkout_confirmation
"POST /index.php?main_page=checkout_process
"GET /index.php?main_page=checkout_success&zenid=
"POST /ipn_main_handler.php HTTP/1.1" 200 - "-" "PayPal IPN

Whereas the duplicates are like this:
"POST /index.php?main_page=checkout_confirmation
"POST /index.php?main_page=checkout_process
"POST /ipn_main_handler.php HTTP/1.1" 200 (although the timestamp is actually 5 seconds after the next line item)
"POST /index.php?main_page=checkout_process
"GET /index.php?main_page=checkout_success&zenid=
"POST /ipn_main_handler.php HTTP/1.1" 200

10 Nov 2016, 3:09 PM
#17
lindasdd avatar

lindasdd

Zen Follower

Join Date:
Jun 2007
Posts:
474
Plugin Contributions:
0

Re: Order Confirmation Processing Block .. vs duplicate orders

I think I have nailed this down to an issue where the processing time for Paypal is so long that every once in awhile someone will navigate away from the page, come back, and resubmit, before Paypal sends back the confirmation.

As a result, the cart isn't cleared and the customer is able to place a duplicate order.

Paypal says they can't speed up processing, so I'm wondering how I could change the 'submitonce()' functionality on the checkout_confirmation button to be a page overlay instead of just a button overlay.

There are a number of examples online, and this functionality is used in the Numinix Fast and Easy Checkout with Ajax module, but I'm trying to figure out a way to apply it to the standard template.

Any help would be appreciated.

11 Nov 2016, 12:35 PM
#19
lindasdd avatar

lindasdd

Zen Follower

Join Date:
Jun 2007
Posts:
474
Plugin Contributions:
0

Re: Order Confirmation Processing Block .. vs duplicate orders

carlwhat:

seems like a lot of work.... have you tried:

https://www.zen-cart.com/showthread.php?220919-Credit-Card-Getting-Charged-Twice&p=1317476#post1317476

Nice suggestion.

As a result I put this in place:
https://www.zen-cart.com/showthread.php?202300-eWAY-Payment-Gateway-Rapid-3-0-API-Support-Thread&p=1314200#post1314200

It isn't a total page overlay, but it at least provides the customer a little more feedback by making the 'processing' image larger and visible even when the mouse isn't hovering over the button.

11 Nov 2016, 1:31 PM
#20
badarac avatar

badarac

Totally Zenned

Join Date:
Aug 2009
Location:
Longs, SC
Posts:
635
Plugin Contributions:
0

Re: Order Confirmation Processing Block .. vs duplicate orders

carlwhat:

seems like a lot of work.... have you tried:

https://www.zen-cart.com/showthread.php?220919-Credit-Card-Getting-Charged-Twice&p=1317476#post1317476
Since implementing that on several client sites they no longer see the duplicate orders. Hope this works for you. Dr B you might want to think about increasing the time in a future update.