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 the StockEvent on success. But in the code the StockEvent comes after the PaymentEvent:
|
$stockEvent = new StockEvent($this->cart, $orderItem, $this->configurations); |
|
$this->eventDispatcher->dispatch($stockEvent); |
|
if ($stockEvent instanceof StoppableEventInterface && $stockEvent->isPropagationStopped()) { |
|
return true; |
|
} |
|
|
|
$paymentEvent = new PaymentEvent($this->cart, $orderItem, $this->configurations); |
|
$this->eventDispatcher->dispatch($paymentEvent); |
|
if ($paymentEvent instanceof StoppableEventInterface && $paymentEvent->isPropagationStopped()) { |
|
return true; |
|
} |
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
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
PaymentEventshould trigger theStockEventon success. But in the code theStockEventcomes 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