diff --git a/app/Classes/Modules/Bookings/ControllersLogic/CancelBookingLogic.php b/app/Classes/Modules/Bookings/ControllersLogic/CancelBookingLogic.php index 29692a89..6a6fedef 100644 --- a/app/Classes/Modules/Bookings/ControllersLogic/CancelBookingLogic.php +++ b/app/Classes/Modules/Bookings/ControllersLogic/CancelBookingLogic.php @@ -54,7 +54,7 @@ class CancelBookingLogic extends AbstractControllerLogic { $booking = $this->fetchesBooking->execute(['id' => $request->route('id')]); - $bookingActivePayments = $booking->transactions()->where('type', '=', TransactionType::PAYMENT)->where('status', '!=', ApprovalStatus::PENDING_SUBMISSION)->get(); + $bookingActivePayments = $booking->transactions()->where('type', '=', TransactionType::PAYMENT)->whereIn('status', [ApprovalStatus::PENDING_VERIFICATION, ApprovalStatus::APPROVED])->get(); if(count($bookingActivePayments)){ throw new MalformedRequestException('You can\'t cancel an order with active payments');