From 2732a7ed507ba36f651c45d906d43ff5d62d784d Mon Sep 17 00:00:00 2001 From: Carnage Date: Sun, 22 Sep 2019 17:00:36 +0100 Subject: [PATCH] Fix purchase timeout when merchandise is in the basket --- src/Domain/Purchasing/Projector.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Domain/Purchasing/Projector.php b/src/Domain/Purchasing/Projector.php index 461ef0d..dbac3f5 100644 --- a/src/Domain/Purchasing/Projector.php +++ b/src/Domain/Purchasing/Projector.php @@ -90,8 +90,12 @@ private function purchasePaid(PurchaseCompleted $event) $entity->paid(); } - private function purchaseTimeout(TicketReservationExpired $event) + private function purchaseTimeout($event) { + if (!($event instanceof TicketReservationExpired || $event instanceof MerchandisePurchaseExpired)) { + return; + } + $entity = $this->repository->get($event->getId()); if ($entity instanceof Purchase) { $this->repository->remove($entity);