I am running into an odd issue with my OpenCart integration into the PayPal API. I am utilizing a direct integration with the PayPal Pro script through OpenCart I am getting error 28 which is a timeout on my server side, but in the paypal dashboard, it shows the authorization was successful. It seems as though my server is unable to get the reply correctly from PayPal.
Steps I have tried:
- Telnet to api-3t.paypal.com port 443, was able to get to the host, but didn't auth or run an example query
- Updated the PHP version to 7.4
- Printed all Debug information from CURL
This is the odd part, though, CURL Info tells me that I am in fact getting a reply from the server somehow and it is resolving the url. There is no error message returned by CURL even though the value is there. but there is something that is not working correctly.
2020-06-08 17:18:10 - CURL INFO: Array
(
[url] => https://api-3t.paypal.com/nvp
[content_type] => text/plain; charset=utf-8
[http_code] => 200
[header_size] => 497
[request_size] => 822
[filetime] => -1
[ssl_verify_result] => 0
[redirect_count] => 0
[total_time] => 2.919995
[namelookup_time] => 0.001446
[connect_time] => 0.057641
[pretransfer_time] => 0.190467
[size_upload] => 692
[size_download] => 191
[speed_download] => 65
[speed_upload] => 237
[download_content_length] => 191
[upload_content_length] => 692
[starttransfer_time] => 2.919881
[redirect_time] => 0
[redirect_url] =>
[primary_ip] => 173.0.88.69
[certinfo] => Array
(
)
[primary_port] => 443
[local_ip] => [redacted]
[local_port] => 41214
[http_version] => 2
[protocol] => 2
[ssl_verifyresult] => 0
[scheme] => HTTPS
[appconnect_time_us] => 190395
[connect_time_us] => 57641
[namelookup_time_us] => 1446
[pretransfer_time_us] => 190467
[redirect_time_us] => 0
[starttransfer_time_us] => 2919881
[total_time_us] => 2919995
)
2020-06-08 17:18:10 - CURL Error: 28
2020-06-08 17:18:10 - CURL Error:
Selection of the driver script to get this information (curl is properly initialized and header is filled above):
if (!$this->config->get('pp_pro_test')) {
$curl = curl_init('https://api-3t.paypal.com/nvp');
} else {
$curl = curl_init('https://api-3t.sandbox.paypal.com/nvp');
}
curl_setopt($curl, CURLOPT_PORT, 443);
curl_setopt($curl, CURLOPT_HEADER, 1);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curl, CURLOPT_FRESH_CONNECT, 1);
curl_setopt($curl, CURLOPT_FAILONERROR, 1);
curl_setopt($curl, CURLOPT_FORBID_REUSE, 1);
curl_setopt($curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $request);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 100);
curl_setopt($curl, CURLOPT_TIMEOUT, 30000);
$response = curl_exec($curl);
if (curl_errno($curl)) {
$info = curl_getinfo($curl);
$this->log->write("CURL INFO: " . print_r($info,1));
$this->log->write("CURL Error: " . curl_errno($curl));
$this->log->write("CURL Error: " . curl_error($curl));
$this->log->write("Request: " . print_r($request,1));
$this->log->write("Response: " . var_dump($response,1));
}
curl_close($curl);
$response_info = array();
parse_str($response, $response_info);
$json = array();
if (($response_info['ACK'] == 'Success') || ($response_info['ACK'] == 'SuccessWithWarning')) {
Any help with this would be much appreciated. Thank you so much.