diff --git a/app/Classes/Modules/Transactions/ControllersLogic/UpdateTransactionStatusLogic.php b/app/Classes/Modules/Transactions/ControllersLogic/UpdateTransactionStatusLogic.php index 1f6085e4..171d4e61 100644 --- a/app/Classes/Modules/Transactions/ControllersLogic/UpdateTransactionStatusLogic.php +++ b/app/Classes/Modules/Transactions/ControllersLogic/UpdateTransactionStatusLogic.php @@ -50,13 +50,18 @@ class UpdateTransactionStatusLogic extends AbstractControllerLogic $approvalArray = [ 'approve' => ApprovalStatus::APPROVED, 'expire' => ApprovalStatus::EXPIRED, + 'reject' => ApprovalStatus::REJECTED, ]; $approvalStatus = $approvalArray[$request->route('status')]; $transaction = $this->fetchesTransaction->execute(['id' => $request->route('id')]); - $transaction = $this->updatesTransactionStatus->execute($transaction, $approvalStatus); + if ($request->route('status') === 'reject') { + $transaction->delete(); + } else { + $transaction = $this->updatesTransactionStatus->execute($transaction, $approvalStatus); + } return $this->resourceResponse(new TransactionResource($transaction)); } diff --git a/resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingComponent.vue b/resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingComponent.vue index b7078f02..d7756791 100644 --- a/resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingComponent.vue +++ b/resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingComponent.vue @@ -84,9 +84,15 @@