Worldpay / worldpay-woocommerce

10 stars 7 forks source link

Payment error: Error parsing json, please check json request #19

Open vancameron opened 6 years ago

vancameron commented 6 years ago

Hi

We have upgraded our site to PHP 7.2.5 and we are now getting the following error when trying to make a payment on our site:

Payment error: Error parsing json, please check json request

PHP changelog states that automatically converting an array to an object in json encode has been removed/fixed to not do so anymore at version 7.

Is there some of your code that uses the function ‘json_encode’ and if so, can I change it so it casts the array being fed as a parameter to an object, e.g.:

If it was: $json = json_encode($data); Change it to: $json = json_encode((object) $data);

Any assistance would be greatly appreciated.

Best wishes

nomaNgT commented 4 years ago

Please help me. I have got the same error in worldpay payment gateway integrated

App \ Worldpay \ Lib \ WorldpayException (400) Error parsing json, please check json request