Marek_O Posted December 6, 2016 Share Posted December 6, 2016 Hey,I don't know if this is a bug, but I just relaized, that some of my Orders are not created within Prestashop due to a HTTP 500 Server Error when they are payed by PayPal, strangely some order work perfectly? I use: PRestashop 1.6.1.6 and PayPAl ,module v3.11.1 In my logs in Prestashop I find this line: "PaymentModule::validateOrder - Order cannot be created" with status error severity level 3 In my server access logs I find a HTTP 500 error: GET /modules/paypal/express_checkout/payment.php?token=EC-4T363601XXXXXXXY&PayerID=LCJXXXXXXXXXX HTTP/1.1" 500 Checking my server error logs I find this log, coming from the file /classes/PaymentModule.php: PHP Fatal error: Uncaught exception 'PrestaShopException' with message 'Can't save Order' in /myWebspace/prestashop/classes/PaymentModule.php:345\n Stack trace: #0 /myWebspace/prestashop/modules/paypal/paypal.php(2070): PaymentModuleCore-]validateOrder(138, 2, 41.99, 'PayPal', 'Payment accepte...', Array, 1, false, NULL, Object(Shop)) #1 /myWebspace/prestashop/modules/paypal/express_checkout/payment.php(363): PayPal-]validateOrder(138, 2, 41.99, 'PayPal', 'Payment accepte...', Array, 1, false, NULL, Object(Shop)) #2 /myWebspace/prestashop/modules/paypal/express_checkout/payment.php(380): validateOrder(Object(Customer), Object(Cart), Object(PaypalExpressCheckout)) #3 {main} thrown in /myWebspace/prestashop/classes/PaymentModule.php on line 345 I have no clue whats goin on, I has worked as acharm in the past, now sometimes I get this problem. But not always? The Problem is also, that the PayPal Transaction itself went totally fine, Payment was received, but no order was created in Prestashop...? Is this a bug? Cheers Marek Link to comment Share on other sites More sharing options...
GKM490 Posted December 6, 2016 Share Posted December 6, 2016 (edited) I am getting the same issue where no order is created even though payment is received in PayPal. I am also using Prestashop version 1.6.1.6, and I am using PayPal USA, Canada version 1.3.9. I do not get the error in my logs that you do. The only entry in my logs that could be related is one that says "Frontcontroller::init - Cart cannot be loaded or an order has already been placed using this cart" and it has an error code of 0x 0, but I'm not sure if this is related to the PayPal issue or not. This is a very irritating issue that has been going on for a while, and as Marek said, it is sporadic for me as well. Edited December 6, 2016 by GKM490 (see edit history) Link to comment Share on other sites More sharing options...
Marek_O Posted December 7, 2016 Author Share Posted December 7, 2016 Checking the Prestashop Logs again, I can see that there also a lot of Frontcontroller errors: Frontcontroller::init - Cart cannot be loaded or an order has already been placed using this cart But i'm not sure if they are related to the same carts, that throw the 500 Error ... Link to comment Share on other sites More sharing options...
GKM490 Posted December 7, 2016 Share Posted December 7, 2016 It would make sense that this would be related. Perhaps this occurs when it is trying to create an order from the cart upon returning from PayPal. Still don't know what would cause it though. Link to comment Share on other sites More sharing options...
GKM490 Posted December 12, 2016 Share Posted December 12, 2016 Anybody got any information on this? This has been going on for a while and we really need a solution as well as I'm sure the OP does. Link to comment Share on other sites More sharing options...
Marek_O Posted December 13, 2016 Author Share Posted December 13, 2016 A short update. After checking all PayPal Transaction logs and finding no error there, I changed one thing in the prestashop backend, I set ALL pages to use SSL/HTTPS. I have no further errors since then. Maybe this is connected, but I have no proof and will continue observing the system. If you have SSL you could give it a try: Preferences > General > Enable SSL on all pages > Yes However, I still get the frontocontroller warning in the logs ... Frontcontroller::init - Cart cannot be loaded or an order has already been placed using this cart Link to comment Share on other sites More sharing options...
GKM490 Posted December 13, 2016 Share Posted December 13, 2016 (edited) I also have SSL enabled on all pages, but the problem still occurs for me. There was actually a period of about 2 weeks or so where the problem just seemed to stop for no reason, then it suddenly came back about a week ago. We didn't do anything different during the 2 weeks, so I'm not sure why it's so random. Edited December 13, 2016 by GKM490 (see edit history) Link to comment Share on other sites More sharing options...
Marek_O Posted December 15, 2016 Author Share Posted December 15, 2016 After observing this, it still comes up once in a while. This is really weird. Something seems to go wrong with the order. Does anybody have an idea how to debug the whole $order object in PaymentModule.php ? Link to comment Share on other sites More sharing options...
Marek_O Posted January 17, 2017 Author Share Posted January 17, 2017 I got somewhat further, one of my customers send me a detailled error message, there's in fact a problem with the field 'secure_key' when creating the Order. The customer comes back from paypal and gets an error. The Error is Fatal error: Uncaught Column 'secure_key' cannot be null Coming from this SQL Statement: INSERT INTO `prest_orders` (`id_address_delivery`, `id_address_invoice`, `id_cart`, `id_currency`, `id_shop_group`, `id_shop`, `id_lang`, `id_customer`, `id_carrier`, `current_state`, `secure_key`, `payment`, `module`, `recyclable`, `gift`, `gift_message`, `mobile_theme`, `total_discounts`, `total_discounts_tax_incl`, `total_discounts_tax_excl`, `total_paid`, `total_paid_tax_incl`, `total_paid_tax_excl`, `total_paid_real`, `total_products`, `total_products_wt`, `total_shipping`, `total_shipping_tax_incl`, `total_shipping_tax_excl`, `carrier_tax_rate`, `total_wrapping`, `total_wrapping_tax_incl`, `total_wrapping_tax_excl`, `round_mode`, `round_type`, `shipping_number`, `conversion_rate`, `invoice_number`, `delivery_number`, `invoice_date`, `delivery_date`, `valid`, `reference`, `date_add`, `date_upd`) VALUES ('0', '0', '789', '1', '1', '1', '2', '0', '7', '0', NULL, 'PayPal', 'paypal', '0', '0', NULL, '0', '0', '0', '0', '99.99', '99.99', '99.99', '0' in prestashop/classes/db/Db.php on line 791 I really think this is a bug... Link to comment Share on other sites More sharing options...
Marek_O Posted June 23, 2017 Author Share Posted June 23, 2017 BumpThe Problem still exists ...Also mentioned here:https://github.com/PrestaShop/paypal/issues/66 Quote: I think there (/modules/paypal/express_checkout/payment.php) is something going wrong:369: $cart = $ppec->context->cart;370: $customer = new Customer((int) $cart->id_customer); If you pay "Express" line 48 $request_type = Tools::getValue('express_checkout'); return null...But how to solve this??? Link to comment Share on other sites More sharing options...
Marek_O Posted June 23, 2017 Author Share Posted June 23, 2017 I'Ve updated the PayPal Module to v3.11.4, we'll see if that brings any changes ... Link to comment Share on other sites More sharing options...
Teapot Creative Posted July 21, 2017 Share Posted July 21, 2017 Bump, this is quite a huge bug.. Link to comment Share on other sites More sharing options...
Marek_O Posted July 31, 2017 Author Share Posted July 31, 2017 Well, error still comes in new version (v3.11.4) of the paypal module It's really annoying, this is a huge flaw in the software, but the support for Prestashop 1.6 seems to have stalled ... that's sad. Link to comment Share on other sites More sharing options...
stevell Posted July 20, 2018 Share Posted July 20, 2018 Has anyone found a solution to this issue as I have just installed Paypal an I have this problem on all transactions. Link to comment Share on other sites More sharing options...
Guest Posted March 15, 2019 Share Posted March 15, 2019 (edited) Any solutions yes - we are still getting this and perhaps more frequent. I have changed the error log alert level so at least I get an email about it and can then very quickly log in and create the order. But still disconcerting for the customer. I did have a thought that this could be browser related, or perhaps mobile devices? Edited March 15, 2019 by Guest (see edit history) Link to comment Share on other sites More sharing options...
tuk66 Posted March 19, 2019 Share Posted March 19, 2019 This kind of error is very difficult to catch. You should try to log variables after every line in the validateOrder function to see where exactly it fails and why. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now