Commit 08afdc0b authored by Vincent Mrose's avatar Vincent Mrose 💬
Browse files

EXPIRED notifications now register a cancellation on the given order



This means the stock of the products is now correctly increased
Signed-off-by: Vincent Mrose's avatarVincent Mrose <v.mrose@crefopay.de>
parent 42f75d7d
......@@ -6,8 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [Known issues]
## [Unreleased]
### Fixed
- EXPIRED notifications now increase stock of products when they are cancelling an order
## [0.9.4] - 2019-05-28
## [0.9.4] - 2019-06-04
### Added
- Added a setting to do an automatic capture based on categories
......
......@@ -29,15 +29,13 @@ class Expired extends AbstractConsumer implements MnsConsumerInterface
* @param MnsEvent $event
*
* @throws LocalizedException
* @throws \Trilix\CrefoPay\Mns\Consumers\MnsConsumerException
* @throws MnsConsumerException
*/
public function process(MnsEvent $event)
{
parent::process($event);
$order = $this->getOrder($event);
$order->setState(Order::STATE_CANCELED);
$order->setStatus($order->getConfig()->getStateDefaultStatus(Order::STATE_CANCELED));
$this->addCommentToStatusHistory($order, __('Transaction has expired'));
$order->registerCancellation(__('Transaction has expired'));
$this->orderHelper->getOrderRepository()->save($order);
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment