Thanks for the clarification Doc! :-)
...heads off to change settings...
Thanks for the clarification Doc! :-)
...heads off to change settings...
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.
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,
Last edited by tfharman; 9 Mar 2010 at 05:28 PM.
Bookmarks