From 509a681bcc99b2a8adeac8d5f0272a3e511f1e42 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Fri, 27 Aug 2021 15:19:58 +0800 Subject: [PATCH] add cancel order and restore order function --- .../Modules/Bookings/ControllersLogic/CancelBookingLogic.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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');