diff --git a/app/Http/Requests/CreatePaymentAPIRequest.php b/app/Http/Requests/CreatePaymentAPIRequest.php index 3c773b9450c6..1053e7035729 100644 --- a/app/Http/Requests/CreatePaymentAPIRequest.php +++ b/app/Http/Requests/CreatePaymentAPIRequest.php @@ -45,7 +45,7 @@ class CreatePaymentAPIRequest extends PaymentRequest ]); $rules = [ - 'amount' => 'required|numeric|not_in:0', + 'amount' => 'required|numeric', ]; if ($this->payment_type_id == PAYMENT_TYPE_CREDIT) { diff --git a/app/Ninja/Repositories/PaymentRepository.php b/app/Ninja/Repositories/PaymentRepository.php index 1aa790774947..b7e895ff681b 100644 --- a/app/Ninja/Repositories/PaymentRepository.php +++ b/app/Ninja/Repositories/PaymentRepository.php @@ -194,6 +194,7 @@ class PaymentRepository extends BaseRepository if (! $publicId) { $clientId = $input['client_id']; $amount = Utils::parseFloat($input['amount']); + $amount = min($amount, MAX_INVOICE_AMOUNT); if ($paymentTypeId == PAYMENT_TYPE_CREDIT) { $credits = Credit::scope()->where('client_id', '=', $clientId)