Zen Cart Logo
Forums / PayPal Express Checkout support / paypal timeout on check out

paypal timeout on check out

Views: 10,072

Results 1 to 15 of 15
9 Jun 2016, 8:44 PM
#1
jsteggy avatar

jsteggy

New Zenner

Join Date:
Jan 2012
Posts:
28
Plugin Contributions:
0

paypal timeout on check out

I've been getting this error for a couple weeks. dreamhost says nothing is changed on their side.
I've applied all the patches I've seen posted. Any help or ides are appreciated. I can post more detail, just let me know what would be helpful.

Thanks

This is the error.

Response:
Array
(
    [] =>
    [CURL_ERRORS] => (7) Failed to connect to api-3t.paypal.com port 443: Connection timed out
)

(7) Failed to connect to api-3t.paypal.com port 443: Connection timed out
Array
(
    [url] => https://api-3t.paypal.com/nvp
    [content_type] =>
    [http_code] => 0
    [header_size] => 0
    [request_size] => 0
    [filetime] => -1
    [ssl_verify_result] => 0
    [redirect_count] => 0
    [total_time] => 8.749254
    [namelookup_time] => 3.5E-5
    [connect_time] => 0
    [pretransfer_time] => 0
    [size_upload] => 0
    [size_download] => 0
    [speed_download] => 0
    [speed_upload] => 0
    [download_content_length] => -1
    [upload_content_length] => -1
    [starttransfer_time] => 0
    [redirect_time] => 0
    [redirect_url] =>
    [primary_ip] =>
    [certinfo] => Array
        (
        )

    [primary_port] => 0
    [local_ip] =>
    [local_port] => 0
)


SetExpressCheckout, Elapsed: 8751ms -- Failed
(7) Failed to connect to api-3t.paypal.com port 443: Connection timed out
Array
(
    [url] => https://api-3t.paypal.com/nvp
    [content_type] =>
    [http_code] => 0
    [header_size] => 0
    [request_size] => 0
    [filetime] => -1
    [ssl_verify_result] => 0
    [redirect_count] => 0
    [total_time] => 8.749254
    [namelookup_time] => 3.5E-5
    [connect_time] => 0
    [pretransfer_time] => 0
    [size_upload] => 0
    [size_download] => 0
    [speed_download] => 0
    [speed_upload] => 0
    [download_content_length] => -1
    [upload_content_length] => -1
    [starttransfer_time] => 0
    [redirect_time] => 0
    [redirect_url] =>
    [primary_ip] =>
    [certinfo] => Array
        (
        )

    [primary_port] => 0
    [local_ip] =>
    [local_port] => 0
)
9 Jun 2016, 11:47 PM
#2
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,967
Plugin Contributions:
8

Re: paypal timeout on check out

in:

/includes/modules/payment/paypal/paypal_curl.php

what do you have around line 60 for:

CURLOPT_SSLVERSION => 3,

you need to comment that line out so it should look like:

//CURLOPT_SSLVERSION => 3,

see:

https://goo.gl/7SRmVc

10 Jun 2016, 3:45 AM
#3
drbyte avatar

drbyte

Sensei

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

Re: paypal timeout on check out

carlwhat:

in:

/includes/modules/payment/paypal/paypal_curl.php

what do you have around line 60 for:

CURLOPT_SSLVERSION => 3,

> 
> you need to comment that line out so it should look like:
> 
> ```
//CURLOPT_SSLVERSION => 3,

see:

https://goo.gl/7SRmVc
Or more officially:
https://www.zen-cart.com/showthread.php?214916-Important-announcement-about-POODLE-and-payment-security
and
https://www.zen-cart.com/forumdisplay.php?2-Zen-Cart-Release-Announcements

11 Jun 2016, 5:52 AM
#4
jsteggy avatar

jsteggy

New Zenner

Join Date:
Jan 2012
Posts:
28
Plugin Contributions:
0

Re: paypal timeout on check out

Hi and thanks. I changed that code when it was made available in nov 2014.
Here is what I have.

  var $_curlOptions = array(CURLOPT_HEADER => 0,
                            CURLOPT_RETURNTRANSFER => TRUE,
                            CURLOPT_TIMEOUT => 45,
                            CURLOPT_CONNECTTIMEOUT => 10,
                            CURLOPT_FOLLOWLOCATION => FALSE,
                          //CURLOPT_SSL_VERIFYPEER => FALSE, // Leave this line commented out! This should never be set to FALSE on a live site!
                          //CURLOPT_CAINFO => '/local/path/to/cacert.pem', // for offline testing, this file can be obtained from [URL]http://curl.haxx.se/docs/caextract.html[/URL] ... should never be used in production!
                           // CURLOPT_SSLVERSION => 3,
                            CURLOPT_FORBID_REUSE => TRUE,
                            CURLOPT_FRESH_CONNECT => TRUE,
                            CURLOPT_POST => TRUE,
                            );
15 Jun 2016, 3:00 PM
#6
jsteggy avatar

jsteggy

New Zenner

Join Date:
Jan 2012
Posts:
28
Plugin Contributions:
0

Re: paypal timeout on check out

mc12345678:

What about the "fix" provided in ZC 1.5.4, identified to relate to previous ZC versions and incorporated into ZC 1.5.5 published here: https://www.zen-cart.com/showthread.php?215694-Known-Bugs-%28and-fixes%29-with-v1-5-4&p=1270902#post1270902

all are applied, ever since the fix was made available. I'm stumped and neither paypal, dreamhost are helping all pointing to zencart. I setup a new cart in a test domain, same version, and activated paypal with the same credentials and still no joy. i'm kinda stuck.
j

15 Jun 2016, 3:51 PM
#7
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,967
Plugin Contributions:
8

Re: paypal timeout on check out

j,
dreamhost and paypal are pointing to ZC. let's verify that, by attempting a curl call outside of ZC. right now, you are timing out with a response time of 8.7 seconds. copy the following code into a new script; call it what you like, perhaps curl_test.php. load it onto the root folder of your domain, and then run it by calling https://www.yourdomain.com/curl_test.php. it will cause an error but we can see if it's safe to say its a ZC problem or not. frankly, i'm at dreamHost as well right now, and i think it's probably ZC, but lets just eliminate them from the problem.

<?php

$starttime = microtime_float();
echo "starting..."; flush();

$hostname_2 = 'https://api-3t.paypal.com/nvp';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$hostname_2);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_DNS_USE_GLOBAL_CACHE, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_PORT,443);

$resp = curl_exec($ch);

$curlerror = false;
if (curl_errno($ch) ) {
  $curlerror = curl_error($ch);
}

$endtime = microtime_float();

echo "\n<br/>elapsed time: " ; flush();
echo ($endtime - $starttime); flush();
echo "\n<br/>RESPONSE:<pre> " . $resp . ($curlerror ? " ERROR: $curlerror" : '') ."</pre><br/>\n";


function microtime_float()
{
   list($usec, $sec) = explode(" ", microtime());
   return ((float)$usec + (float)$sec);
}

i have it here:

https://www.rossroberts.com/curl_test.php

after uploading what do you get as an elapsed time? (an error is expected after the elapsed time...)

15 Jun 2016, 4:53 PM
#8
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: paypal timeout on check out

Using the ZC provided /extras/curltester.php?details=on
On a dreamhost site to which I have access, I get the following for PayPal Express:

Connection Details:
Array
(
    [url] => "https://api-3t.paypal.com/nvp"
    [content_type] => text/plain; charset=utf-8
    [http_code] => 200
    [header_size] => 599
    [request_size] => 209
    [filetime] => -1
    [ssl_verify_result] => 0
    [redirect_count] => 0
    [total_time] => 0.453353
    [namelookup_time] => 3.3E-5
    [connect_time] => 0.067277
    [pretransfer_time] => 0.27356
    [size_upload] => 37
    [size_download] => 146
    [speed_download] => 322
    [speed_upload] => 81
    [download_content_length] => 146
    [upload_content_length] => 37
    [starttransfer_time] => 0.453203
    [redirect_time] => 0
    [redirect_url] => 
    [primary_ip] => 66.211.168.126
    [certinfo] => Array
        (
        )

    [primary_port] => 443
    [local_ip] => xxx.xxx.xxx.xxx
    [local_port] => xx
)

That code doesn't purposefully throw an error. Not sure if that is an intended result or not.

16 Jun 2016, 2:09 PM
#9
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,967
Plugin Contributions:
8

Re: paypal timeout on check out

well, i have not looked at the code for the /extras/curltester.php, but i LIKE what it is doing.

definitely recommend trying that as opposed to my little snippet. i put that together many years ago, before ZC had a curltester.php or i knew about it!

if it does not run, you may need to comment out the last line in the /extras/.htaccess file.

hope you get it solved!

17 Jun 2016, 2:03 AM
#10
jsteggy avatar

jsteggy

New Zenner

Join Date:
Jan 2012
Posts:
28
Plugin Contributions:
0

Re: paypal timeout on check out

M123456789, Carlwhat, DrByte.
Thank you for helping. Paypal is working again - on its own - as of yesterday. I didn't change any settings, it just started working. at least I can't think of what I may have done to have it start working again. I am working on upgrading to 1.5.5a.

so frustrating....but am happy that it is working and hoping it will stay working.

17 Jun 2016, 2:08 PM
#11
drbyte avatar

drbyte

Sensei

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

Re: paypal timeout on check out

jsteggy:

Paypal is working again - on its own - as of yesterday. I didn't change any settings, it just started working. at least I can't think of what I may have done to have it start working again.
99% likely that it was an issue with your hosting company. Probably nothing to do with you at all.

17 Jun 2016, 2:42 PM
#12
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,967
Plugin Contributions:
8

Re: paypal timeout on check out

jsteggy:

M123456789, Carlwhat, DrByte.
Thank you for helping. Paypal is working again - on its own - as of yesterday. I didn't change any settings, it just started working. at least I can't think of what I may have done to have it start working again. I am working on upgrading to 1.5.5a.

so frustrating....but am happy that it is working and hoping it will stay working.

i think it would behoove you to get the extras/curltester.php working now that everything is properly functioning again. it is a good tool, that removes the ZC config from the transaction. the next time it happens, you can isolate whether it is the hosting or ZC.

best.

18 Jun 2016, 10:24 AM
#13
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: paypal timeout on check out

carlwhat:

i think it would behoove you to get the extras/curltester.php working now that everything is properly functioning again. it is a good tool, that removes the ZC config from the transaction. the next time it happens, you can isolate whether it is the hosting or ZC.

best.

Would be cautious though to an extent. Its been a while since I've meddled with or looked at the .htaccess in that folder; however, some of the settings are to prevent others from accessing it and possibly gaining information about the site. The install instructions on security:

  1. Remove extra folders from your server after install

It's important that after you've installed your site and are satisfied that it's working properly, including actually doing live transactions to test ALL the payment and shipping modules you're using on your site, be sure to do some cleanup:

REMOVE THE FOLLOWING FOLDERS (and all the files inside them), TO MINIMIZE SECURITY RISKS:

  • /docs
    - /extras
  • /zc_install
  • /install.txt (this file can be removed, too)

So yes, understanding what is necessary to get them to work is suggested; however, that folder (and its contents) should be removed from the online server (after a backup is made available).

23 Jun 2016, 11:49 AM
#14
bluetooth avatar

bluetooth

New Zenner

Join Date:
Sep 2005
Posts:
76
Plugin Contributions:
0

Re: paypal timeout on check out

I had the same problem with two of my clients that use Paypal. Using Zencart 1.5.4. They were both on a shared server using the same IP address. Had my host do a traceroute, and it timed out for a while, then it worked for about a day or two, then it timed out again always on Paypals end. The host tried a different IP address and it went through every time. It looked like Paypal had a firewall block on the IP address. Got nowhere with Paypal, I don't think support knows how to lift a firewall block. One client gave up and switched payment processors. The other likes Paypal, so, I had my host move the site to a different IP address. Hopefully that will resolve the problem. If not, we will be switching that account to Stripe.

Here is the results of the failed traceroute, 1 through 6 were fine. It failed at the same place every time:

7 ash-b1-link.telia.net (62.115.58.253) 6.784 ms 6.744 ms 6.524 ms
8 defensenet-ic-302032-ash-b2.c.telia.net (62.115.32.2) 6.565 ms 6.501 ms
6.732 ms
9 107.162.0.123 (107.162.0.123) 6.593 ms 6.605 ms 6.562 ms
10 * * *
11 * * *
12 * * *
13 * * *

23 Jun 2016, 5:57 PM
#15
drbyte avatar

drbyte

Sensei

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

Re: paypal timeout on check out

bluetooth:

I had the same problem with two of my clients that use Paypal. Using Zencart 1.5.4. They were both on a shared server using the same IP address. Had my host do a traceroute, and it timed out for a while, then it worked for about a day or two, then it timed out again always on Paypals end. The host tried a different IP address and it went through every time. It looked like Paypal had a firewall block on the IP address. Got nowhere with Paypal, I don't think support knows how to lift a firewall block. One client gave up and switched payment processors. The other likes Paypal, so, I had my host move the site to a different IP address. Hopefully that will resolve the problem. If not, we will be switching that account to Stripe.

Here is the results of the failed traceroute, 1 through 6 were fine. It failed at the same place every time:

7 ash-b1-link.telia.net (62.115.58.253) 6.784 ms 6.744 ms 6.524 ms
8 defensenet-ic-302032-ash-b2.c.telia.net (62.115.32.2) 6.565 ms 6.501 ms
6.732 ms
9 107.162.0.123 (107.162.0.123) 6.593 ms 6.605 ms 6.562 ms
10 * * *
11 * * *
12 * * *
13 * * *
Definitely an issue between your host and PayPal. Not something you'll have any ability to sort out yourself.