Paypal Orders Coming Through As Pending

So not sure what has caused this but all PayPal orders over the last few days have started coming through as Pending (O status) instead of Approved (P status). I thought is may have been since I modified some ShipRush files but I put them back to normal and the issue still persists. So thought it may be CloudFlare causing the issue so turned it off but I am still getting orders not coming though as approved. This is for any PayPal payment option as far as I can tell. I have Standard, Express and Pro and all have the issue. But I had someone pay with Amazon pay and didn't have any issue. Any suggestions? Recent error log posted below in case something stands out.

[11-Nov-2018 21:59:51 America/Chicago] PHP Notice: Undefined offset: 1 in /home/fastdeca/public_html/shop/app/addons/sd_onepage_checkout/controllers/frontend/checkout.post.php on line 37
[11-Nov-2018 21:59:51 America/Chicago] PHP Notice: Undefined offset: 0 in /home/fastdeca/public_html/shop/app/addons/sd_onepage_checkout/controllers/frontend/checkout.post.php on line 37
[11-Nov-2018 21:59:51 America/Chicago] PHP Warning: http_build_query(): Parameter 1 expected to be Array or Object. Incorrect value given in /home/fastdeca/public_html/shop/app/addons/sd_onepage_checkout/controllers/frontend/checkout.post.php on line 44
[11-Nov-2018 21:59:55 America/Chicago] PHP Notice: Undefined offset: 1 in /home/fastdeca/public_html/shop/app/addons/sd_onepage_checkout/controllers/frontend/checkout.post.php on line 37
[11-Nov-2018 21:59:55 America/Chicago] PHP Notice: Undefined offset: 0 in /home/fastdeca/public_html/shop/app/addons/sd_onepage_checkout/controllers/frontend/checkout.post.php on line 37
[11-Nov-2018 21:59:55 America/Chicago] PHP Warning: http_build_query(): Parameter 1 expected to be Array or Object. Incorrect value given in /home/fastdeca/public_html/shop/app/addons/sd_onepage_checkout/controllers/frontend/checkout.post.php on line 44
[11-Nov-2018 22:02:11 America/Chicago] PHP Notice: Undefined offset: 1 in /home/fastdeca/public_html/shop/app/addons/sd_onepage_checkout/controllers/frontend/checkout.post.php on line 37
[11-Nov-2018 22:02:11 America/Chicago] PHP Notice: Undefined offset: 0 in /home/fastdeca/public_html/shop/app/addons/sd_onepage_checkout/controllers/frontend/checkout.post.php on line 37
[11-Nov-2018 22:02:11 America/Chicago] PHP Warning: http_build_query(): Parameter 1 expected to be Array or Object. Incorrect value given in /home/fastdeca/public_html/shop/app/addons/sd_onepage_checkout/controllers/frontend/checkout.post.php on line 44
[11-Nov-2018 22:02:13 America/Chicago] PHP Notice: Undefined offset: 1 in /home/fastdeca/public_html/shop/app/addons/sd_onepage_checkout/controllers/frontend/checkout.post.php on line 37
[11-Nov-2018 22:02:13 America/Chicago] PHP Notice: Undefined offset: 0 in /home/fastdeca/public_html/shop/app/addons/sd_onepage_checkout/controllers/frontend/checkout.post.php on line 37
[11-Nov-2018 22:02:13 America/Chicago] PHP Warning: http_build_query(): Parameter 1 expected to be Array or Object. Incorrect value given in /home/fastdeca/public_html/shop/app/addons/sd_onepage_checkout/controllers/frontend/checkout.post.php on line 44
[11-Nov-2018 22:02:16 America/Chicago] PHP Notice: Undefined offset: 1 in /home/fastdeca/public_html/shop/app/addons/sd_onepage_checkout/controllers/frontend/checkout.post.php on line 37
[11-Nov-2018 22:02:16 America/Chicago] PHP Notice: Undefined offset: 0 in /home/fastdeca/public_html/shop/app/addons/sd_onepage_checkout/controllers/frontend/checkout.post.php on line 37
[11-Nov-2018 22:02:16 America/Chicago] PHP Warning: http_build_query(): Parameter 1 expected to be Array or Object. Incorrect value given in /home/fastdeca/public_html/shop/app/addons/sd_onepage_checkout/controllers/frontend/checkout.post.php on line 44
[11-Nov-2018 22:03:43 America/Chicago] PHP Notice: Undefined offset: 1 in /home/fastdeca/public_html/shop/app/addons/sd_onepage_checkout/controllers/frontend/checkout.post.php on line 37
[11-Nov-2018 22:03:43 America/Chicago] PHP Notice: Undefined offset: 0 in /home/fastdeca/public_html/shop/app/addons/sd_onepage_checkout/controllers/frontend/checkout.post.php on line 37
[11-Nov-2018 22:03:43 America/Chicago] PHP Warning: http_build_query(): Parameter 1 expected to be Array or Object. Incorrect value given in /home/fastdeca/public_html/shop/app/addons/sd_onepage_checkout/controllers/frontend/checkout.post.php on line 44
[11-Nov-2018 22:03:47 America/Chicago] PHP Notice: Undefined offset: 1 in /home/fastdeca/public_html/shop/app/addons/sd_onepage_checkout/controllers/frontend/checkout.post.php on line 37
[11-Nov-2018 22:03:47 America/Chicago] PHP Notice: Undefined offset: 0 in /home/fastdeca/public_html/shop/app/addons/sd_onepage_checkout/controllers/frontend/checkout.post.php on line 37
[11-Nov-2018 22:03:47 America/Chicago] PHP Warning: http_build_query(): Parameter 1 expected to be Array or Object. Incorrect value given in /home/fastdeca/public_html/shop/app/addons/sd_onepage_checkout/controllers/frontend/checkout.post.php on line 44
[11-Nov-2018 22:04:20 America/Chicago] PHP Notice: Undefined offset: 1 in /home/fastdeca/public_html/shop/app/addons/sd_onepage_checkout/controllers/frontend/checkout.post.php on line 37
[11-Nov-2018 22:04:20 America/Chicago] PHP Notice: Undefined offset: 0 in /home/fastdeca/public_html/shop/app/addons/sd_onepage_checkout/controllers/frontend/checkout.post.php on line 37
[11-Nov-2018 22:04:20 America/Chicago] PHP Warning: http_build_query(): Parameter 1 expected to be Array or Object. Incorrect value given in /home/fastdeca/public_html/shop/app/addons/sd_onepage_checkout/controllers/frontend/checkout.post.php on line 44
[11-Nov-2018 22:05:28 America/Chicago] PHP Warning: round() expects parameter 2 to be long, string given in /home/fastdeca/public_html/shop/app/functions/fn.common.php on line 819
[11-Nov-2018 22:05:28 America/Chicago] PHP Warning: number_format() expects parameter 2 to be long, string given in /home/fastdeca/public_html/shop/app/functions/fn.cart.php on line 4260
[11-Nov-2018 22:08:02 America/Chicago] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 72 bytes) in /home/fastdeca/public_html/shop/app/functions/fn.ultimate.php on line 3240

Here are lines 37 and 44 from that app that is causing error:

37

list($status, $redirect_params) = fn_checkout_update_steps($cart, $auth, $params);

44

return array(CONTROLLER_STATUS_REDIRECT, 'checkout.checkout?' . http_build_query($redirect_params));

So not sure what has caused this but all PayPal orders over the last few days have started coming through as Pending (O status) instead of Approved (P status). I thought is may have been since I modified some ShipRush files but I put them back to normal and the issue still persists. So thought it may be CloudFlare causing the issue so turned it off but I am still getting orders not coming though as approved. This is for any PayPal payment option as far as I can tell. I have Standard, Express and Pro and all have the issue. But I had someone pay with Amazon pay and didn't have any issue. Any suggestions? Recent error log posted below in case something stands out.

Here are lines 37 and 44 from that app that is causing error:

Hello!

Please check these links

https://forum.cs-cart.com/tracker/issue-6964-some-paypal-orders-come-in-as-open-and-dont-change-to-processes/

https://forum.cs-cart.com/topic/53586-paypal-ipn-and-google-recaptcha-addon-from-ecom-labs-stoped-working

It seems that this situation occurs not only in your store.

Thanks. Following both now. Oddly I had read one of the posts a few days ago but it must've been before anyone else posted the newer ones since I ignored it since the last post was like a year old.

I have read thru these linked posts which confirm the issue, but don't find a solution there.

As of November 8th or 9th, Paypal merchant account no longer updates order to "Processed" status following successful payment.

Could you please advise what to do to resolve this?

Yeah, we need a solution @ Cs-cart!

We are also having this problem. Seemed to start on 11/09/18 or at least that is when it was first noticed. All Paypal orders are currently having this problem.

I confirm I have the same problem, the IPN stays awaiting and the status OPEN for processed orders

Sent from my SM-G9550 using Tapatalk

Has anyone had a reply from CS Cart yet regarding this issue?

A number our clients carts are effected, all on WHM servers.

Hi,

Just to add this has happened with our cart too,

IPN is sent, and received, but not processed, and were on WHM / cPanel too

Stephen

The quick and easy solution is to enable a notification for the New order status that PayPal orders are coming in as.

Then open a support ticket. CSC support is acknowledging that there is a bug in CSC and they will fix the issue on your installation.

After the fix, we are now getting two status notifications sent so we just disabled the one that we never used anyhow.

You don't need to create a new status. Just save a search for Open orders paid through paypal and you'll get a nice list.

DO check because I had 1 order in them that was not actually paid!

The only issue we saw was the lack of a Customer and Admin notification of the order. We did not create a new status. We just enabled the status for the notification that PayPal was now using.

I was following a bunch of threads on this IPN issue, but the solution that worked for us was posted here (on Page 2) - by "The Tool" - I hope this helps:

https://forum.cs-cart.com/topic/53586-paypal-ipn-and-google-recaptcha-addon-from-ecom-labs-stoped-working/page-2?hl=ipn&

/app/Tygh/http.php:

Find

/**
* Parse response contents to split headers
* @param string $content response contents
* @return string contents without headers
*/

private static function _parseContent($content)
{
while (strpos(ltrim($content), 'HTTP/1') === 0) {
list(self::$_headers, $content) = preg_split("/(\r?\n){2}/", $content, 2);
}

return $content;
}

Replace:

/**
* Parse response contents to split headers
* @param string $content response contents
* @return string contents without headers
*/

private static function _parseContent($content)
{
while (strpos(ltrim($content), 'HTTP/1') === 0) {
list(self::$_headers, $content) = preg_split("/(\r?\n){2}/", $content, 2);
}

while (strpos(ltrim($content), 'HTTP/2') === 0) {
list(self::$_headers, $content) = preg_split("/(\r?\n){2}/", $content, 2);
}

return $content;
}

I was following a bunch of threads on this IPN issue, but the solution that worked for us was posted here (on Page 2) - by "The Tool" - I hope this helps:

https://forum.cs-cart.com/topic/53586-paypal-ipn-and-google-recaptcha-addon-from-ecom-labs-stoped-working/page-2?hl=ipn&

/app/Tygh/http.php:

Find

/**
* Parse response contents to split headers
* @param string $content response contents
* @return string contents without headers
*/

private static function _parseContent($content)
{
while (strpos(ltrim($content), 'HTTP/1') === 0) {
list(self::$_headers, $content) = preg_split("/(\r?\n){2}/", $content, 2);
}

return $content;
}

Replace:

/**
* Parse response contents to split headers
* @param string $content response contents
* @return string contents without headers
*/

private static function _parseContent($content)
{
while (strpos(ltrim($content), 'HTTP/1') === 0) {
list(self::$_headers, $content) = preg_split("/(\r?\n){2}/", $content, 2);
}

while (strpos(ltrim($content), 'HTTP/2') === 0) {
list(self::$_headers, $content) = preg_split("/(\r?\n){2}/", $content, 2);
}

return $content;
}

This worked! Orders have been coming through as normal after I implemented it.

From the CS-Cart Architects, a better fix solution is posted here:

https://gist.github.com/incrize/afa73c98348ea82ab3bdb4469e29f371