Zen Cart Logo
Forums / Bug Reports / [Resolved v1.3.9d/e] Paypal IPN double orders

[Resolved v1.3.9d/e] Paypal IPN double orders

Locked

Views: 11,095

Results 21 to 35 of 35
This thread is locked. New replies are disabled.
2 Nov 2009, 5:22 AM
#21
parkerlewis avatar

parkerlewis

New Zenner

Join Date:
Jun 2009
Posts:
11
Plugin Contributions:
0

[Resolved v1.3.9d/e] Paypal IPN double orders

I am having the same problem.

I have recently had 2 orders come in, exactly the same, but with a different order #.
Only one payment came through, though.

I have had the same thing happen twice in the last week. Both since I turned off Express Checkout. I was having problems with a continuing error with EC where I would get a message saying that the total in the shopping cart does not match the paypal total, or something like that.
I could not find a solution on the forums to that, so just switched off Express Checkout. Now I have had this double order problem twice in a week.

2 Nov 2009, 5:54 AM
#22
drbyte avatar

drbyte

Sensei

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

Re: [Resolved v1.3.9d/e] Paypal IPN double orders

As stated earlier, blanking out your PDT key has been reported to stop duplicates in some cases.

2 Nov 2009, 12:59 PM
#23
dmuk avatar

dmuk

New Zenner

Join Date:
Nov 2006
Posts:
46
Plugin Contributions:
0

Re: [Resolved v1.3.9d/e] Paypal IPN double orders

I never solved this with standard payments and had to move to Express Checkout, which came with it's own hassles (zen showing orders as paid but never getting the funds - we are still recouping our losses) until I did a clean install which solved the EC problem.

Suggest if possibly you ensure your code is the latest version. I assumed mine was but think that something got screwed up somewhere.

Zen still rules!

13 Nov 2009, 6:14 AM
#24
parkerlewis avatar

parkerlewis

New Zenner

Join Date:
Jun 2009
Posts:
11
Plugin Contributions:
0

Re: [Resolved v1.3.9d/e] Paypal IPN double orders

Yes I have been saying 'zencart rules' for a while now, but these
paypal issues are really starting to effect my business. I am going to be taking credit cards with my merchant account as of December, which will be a relief.
I am getting so many EC errors (failed checkouts), and now payments standard is doing these weird double orders.
I will keep trying anyway.....hopefully your suggestion works Dr Byte! Thanks as always for your quick replies.
:smile:

25 Nov 2009, 1:12 AM
#25
stardotstar avatar

stardotstar

New Zenner

Join Date:
Jun 2009
Posts:
6
Plugin Contributions:
0

Re: [Resolved v1.3.9d/e] Paypal IPN double orders

I am seeing double orders via paypal.

php 5.2.11
MySQL 5.0.85

ZC:
Zen Cart 1.3.8a
Database Patch Level: 1.3.8

I notice the following on the history of IPN -
most orders show as

"unique"

but the duplicate (order # 58 and 59) has a

"web_accept" first and then the dupe (except for the order ID) is "unique"

I will try blanking the PDT.

Will

24 Jan 2010, 4:32 AM
#26
psychosis avatar

psychosis

New Zenner

Join Date:
Apr 2006
Posts:
44
Plugin Contributions:
0

Re: [Resolved v1.3.9d/e] Paypal IPN double orders

How do you "blank the PDT" ?

this problem just randomly popped up yesterday for me. Its worked no problems just fine for almost 4 years now, through upgrades, etc. and now all the sudden most of my orders are coming through double. Only one paypal payment, but 2 seperate orders, and 2 seperate order numbers. Which wouldnt be a huge deal, but it messes with inventory (so if i have 2 left, it buys both, and removes the product from the website, and even when i delete the duplicate order and restock inventory, it still keeps the item off the website even though it replaces the stock to 1.)

the weird part is it doesnt do it with every order. only about 75%, although from other threads people say it only happens when the customer uses a credit card as opposed to paypal account balance.
i have the latest zen cart version and all that. like i said, this was working just fine until yesterday.

this is very frustrating, and i would love to know if anyone has had any luck with fixing this, or even diagnosing what the problem actually is.

2 Feb 2010, 12:53 AM
#27
psychosis avatar

psychosis

New Zenner

Join Date:
Apr 2006
Posts:
44
Plugin Contributions:
0

Re: [Resolved v1.3.9d/e] Paypal IPN double orders

bump just in case anyone has found anything about this?

2 Feb 2010, 3:43 AM
#28
drbyte avatar

drbyte

Sensei

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

Re: [Resolved v1.3.9d/e] Paypal IPN double orders

psychosis:

How do you "blank the PDT" ?
Simple:

  1. Login to your admin
  2. Take your mouse and click on "Modules"
  3. Slide your mouse down to "Payment", and click.
  4. Slide your mouse down to the "PayPal IPN" module, and click.
  5. Click the Edit button.
  6. Click in the PDT field, and delete what you had previously put in there.
  7. Scroll down the screen until the Save button appears.
  8. Take your mouse and slide it to the Save button and click.
5 Feb 2010, 4:50 AM
#29
redheads avatar

redheads

Zen Follower

Join Date:
May 2006
Posts:
119
Plugin Contributions:
0

Re: [Resolved v1.3.9d/e] Paypal IPN double orders

Quick Qs since I have had several of these double order problems lately...

If you blank the PDT how is the payment record updated - I thought that value helps feed the data back to the cart and was necessary. I obviously misunderstand. Can you clarify what that value does, why blanking it is is ok, will it affect any other function of our reports, etc?

Thanks for any light you can shed. I do not need a LOT of detail, just wondering how it might affect my reports when next year's tax time rolls around, or if I will no longer see the transaction details, or... ??

:-)

5 Feb 2010, 7:06 AM
#30
drbyte avatar

drbyte

Sensei

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

Re: [Resolved v1.3.9d/e] Paypal IPN double orders

"Website Payments Standard" is PayPal's least-sophisticated method of handling transactions. In order for it to work with a shopping cart, your store must send the order amount and customer details to PayPal along with a request to have the customer log in and authorize the payment. Then for your store to know about the transaction it must wait for PayPal's servers to talk to your server in the background. Many times that communication fails for a multitude of possible reasons. PDT is a bandage PayPal added to allow the store to request the details of the transaction to confirm it before the background notification happens. It too can fail for many reasons. If you blank out the PDT value, then Zen Cart won't bother attempting to use PDT to check on order details, thus forcing you to rely on the background notification referred to as IPN.

The best way to avoid all those problems is to click "Remove" on the Website Payments Standard/IPN module, and use Express Checkout instead. It's a much more mature technology and not subject to the many weaknesses of the IPN/PDT approach.

5 Feb 2010, 7:06 PM
#31
redheads avatar

redheads

Zen Follower

Join Date:
May 2006
Posts:
119
Plugin Contributions:
0

Re: [Resolved v1.3.9d/e] Paypal IPN double orders

Thanks for the clarification Doc! :-)

...heads off to change settings...

10 Feb 2010, 4:39 PM
#32
mtrinh27 avatar

mtrinh27

New Zenner

Join Date:
Jan 2010
Posts:
4
Plugin Contributions:
0

Re: [Resolved v1.3.9d/e] Paypal IPN double orders

redheads:

Thanks for the clarification Doc! :-)

...heads off to change settings...
Posted via Mobile Device

10 Feb 2010, 4:40 PM
#33
mtrinh27 avatar

mtrinh27

New Zenner

Join Date:
Jan 2010
Posts:
4
Plugin Contributions:
0

Re: [Resolved v1.3.9d/e] Paypal IPN double orders

redheads:

Thanks for the clarification Doc! :-)

...heads off to change settings...
My PDT is blank and I still have the problem. :(
Posted via Mobile Device

12 Feb 2010, 12:44 PM
#34
captonzoom avatar

captonzoom

New Zenner

Join Date:
Jul 2008
Posts:
24
Plugin Contributions:
0

Re: [Resolved v1.3.9d/e] Paypal IPN double orders

I just started having the problem too. Yesterday I had 2 orders in my Zen Cart, one paypal payment, Both orders having the same PayPal ID Number.

9 Mar 2010, 4:22 PM
#35
tfharman avatar

tfharman

New Zenner

Join Date:
Mar 2010
Posts:
3
Plugin Contributions:
0

Re: [Resolved v1.3.9d/e] Paypal IPN double orders

Hi all,

I have had the double order issue as well and it looks to me as if this has been going on now for over 2 years. If you're like me you need the IPN because you want to use all of the checkout screens to gather other information (e.g. delivery date). I have found a fix for at least all the ills I have had with the Paypal IPN module to this point.

The first issue was with the blank screen after the paypal redirect (make sure you have the paths for HTTP & HTTPS setup correctly in your configure.php because zencart hardcodes the IPN return. Yes it doesn't matter what you put in Paypal but you should have paypal setup with the correct paths; and the configure.php paths are even more important if you copy them from zencart admin for paypal. Yes I'm running 1.3.8a). This blank screen was/is caused because zencart is trying to write the payment_date to the paypal table in the wrong format. Once it fails the whole order fails, hence could be the missing order issue as well. In your includes/modules/payment/paypal.php at around line 412 (if it is not modded) you will see a line like this (as always, make a backup copy of your paypal.php file):

'payment_date' => trim(preg_replace('/[^0-9-:]/', ' ', $this->pdtData['payment_date'])),

Make it look like this in case you need it later:

/'payment_date' => trim(preg_replace('/[^0-9-:]/', ' ', $this->pdtData['payment_date'])),/

Then add this under it.
'payment_date' => datetime_to_sql_format($this->pdtData['payment_date']),

There was a post with this fix in it but the syntax was wrong. The individual who posted it presented it like this:

   'payment_date' => this->datetime_to_sql_format($this->pdtData['payment_date']),

but datetime_to_sql_format() is already defined in paypal_functions.php and doesn't need to be re-defined. So make sure the line looks like this:

  'payment_date' => datetime_to_sql_format($this->pdtData['payment_date']),

That should take care of the blank screen and missing order issues upon return from paypal. You should also make sure you have the correct return paths defined in your paypal setup for IPN and PDT because there will be more updates to zencart and possibly the paypal module so it's best to have everything setup correctly.

That doesn't address the double order issue though. I found this fix because of a zenner by the name of Lissa but haven't found her post yet. She went through moving servers and countless tests with paypal. It was the email from the paypal tech that repaired the double order issue. See after I found out zencart was hardcoding (substituting its own path for the IPN paypal path, complements of Linvio) i figured there was something to the "rm" = 2 issue and the tech explanation of what paypal was looking for. See even if you turn off PDT (leave it blank, just gave me a blank order on windows, probably not on Linux considering Linux was getting 2 full orders). The paypal tech said they were looking for the get method and not the post method and that "rm" = 2 was sending the data as post. See it seems the IPN return is creating an order (actually the first order, for me blank in windows) and the PDT is creating the order (The one you want with all the paypal info in it as well). To make a long story a little shorter here's how to fix it. The line is in the includes/modules/payments/paypal.php at about line 211 (again if not modded and make a copy of paypal.php in case something goes wrong):

change 'rm' => 2,

to look like this:

'rm' => 1,

This has fixed my double order issues and the store is working fine. I am getting the PDT info in the admin as I wanted and no more blank orders. I hope this helps and thank everybody for their posts to point in the right direction. I do hope, however, that you don't put as much time in fixing yours as I did mine.

Best regards,