Post by SpannerMagnet » Mon Nov 26, 2018 7:50 pm

Hi guys,

I'm running OpenCart 1.5.4 with the PayPal Website Payment Pro (UK) payment extension enabled. Users are currently experiencing an issue when trying to process an order using this payment method. Whenever they click on "Confirm Order" the a "please wait" icon appears (see attachment) and then disappears. Nothing happens. The order isn't processed.

I noticed in Chrome's network logger a "503 Backend fetch failed" response was logged.

The error.txt log has the following items logged (Note that I've replaced the website name with "..."):

Code: Select all

line 174
2018-11-26 11:21:23 - PHP Warning:  curl_error(): supplied resource is not a valid cURL handle resource in ..../httpd.www/store/catalog/controller/payment/pp_pro_uk.php on line 144
2018-11-26 11:21:23 - PHP Warning:  curl_errno(): supplied resource is not a valid cURL handle resource in ..../httpd.www/store/catalog/controller/payment/pp_pro_uk.php on line 144
2018-11-26 11:21:23 - DoDirectPayment failed: ()
2018-11-26 11:21:23 - PHP Notice:  Undefined index: RESULT in ..../httpd.www/store/catalog/controller/payment/pp_pro_uk.php on line 153
2018-11-26 11:21:23 - PHP Notice:  Undefined index: RESULT in ..../httpd.www/store/catalog/controller/payment/pp_pro_uk.php on line 174
2018-11-26 11:27:43 - PHP Warning:  curl_error(): supplied resource is not a valid cURL handle resource in ..../httpd.www/store/catalog/controller/payment/pp_pro_uk.php on line 144
2018-11-26 11:27:43 - PHP Warning:  curl_errno(): supplied resource is not a valid cURL handle resource in ..../httpd.www/store/catalog/controller/payment/pp_pro_uk.php on line 144
2018-11-26 11:27:43 - DoDirectPayment failed: ()
2018-11-26 11:27:43 - PHP Notice:  Undefined index: RESULT in ..../httpd.www/store/catalog/controller/payment/pp_pro_uk.php on line 153
2018-11-26 11:27:43 - PHP Notice:  Undefined index: RESULT in ..../httpd.www/store/catalog/controller/payment/pp_pro_uk.php on line 174

Attachments

pleaseWait.png

pleaseWait.png (5.91 KiB) Viewed 785 times


Newbie

Posts

Joined
Thu Dec 06, 2012 7:55 pm

Post by ADD Creative » Mon Nov 26, 2018 9:01 pm

Looks to be a bug in the error reporting code. If you fix that by doing the following you should hopefully see what the true error is.

Find on line 141 of catalog/controller/payment/pp_pro_uk.php.

Code: Select all

curl_close($curl);

if (!$response) {
	$this->log->write('DoDirectPayment failed: ' . curl_error($curl) . '(' . curl_errno($curl) . ')');
}
And change to the following (curl_close needs to be after the log write).

Code: Select all

if (!$response) {
	$this->log->write('DoDirectPayment failed: ' . curl_error($curl) . '(' . curl_errno($curl) . ')');
}

curl_close($curl);

www.add-creative.co.uk


Active Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by SpannerMagnet » Mon Nov 26, 2018 9:21 pm

I've added that in. The error.txt log now notes the following:

Code: Select all

2018-11-26 11:43:03 - DoDirectPayment failed: ()
2018-11-26 11:43:03 - PHP Notice:  Undefined index: RESULT in .../httpd.www/store/catalog/controller/payment/pp_pro_uk.php on line 153
2018-11-26 11:43:03 - PHP Notice:  Undefined index: RESULT in .../httpd.www/store/catalog/controller/payment/pp_pro_uk.php on line 174
2018-11-26 13:18:45 - PHP Warning:  curl_error(): supplied resource is not a valid cURL handle resource in .../httpd.www/store/catalog/controller/payment/pp_pro_uk.php on line 144
2018-11-26 13:18:45 - PHP Warning:  curl_errno(): supplied resource is not a valid cURL handle resource in .../httpd.www/store/catalog/controller/payment/pp_pro_uk.php on line 144
2018-11-26 13:18:45 - DoDirectPayment failed: ()
2018-11-26 13:18:45 - PHP Warning:  curl_close(): supplied resource is not a valid cURL handle resource in .../httpd.www/store/catalog/controller/payment/pp_pro_uk.php on line 147
2018-11-26 13:18:45 - PHP Notice:  Undefined index: RESULT in .../httpd.www/store/catalog/controller/payment/pp_pro_uk.php on line 156
2018-11-26 13:18:45 - PHP Notice:  Undefined index: RESULT in .../httpd.www/store/catalog/controller/payment/pp_pro_uk.php on line 177

Newbie

Posts

Joined
Thu Dec 06, 2012 7:55 pm

Post by ADD Creative » Tue Nov 27, 2018 2:32 am

Doesn't look like the change has been made. Did you remove the curl_close($curl); from line 141 and move it after the log write?

www.add-creative.co.uk


Active Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by SpannerMagnet » Tue Nov 27, 2018 4:43 pm

Ah forgive me. I didn't remove the original curl_close() statement. The log now displays the following:

Code: Select all

2018-11-27 8:42:08 - DoDirectPayment failed: Failed to connect to payflowpro.verisign.com port 443: Connection timed out(7)
2018-11-27 8:42:08 - PHP Notice:  Undefined index: RESULT in ...../httpd.www/store/catalog/controller/payment/pp_pro_uk.php on line 154
2018-11-27 8:42:08 - PHP Notice:  Undefined index: RESULT in ...../httpd.www/store/catalog/controller/payment/pp_pro_uk.php on line 175
I've opened up pp_pro_uk.php and line 154 reads:

Code: Select all

if ($response_info['RESULT'] == '0') {
and line 175 reads:

Code: Select all

switch ($response_info['RESULT']) {
I've found this linkhttps://www.paypal.com/us/smarthelp/art ... com-ts1442 and noticed that the pp_pro_uk.php still uses the following links:

Code: Select all

		if (!$this->config->get('pp_pro_uk_test')) {
			$curl = curl_init('https://payflowpro.verisign.com/transaction');
		} else {
			$curl = curl_init('https://pilot-payflowpro.verisign.com/transaction');
		}
Should I update these lines to:

Code: Select all

		if (!$this->config->get('pp_pro_uk_test')) {
			$curl = curl_init('https://payflowpro.paypal.com/transaction');
		} else {
			$curl = curl_init('https://pilot-payflowpro.paypal.com/transaction');
		}
UPDATE - updating the lines above to the new URL seems to have done the trick. Thanks very much for the help! Much appreciated :)

Newbie

Posts

Joined
Thu Dec 06, 2012 7:55 pm
Who is online

Users browsing this forum: No registered users and 7 guests