mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-31 09:44:37 -04:00
Throw exception on paytrace failure
This commit is contained in:
parent
7a267b4406
commit
f270fbe2d6
@ -26,7 +26,7 @@ class ValidAmount implements Rule
|
|||||||
*/
|
*/
|
||||||
public function passes($attribute, $value)
|
public function passes($attribute, $value)
|
||||||
{
|
{
|
||||||
return (bool) is_float($value) || is_int($value);
|
return (bool) is_float($value) || preg_match('#[^0-9]#',$value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
namespace App\PaymentDrivers;
|
namespace App\PaymentDrivers;
|
||||||
|
|
||||||
|
use App\Exceptions\SystemError;
|
||||||
use App\Jobs\Util\SystemLogger;
|
use App\Jobs\Util\SystemLogger;
|
||||||
use App\Models\ClientGatewayToken;
|
use App\Models\ClientGatewayToken;
|
||||||
use App\Models\GatewayType;
|
use App\Models\GatewayType;
|
||||||
@ -192,7 +193,7 @@ class PaytracePaymentDriver extends BaseDriver
|
|||||||
$auth_data = json_decode($response);
|
$auth_data = json_decode($response);
|
||||||
|
|
||||||
if(!property_exists($auth_data, 'access_token'))
|
if(!property_exists($auth_data, 'access_token'))
|
||||||
throw new \Exception('Error authenticating with PayTrace');
|
throw new SystemError('Error authenticating with PayTrace');
|
||||||
|
|
||||||
$headers = [];
|
$headers = [];
|
||||||
$headers[] = 'Content-type: application/json';
|
$headers[] = 'Content-type: application/json';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user