From 68f26d680c717bb5c0808a61d6871305f56a354a Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 22 Jul 2020 22:16:02 +1000 Subject: [PATCH] Working on Credit payments --- app/Exceptions/Handler.php | 2 +- app/Http/Requests/Payment/StorePaymentRequest.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 79e78569714b..8f5e8c953d22 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -118,7 +118,7 @@ class Handler extends ExceptionHandler } elseif ($exception instanceof MethodNotAllowedHttpException && $request->expectsJson()) { return response()->json(['message'=>'Method not support for this route'], 404); } elseif ($exception instanceof ValidationException && $request->expectsJson()) { -// info(print_r($exception->validator->getMessageBag(),1)); + info(print_r($exception->validator->getMessageBag(),1)); return response()->json(['message' => 'The given data was invalid.', 'errors' => $exception->validator->getMessageBag()], 422); } elseif ($exception instanceof RelationNotFoundException && $request->expectsJson()) { return response()->json(['message' => $exception->getMessage()], 400); diff --git a/app/Http/Requests/Payment/StorePaymentRequest.php b/app/Http/Requests/Payment/StorePaymentRequest.php index 0fa435f4fa49..ce529aa6f9f5 100644 --- a/app/Http/Requests/Payment/StorePaymentRequest.php +++ b/app/Http/Requests/Payment/StorePaymentRequest.php @@ -77,7 +77,8 @@ class StorePaymentRequest extends Request } if (!isset($input['amount']) || $input['amount'] == 0) { - $input['amount'] = $invoices_total - $credits_total; + //$input['amount'] = $invoices_total - $credits_total; + $input['amount'] = $invoices_total; } $input['is_manual'] = true;