-
-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Falsy order of Events in Cart/OrderController
#571
Comments
The PaymentEvent has to be placed before the StockEvent because the order can fail in the PaymentEvent so the StockEvent has to be placed after the PaymentEvent. In case a PaymentProvider uses forwarding the PaymentEvent and FinishEvent has to be triggered within the EventListener of the PaymentEvent. This is already described in the docs. Fixes: extcode#571
I've just stumbled across this behavior. If a order is submitted, the stock is changed immediatly, no matter if and how the external payment provider is processed. This leads to discrepancies in the inventory. |
Yeah but I think extcode's arguments are reasonable: You should adapt your payment provider. Or do you have other plans in the meanwhile @extcode ? |
There are various ways to solve the problem.
I would not swap the order, because otherwise customer A and customer B could buy the same product in competition because the payment process for one of them has not yet been completed. For stores in which the cart extension is used, this is probably an edge case and probably occurs rarely or not at all. I will have a look at this for a payment provider in the near future. |
I just realized the following: cart/Classes/Domain/Model/Cart.php Line 29 in cb2a245
The
That sounds not that difficult? |
Bug Report
Current Behavior
According to the docs https://docs.typo3.org/p/extcode/cart/main/en-us/Developer/Events/Index.html#confval-extcode-cart-event-order-paymentevent the
PaymentEvent
should trigger theStockEvent
on success. But in the code theStockEvent
comes after thePaymentEvent
:cart/Classes/Controller/Cart/OrderController.php
Lines 223 to 233 in 560a455
Due to this it can happen that the stock is changed although the purchase failed.
Expected behavior/output
Those two Events have to switch position.
Environment
The text was updated successfully, but these errors were encountered: