Jump to content

500 Server Error when trying to pay with PayPal


Webhools

Recommended Posts

Hello together!

PayPal is currently not working in our store. When I click on the "Pay with PayPal" button, a server request is made to /module/paypal/ScInit?ajax=1&action=CreateOrder.
This server request is followed by a 500 server error with the following output:

Whoops, looks like something went wrong.
(1/1) ContextErrorException
Notice: Trying to get property 'page' of non-object

in ScInit.php line 135
at PaypalScInitModuleFrontController->displayAjaxCreateOrder()
at call_user_func(array(object(PaypalScInitModuleFrontController), 'displayAjaxCreateOrder'))
in CommonAbstarctModuleFrontController.php line 126
at CommonAbstarctModuleFrontController->ajaxProcess()
in CommonAbstarctModuleFrontController.php line 60
at CommonAbstarctModuleFrontController->run()
in Dispatcher.php line 518
at DispatcherCore->dispatch()
in index.php line 28

PrestaShop Version: 1.7.8.1

PayPal Module Version: 5.5.0

Edited by Webhools (see edit history)
Link to comment
Share on other sites

For now I made a simple fix in /modules/paypal/controllers/front/ScInit.php Line 135.

Changed this...

if ($request->page == 'product') {

... to this ...

if (isset($request->page) && $request->page == 'product') {

However, the error doesn't make sense to me because the page variable is contained in the request and $request is also an object.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...