mirror of
https://gitlab.com/uldvstar/exchange-2.0.git
synced 2026-08-19 04:24:16 +00:00
add cancel order and restore order function
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user