Forums / Installing on a Windows Server / Missing products in order, paypal IPN stopping after BP 5

Missing products in order, paypal IPN stopping after BP 5

Locked

Started by mrabjohn on 7 Aug 2009, 3:14 PM · Views: 1,612

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
7 Aug 2009, 3:14 PM
#1
mrabjohn avatar

mrabjohn

New Zenner

Join Date:
Aug 2009
Posts:
2
Plugin Contributions:
0

Missing products in order, paypal IPN stopping after BP 5

Hi,

I have a copy of ZenCart 1.3.8 that was downloaded as a complete install from a Linux box. Our servers are Windows boxes, so we knew there would be issues.

We've configured ZenCart and we switched to Paypal payments Standard. Now, when an order is placed, there are no product lines on the order.

I can see that the system should generate a Paypal header log, and a paypal history log etc. before it generates the product list, however none of this info is being logged.

The last debug email received was the one sent from valid_payment, which was successful.

I don't know why this would go wrong, but we've already had to address issues where ZenCart tries to store empty string into numeric MySql fields.

Is it likely that the IPN handler is bailing out because of badly formed data inputs?

Any help would be appreciated.

Best Regards,

Mark Rabjohn

8 Aug 2009, 4:23 PM
#2
drbyte avatar

drbyte

Sensei

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

Re: Missing products in order, paypal IPN stopping after BP 5

mrabjohn:

I don't know why this would go wrong, but we've already had to address issues where ZenCart tries to store empty string into numeric MySql fields.
Zen Cart v1.3.8 was written for compatibility with PHP4 and MySQL 4, and it sounds like you're using MySQL 5 which has much stricter data-typing (unless the stricter mode is turned off).

In the case of your PayPal IPN concerns, you might try the following: http://www.zen-cart.com/forum/showpost.php?p=635003&postcount=17
I thought that was fixed as part of v1.3.8a, but I might be wrong.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

11 Aug 2009, 8:06 AM
#3
mrabjohn avatar

mrabjohn

New Zenner

Join Date:
Aug 2009
Posts:
2
Plugin Contributions:
0

Re: Missing products in order, paypal IPN stopping after BP 5

Hi,

Yes, I am indeed running on MySql 5 - this is because our MySql 4 branch installation isn't actually new enough (and we're not upgrading). I haven't seen any instruction that says that MySql 5 couldn't be used.

In any case, the only thing required to fix the IPN issue is to find the various hash building functions and recode to allow for appropriate defaults.

e.g. in ipn_create_order_array in paypal_functions, I changed 'num_cart_items' as follows:

From:

'num_cart_items' => $_POST['num_cart_items']

To:

'num_cart_items' => ($_POST['num_cart_items'] || 'null')

This has to be done wherever a numeric field is involved and the value could conceivably be an empty string (I probably haven't tracked them all down).

I'm not a PHP programmer, but I presume that my syntax works due to the way I have seen PHP programmers handle errors i.e. "or die()".

My client has not reported any problems which could potentially arise due to NULL values, is anybody aware of any issues that could arise with these numeric fields set to null?

Best Regards,

Mark

11 Aug 2009, 10:30 AM
#4
drbyte avatar

drbyte

Sensei

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

Re: Missing products in order, paypal IPN stopping after BP 5

If you use the suggestions made in the post I linked to earlier, you should be fine.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.