[Resolved v1.3.9d/e] Paypal IPN double orders
I recently had my host upgrade to PHP 5.2, so had to implement Dr Byte's fix for a speedy resolution. A couple of days later I noticed I started getting double orders, and worse still, my customers were getting double order emails. Each email has a consecutive order ID.
So best thing to do was to upgrade the 1.3.6 to 1.3.8. I was not sure whether the double orders were related to the sessions.php fix or something unrelated, but hoped an upgrade would solve both. I have just got my copied DB working on a "zen new" sub directory, and having just tested an end to end user order, I am still getting the double order.
Is this a known issue on the Paypal side (I read a thread where this happened before, ages ago) or something I can solve myself.
Because I was testing the install in a sub directory, I had to change the URLs on Paypal.com before the test. I wonder if I did not leave it long enough between changing them and testing?
Thanks for any help.
Re: Paypal IPN double orders
There have been some reports of getting duplicate notifications if you have PDT support enabled, and disabling that has been known to minimize that problem in some cases.
But, PDT support was only added in 1.3.7.1
Re: Paypal IPN double orders
Thanks Dr.
I did notice that the PDT option is enabled on Paypal.com, presumably by default when they added the feature. I wonder if switching that off might help.
I just don't see how the sessions.php fix could have done anything.
Either way, I will properly upgrade and see if it's still occurring.
Re: Paypal IPN double orders
The sessions.php "fix" has nothing to do with PayPal orders.
Re: Paypal IPN double orders
Upgrading seemed to do the trick.
Re: Paypal IPN double orders
Scratch that - my test orders worked, but a *real* one has just come through and again the double order. :oops:
Given that this seems to just affect me, and I am not using PDT, I am at a loss :(
Re: Paypal IPN double orders
Might be worth enabling paypal debug logging, and checking your logs folder for the IPN logs and see whether you're actually getting duplicate transactions from PayPal. Zen Cart should be detecting duplicates if they have same originating transaction ID from PayPal. But if PayPal is sending duplicates with different transaction IDs, I can see problems happening ... beyond control of ZC.
Re: Paypal IPN double orders
Thanks Dr and sorry in advance for the mammoth post.
I enabled logs to file, and a couple of orders greeted me this morning.
Looking at the logs, there are two separate files that reference the same chap:
Code:
Feb 17 2009 17:26 -- Keys for submission: Array
(
[charset] => iso-8859-1
//
STUFF
//
[tax_cart] => 0.00
)
The second seems more comprehensive:
Code:
Feb 17 2009 17:28 -- IPN PROCESSING INITIATED.
*** Originating IP: *.*.*.* notify.paypal.com
Feb 17 2009 17:28 -- IPN INFO - POST VARS received (sorted):
Array
(
STUFF
)
Feb 17 2009 17:28 -- IPN INFO - POST VARS to be sent back for validation:
To: www.paypal.com:80
POST /uk/cgi-bin/webscr HTTP/1.1
Host: www.paypal.com
Content-type: application/x-www-form-urlencoded
Content-length: 821
Connection: close
Array
(
STUFF
)
Feb 17 2009 17:28 -- IPN INFO - Confirmation/Validation response
SUCCESS
Feb 17 2009 17:28 -- Breakpoint: 1 - Collected data from PayPal notification
Feb 17 2009 17:28 -- IPN INFO :: Transaction email details.
From IPN = * | *
From CONFIG = *
Feb 17 2009 17:28 -- Breakpoint: 2 - Validated transaction components
Feb 17 2009 17:28 -- Breakpoint: 3 - Communication method verified
Feb 17 2009 17:28 -- IPN NOTICE :: Could not find matched txn_id record in DB. Therefore is new to us.
Feb 17 2009 17:28 -- Breakpoint: 4 - Details: txn_type=unique ordersID = 0 IPN_id=0
Relevant data from POST:
txn_type = unique
parent_txn_id = None
txn_id = *
Feb 17 2009 17:28 -- Breakpoint: 5 - Transaction type (txn_type) = unique
Feb 17 2009 17:28 -- IPN INFO :: Currency/Amount Details:
PayPal email address = ***
| mc_currency = GBP
| submitted_currency = GBP
| order_currency = GBP
| mc_gross = 4.99
| converted_amount = 4.99
| order_amount = 4.99
Feb 17 2009 17:28 -- Breakpoint: 6 - Completed IPN order add. ordersID = 6715 IPN_id =1202
So it does seem like Paypal are doing this. T tried switching the web service URL to the UK one layt night to see if it made any difference - evidently not.
Something possibly trivial - the Paypal account here is also used as the payment source for an eBay shop. I had 3 orders on the site since my last post so expected 3 (or in our case, 6) logs. I had 20 odd, and looking at them, they all seem to be referencing eBay auctions. I am a bit concerned as aside from this site, I am not using any other cart and there are things in the logs like auction titles so I know it's coming from eBay.
How on earth is Paypal getting logs to appear in my ZC install?
Code:
Feb 17 2009 17:16 -- IPN PROCESSING INITIATED.
*** Originating IP: *.*.*.* notify.paypal.com
Feb 17 2009 17:16 -- IPN FATAL ERROR :: Could not find stored session in DB, cannot re-create session as PayPal IPN transaction.
Feb 17 2009 17:16 -- IPN FATAL ERROR :: No saved IPN session data available. Must be an Express Checkout or Direct Pay transaction.
Feb 17 2009 17:16 -- IPN INFO - POST VARS received (sorted):
Array
(
STUFF
)
Feb 17 2009 17:16 -- IPN INFO - POST VARS to be sent back for validation:
To: www.paypal.com:80
POST /uk/cgi-bin/webscr HTTP/1.1
Host: www.paypal.com
Content-type: application/x-www-form-urlencoded
Content-length: 1312
Connection: close
Array
(
STUFF
)
Feb 17 2009 17:16 -- IPN INFO - Confirmation/Validation response
SUCCESS
Feb 17 2009 17:16 -- Breakpoint: 1 - Collected data from PayPal notification
Feb 17 2009 17:16 -- IPN INFO :: Transaction email details.
From IPN = * | *
From CONFIG = *
Feb 17 2009 17:16 -- Breakpoint: 2 - Validated transaction components
Feb 17 2009 17:16 -- Breakpoint: 3 - Communication method verified
Feb 17 2009 17:16 -- IPN NOTICE :: Could not find matched txn_id record in DB. Therefore is new to us.
Feb 17 2009 17:16 -- Breakpoint: 4 - Details: txn_type=unique ordersID = 0 IPN_id=0
Relevant data from POST:
txn_type = unique
parent_txn_id = None
txn_id = *
Feb 17 2009 17:16 -- Breakpoint: 5 - Transaction type (txn_type) = unique
Feb 17 2009 17:16 -- IPN WARNING :: Currency/Amount Mismatch. Details:
PayPal email address = *
| mc_currency = GBP
| submitted_currency = GBP
| order_currency = GBP
| mc_gross = 14.30
| converted_amount = 0.00
| order_amount = 0
Re: Paypal IPN double orders
The IPN handler should be able to decipher between PayPal transactions originating by your cart vs anything that it receives from eBay transactions (it normally just ignores those).
Re: Paypal IPN double orders
Quote:
Originally Posted by
DrByte
The IPN handler should be able to decipher between PayPal transactions originating by your cart vs anything that it receives from eBay transactions (it normally just ignores those).
Thanks again.
The IPN handler in ZC? But why is Paypal even invoking it in the first place if the users are paying via the eBay/ Paypal website?
In the case of the double orders, is what is contained within those code snippets enough to trigger two orders? The first one seem like it's just an array, whereas the second one has various success statements and references a ZC order ID.