Jump to content

Order validated despite a difference between the amount paid and the cart total


Eric Le Bruchec

Recommended Posts

Hello,

Problem observed in version 8.1.7

This issue should only occur if the PSP does not go through Prestashop for validation before payment (i.e., payment within an iframe) but I'm not sure.

How to reproduce:

  • Create a cart rule with a short expiration date
  • Add a product to your cart which matches the cart rule conditions
  • Add the cart rule to your cart
  • Go through the checkout process until the payment form is displayed
  • Wait for the cart rule to fully expire, then complete the payment

Currently:

In PaymentModuleCore::validateOrder, the cart rule is removed from the cart, but the order is still processed with a valid status, despite the difference in amount.
The cart total is calculated before the cart rules are removed. It is then compared with the paid amount, which are incorrectly considered equal.

Expected:

The cart rule should be removed from the cart, and the order should transition to the status Configuration::get('PS_OS_ERROR');.
The cart total should be calculated after the cart rules are removed in order to compare the actual cart total with the paid amount.

Regards,

Eric Le Bruchec

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...