Sylius / ShopApiPlugin

Shop API for Sylius.
https://sylius.com
129 stars 89 forks source link

Check order integrity on checkout complete #603

Closed Zales0123 closed 5 years ago

Zales0123 commented 5 years ago

Fixes https://github.com/Sylius/ShopApiPlugin/issues/589

The main idea right now is to check the total of the order before and after customer assignment (and therefore - cart recalculation). This is the same thing as we do in Sylius itself. The next step would be also to check the promotion integrity 🐎

SymfonyHackday

Zales0123 commented 5 years ago

Ok, so we've just had a (not-so) quick talk with @lchrusciel about this implementation and there is a new vision 😄

  1. Deprecate setting an email in CompleteOrder action
  2. Create a new action for assigning the customer to the order
  3. Validate the order after completing it for total integrity and customer assignment

And it should still work for current implementations and allow us to control this integrity changes during the last order recalculation. Sounds good? 🔉