Skip to content

[BUG] Falsy order of Events in Cart/OrderController #571

Description

@rintisch

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

  • cart version: 9.0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

9.xrelated to TYPO3 v12bug

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions