Forums / General Questions / PayPal Duplicate/Double Orders and PayPal Error Log when Customer places an Order

PayPal Duplicate/Double Orders and PayPal Error Log when Customer places an Order

Views: 866

Results 1 to 4 of 4
27 Sep 2021, 11:54 PM
#1
rlexyd avatar

rlexyd

Zen Follower

Join Date:
Nov 2006
Location:
Sydney, Australia
Posts:
490
Plugin Contributions:
0

PayPal Duplicate/Double Orders and PayPal Error Log when Customer places an Order

Running Zen cart 1.5.7c on PHP 7.4 with OPC using Responsive Classic template.
Payments accepted (PayPal Website Payments Standard & Bank Transfer).

Recently We have been getting Duplicate Orders on EVERY order that came when customers chose PayPal as their payment method.
I know the great DrByte always advises NOT to use that payment method, so if anyone doesn't have to use this payment, you should follow his advise.
After doing a LOT of online research on the forum and elsewhere, I finally found a Fix that worked for us :D
It was in a post by LissaE from a response from PayPal tech support...
https://www.zen-cart.com/showthread.php?118940-Paypal-IPN-Duplicate-Orders&p=684448#post684448
*Also found a link to the above post from another post which also has other suggestions by tfharman...
*https://www.zen-cart.com/showthread.php?120386-Resolved-v1-3-9d-e-Paypal-IPN-double-orders&p=854352#post854352

It suggested changing the code in includes/modules/payments/paypal.php on Line 218 from:

 'redirect_cmd' => '_xclick','rm' =>[B] 2[/B],'bn' => 'zencart','mrb' => 'R-6C7952342H795591R','pal' => '9E82WJBKKGPLQ',

**TO **

'redirect_cmd' => '_xclick','rm' => [B]1[/B],'bn' => 'zencart','mrb' => 'R-6C7952342H795591R','pal' => '9E82WJBKKGPLQ',

This did the trick for us, we have STOPPED getting Duplicate Orders when customers choose PayPal.

We are still getting the following Error log PHP Notice Generate every time a PayPal order comes through :(

 Request URI: /ipn_main_handler.php
--> PHP Notice: Undefined index: ppdebug in /ipn_main_handler.php on line 119.
--> PHP Notice: Undefined index: exchange_rate in /ipn_main_handler.php on line 154.
--> PHP Notice: Undefined index: settle_amount in /ipn_main_handler.php on line 156.
--> PHP Notice: Undefined index: parent_txn_id in /ipn_main_handler.php on line 181.
--> PHP Notice: Undefined index: auth_status in [B]/ipn_main_handler.php[/B] on line 184.


 Request URI: /ipn_main_handler.php
#1  flat->update_status() called at [/includes/modules/shipping/flat.php:28]
#2  flat->__construct() called at [/includes/classes/shipping.php:68]
#3  shipping->__construct() called at [/ipn_main_handler.php:294]
--> PHP Notice: Trying to get property 'delivery' of non-object in /includes/modules/shipping/flat.php on line 41.
--> PHP Notice: Trying to access array offset on value of type null in /includes/modules/shipping/flat.php on line 41.
--> PHP Notice: Trying to access array offset on value of type null in [B]/includes/modules/shipping/flat.php[/B] on line 41.


 Request URI: /ipn_main_handler.php
#1  ot_shipping->process() called at [/includes/classes/order_total.php:65]
#2  order_total->process() called at [/ipn_main_handler.php:306]
--> PHP Notice: Undefined index: flat in /includes/modules/order_total/ot_shipping.php on line 81.
--> PHP Notice: Trying to get property 'tax_class' of non-object in [B]/includes/modules/order_total/ot_shipping.php[/B] on line 81.


 Request URI: /ipn_main_handler.php
#1  ipn_create_order_array() called at [/ipn_main_handler.php:321]
--> PHP Notice: Undefined index: reason_code in /includes/modules/payment/paypal/paypal_functions.php on line 278.
--> PHP Notice: Undefined index: pending_reason in /includes/modules/payment/paypal/paypal_functions.php on line 281.
--> PHP Notice: Undefined index: invoice in /includes/modules/payment/paypal/paypal_functions.php on line 282.
--> PHP Notice: Undefined index: payer_business_name in /includes/modules/payment/paypal/paypal_functions.php on line 286.
--> PHP Notice: Undefined index: parent_txn_id in /includes/modules/payment/paypal/paypal_functions.php on line 302.
--> PHP Notice: Undefined index: settle_currency in /includes/modules/payment/paypal/paypal_functions.php on line 307.


 Request URI: /ipn_main_handler.php
#1  ipn_create_order_history_array() called at [/ipn_main_handler.php:328]
--> PHP Notice: Undefined index: parent_txn_id in /includes/modules/payment/paypal/paypal_functions.php on line 324.
--> PHP Notice: Undefined index: pending_reason in [B]/includes/modules/payment/paypal/paypal_functions.php[/B] on line 326.


 Request URI: /ipn_main_handler.php
--> PHP Notice: Undefined index: pending_reason in /ipn_main_handler.php on line 339.
--> PHP Notice: Undefined index: parent_txn_id in/ipn_main_handler.php on line 339.


 Request URI: /ipn_main_handler.php
--> PHP Notice: Undefined property: ot_subtotal::$credit_class in /ipn_main_handler.php on line 362.
--> PHP Notice: Undefined property: ot_shipping::$credit_class in /ipn_main_handler.php on line 362.
--> PHP Notice: Undefined property: ot_total::$credit_class in /ipn_main_handler.php on line 362.


 Request URI: /ipn_main_handler.php
--> PHP Notice: Undefined index: orders_status in /ipn_main_handler.php on line 380.


 Request URI: /ipn_main_handler.php
--> PHP Notice: Undefined variable: otax in [B]/ipn_main_handler.php[/B] on line 381.

*Zen Cart eCommerce Solution - Putting the Dream of Owning an Online Business within reach of anyone!

5 Dec 2021, 10:38 PM
#2
rlexyd avatar

rlexyd

Zen Follower

Join Date:
Nov 2006
Location:
Sydney, Australia
Posts:
490
Plugin Contributions:
0

Re: PayPal Duplicate/Double Orders and PayPal Error Log when Customer places an Order

Ok, so we started getting more duplicate orders, in the end we also removed the email address from [PDT Token (Payment Data Transfer)] from the PayPal Website Payments Standard in Admin/Payment Module **and **Turned OFF Instant Payment Notification (IPN) on the PayPal website as DrByte mentions in this Post and this Post, and now no more duplicate orders :)

*Zen Cart eCommerce Solution - Putting the Dream of Owning an Online Business within reach of anyone!

6 Dec 2021, 11:43 AM
#3
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,728
Plugin Contributions:
56

Re: PayPal Duplicate/Double Orders and PayPal Error Log when Customer places an Order

Thanks for this report - hopefully it will help others too.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

4 Jan 2022, 4:29 PM
#4
jabbawocky avatar

jabbawocky

New Zenner

Join Date:
Sep 2007
Location:
Yorkshire
Posts:
16
Plugin Contributions:
0

Re: PayPal Duplicate/Double Orders and PayPal Error Log when Customer places an Order

Getting the Duplicate orders since upgrading and have changed the '2' to a '1' in "includes/modules/payments/paypal.php on Line 218"

Have also turned off IPN on the Paypal website.

Was this correct?

Have to wait for someone to order to see if this works?