Jump to content

Sporadic PayPal Order gives 500 Error - Payment received, no order created


Recommended Posts

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

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 by GKM490 (see edit history)
Link to comment
Share on other sites

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

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

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 by GKM490 (see edit history)
Link to comment
Share on other sites

  • 1 month later...

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

  • 5 months later...

Bump

The 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

  • 4 weeks later...
  • 2 weeks later...
  • 11 months later...
  • 7 months later...

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 by Guest (see edit history)
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...