VirtueMart Forum

VirtueMart 2 + 3 + 4 => Plugins: Payment, Shipment and others => Topic started by: optmax on March 13, 2013, 18:21:01 PM

Title: [SOLVED partially!]Duplicate PayPal Orders in Backend
Post by: optmax on March 13, 2013, 18:21:01 PM
J!2.5.9
VM 2.0.18a
PHP 5.3.17

Vm Payment plugin Paypal 2.0.12
SSL installed and enabled

When a PaylPal order is made I get two orders in the Backend with different order number and ids but identical content.
The PayPal IPN updates the first of the pair to Confirmed- see attached screenshot.

I receive the PayPal notification email and the VM system Confirmed email.

I guess it is a configuration setting but where?
In VM or at PayPal?
The PayPal account was originally configured for a VM 1.0 site.  What if anything should I change?

Any help or advice is welcome.
Thanks

[attachment cleanup by admin]
Title: Re: Duplicate PayPal Orders in Backend
Post by: PRO on March 13, 2013, 19:17:57 PM
an order is created when they get redirected to paypal.

IF they do not pay then, the order stays, and is pending
Title: Re: Duplicate PayPal Orders in Backend
Post by: optmax on March 13, 2013, 19:43:20 PM
PRO - thanks for the input but...

They do pay as they order!
Look at the order creation times in the screenshot - identical (to the minute anyway) and it is the first order id/number (second row in the screenshot) that is updated by the IPN.

Just checked the orders database table: the time stamp on the later (top row screenshot)  'Pending' order  is 1 sec after the first order (2nd row screenshot).

The duplication happens for every PayPal order received.
Title: Re: Duplicate PayPal Orders in Backend
Post by: dennisg on May 30, 2013, 17:13:55 PM
Hi optmax,

I have the exact same issue with a credit card plugin I'm using.

Any luck solving this?
Title: Re: Duplicate PayPal Orders in Backend
Post by: AH on May 30, 2013, 21:39:34 PM
You need to step through the process on the frontend to see if the cache is cleared (i.e.) the cart is emptied after you go to paypal.

Title: Re: Duplicate PayPal Orders in Backend
Post by: drukman2000 on July 29, 2013, 03:07:35 AM
Hi,

Here is the solution....
Whenever emails are set at the same time BOTH to "Confirmed" & "Confirmed by shopper" - the system will create duplicate orders.
Just avoid this situation.

Thanks - Drukman.
Title: Re: Duplicate PayPal Orders in Backend
Post by: Maxim Pishnyak on July 29, 2013, 10:13:52 AM
Isn't this looks logically?

1st "confirmed" - 1st order.
2st "confirmed" - 2nd order.

No?
Title: Re: Duplicate PayPal Orders in Backend
Post by: AH on July 30, 2013, 11:11:39 AM
Could this be what you are experiencing

See reply #8 for possible resolution

http://forum.virtuemart.net/index.php?topic=117286.msg397351#msg397351 (http://forum.virtuemart.net/index.php?topic=117286.msg397351#msg397351)
Title: Re: Duplicate PayPal Orders in Backend
Post by: Maxim Pishnyak on July 30, 2013, 20:53:13 PM
Thanx, Hutson, for pointing this.
Title: Re: Duplicate PayPal Orders in Backend
Post by: drukman2000 on August 11, 2013, 09:03:21 AM
Quote from: Maxim Pishnyak on July 30, 2013, 20:53:13 PM
Thanx, Hutson, for pointing this.

Just found another configuration that cause duplicate orders to appear....

The next configuration causes Duplicate Orders to appear:

1. "agreed" uder the Shopper Fields is mandatory & published.
2.  "Show Terms of Service on the cart/checkout?" is active.

We are very far from being "bug free" -)).
Drukman.

Title: Re: Duplicate PayPal Orders in Backend
Post by: Maxim Pishnyak on August 11, 2013, 11:18:11 AM
Listen Jörgen, Drukman.
Title: Re: Duplicate PayPal Orders in Backend
Post by: Maxim Pishnyak on August 21, 2013, 15:57:02 PM
Quote from: drukman2000 on August 11, 2013, 09:03:21 AM
We are very far from being "bug free" -)).
A bit of searching for 'duplicate order' could give you an answer.
http://forum.virtuemart.net/index.php?topic=114154
http://forum.virtuemart.net/index.php?topic=95380
Title: Re: Duplicate PayPal Orders in Backend
Post by: optmax on January 28, 2014, 01:40:41 AM
VM 2.0.26d
J!2.5.16

I started this thread back in March 2013 but I have finally found the culprit - on my site at least.

I had a Custom HTML module with JavaScript displaying a clock.  This module fetched the server time using an XMLHttpRequest().

This module was shown on the cart pages.

With this PayPal orders were duplicated with different order numbers, one Pending and one Confirmed.

I have now found that if I fetch the client time using Date() then no order duplication occurs.

Anyone any ideas as to why XMLHttpRequest() causes the problem?

I guess it is some kind of timing issue but as this has been driving me mad for 10 months I would like to know why?
Title: Re: [SOLVED partially!]Duplicate PayPal Orders in Backend
Post by: optmax on January 29, 2014, 11:58:36 AM
I spoke too soon...

Using client time prevents some duplcates but unfortunately not all - around 50% in first 24 hours.

Any ideas anyone?