PayPal Express + OpenCart 1.5.6.4 + IE + Bad Gateway
Posted: Wed Mar 23, 2016 10:10 pm
The file catalog/controller/payment/pp_express.php contains the following code starting on line 1317:
Note the invalid characters in the URL. The URL should be
On my OpenCart store, this problem hasn't caused an issue (with IE) until recently. (I assume it is because Microsoft released a patch for Internet Explorer that handles the URL differently, which causes an issue with PayPal.)
In Internet Explorer 11, when a user clicks on the Pay with credit or Visa Debit card button on the PayPal page, PayPal displays:
502 Bad Gateway
--------------------------------------------------------------------------------
nginx/1.6.0
The issue does not show up for Google Chrome nor for Firefox.
Changing the code as mentioned above resolves the issue for Internet Explorer.
Code: Select all
if ($this->config->get('pp_express_test') == 1) {
header('Location: https://www.sandbox.paypal.com/cgi‑bin/webscr?cmd=_express-checkout&token=' . $result['TOKEN'].'&useraction=commit');
} else {
header('Location: https://www.paypal.com/cgi‑bin/webscr?cmd=_express-checkout&token=' . $result['TOKEN'].'&useraction=commit');
}
Code: Select all
if ($this->config->get('pp_express_test') == 1) {
header('Location: https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=' . $result['TOKEN'].'&useraction=commit');
} else {
header('Location: https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=' . $result['TOKEN'].'&useraction=commit');
}
In Internet Explorer 11, when a user clicks on the Pay with credit or Visa Debit card button on the PayPal page, PayPal displays:
502 Bad Gateway
--------------------------------------------------------------------------------
nginx/1.6.0
The issue does not show up for Google Chrome nor for Firefox.
Changing the code as mentioned above resolves the issue for Internet Explorer.