cancel
Showing results for 
Search instead for 
Did you mean: 

Who Me Too'd this topic

Contributor

TLS 1.2 and HTTP/1.1 upgrade (PHP fsockopen)

Hello,

 

I am new to PHP & PayPal and trying to figure it out whether I need to upgrade TLS or not according to the following PayPal article: https://www.paypal-knowledge.com/infocenter/index?page=content&id=FAQ1914

 

I tried testing the system using "tlstest.paypal.com" and "sandbox.paypal.com" endpoints.

 

When I tested using "tlstest.paypal.com" endpoint, I've got the message below right away, followed by "PayPal_Connection_OK" after 6-8 minutes.

 

HTTP/1.1  200 OKContent-Type: text/htmlContent-Length: 20
Connection: keep-alive

When I tested using "sandbox.paypal.com" endpoint, the result was "verified" and the payment status was "completed".

However I noticed 30 seconds delay.

 

In order to get my code to work I had to make 2 modifications:

1) add "Connetion: Close" in the header (otherwise the connection was "hanging" and generated an error message "fgets ssl: connection reset by peer")

    $header .= "Connection: Close\r\n"; 

2) trim the result

     if (strcmp (trim($result), "VERIFIED") == 0) {          // VALID PAYMENT!

 

Am I good to go?  Any idea what is causing the delays?

 

Thank you.

Who Me Too'd this topic