diff --git a/app/Http/ValidationRules/ValidAmount.php b/app/Http/ValidationRules/ValidAmount.php index dc57b308eb42..4f5fe1700de3 100644 --- a/app/Http/ValidationRules/ValidAmount.php +++ b/app/Http/ValidationRules/ValidAmount.php @@ -26,7 +26,7 @@ class ValidAmount implements Rule */ public function passes($attribute, $value) { - return (bool) is_float($value) || is_int($value); + return (bool) is_float($value) || preg_match('#[^0-9]#',$value); } /** diff --git a/app/PaymentDrivers/PaytracePaymentDriver.php b/app/PaymentDrivers/PaytracePaymentDriver.php index 3b164f4a64b8..f834791c4311 100644 --- a/app/PaymentDrivers/PaytracePaymentDriver.php +++ b/app/PaymentDrivers/PaytracePaymentDriver.php @@ -11,6 +11,7 @@ namespace App\PaymentDrivers; +use App\Exceptions\SystemError; use App\Jobs\Util\SystemLogger; use App\Models\ClientGatewayToken; use App\Models\GatewayType; @@ -192,7 +193,7 @@ class PaytracePaymentDriver extends BaseDriver $auth_data = json_decode($response); if(!property_exists($auth_data, 'access_token')) - throw new \Exception('Error authenticating with PayTrace'); + throw new SystemError('Error authenticating with PayTrace'); $headers = []; $headers[] = 'Content-type: application/json';