mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-01 02:54:36 -04:00
Allow Bank Accounts to be created manually
This commit is contained in:
parent
ce47e30aa2
commit
f5ee320ce2
@ -21,6 +21,7 @@ use Illuminate\Auth\Access\AuthorizationException;
|
|||||||
use Illuminate\Auth\AuthenticationException;
|
use Illuminate\Auth\AuthenticationException;
|
||||||
use Illuminate\Database\Eloquent\ModelNotFoundException as ModelNotFoundException;
|
use Illuminate\Database\Eloquent\ModelNotFoundException as ModelNotFoundException;
|
||||||
use Illuminate\Database\Eloquent\RelationNotFoundException;
|
use Illuminate\Database\Eloquent\RelationNotFoundException;
|
||||||
|
use Illuminate\Database\QueryException;
|
||||||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
||||||
use Illuminate\Http\Exceptions\ThrottleRequestsException;
|
use Illuminate\Http\Exceptions\ThrottleRequestsException;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
@ -204,7 +205,11 @@ class Handler extends ExceptionHandler
|
|||||||
return response()->json(['message' => $exception->getMessage()], 400);
|
return response()->json(['message' => $exception->getMessage()], 400);
|
||||||
} elseif ($exception instanceof StripeConnectFailure) {
|
} elseif ($exception instanceof StripeConnectFailure) {
|
||||||
return response()->json(['message' => $exception->getMessage()], 400);
|
return response()->json(['message' => $exception->getMessage()], 400);
|
||||||
}
|
} elseif ($exception instanceof QueryException) {
|
||||||
|
return response()->json(['message' => 'The was a problem executing this query.'], 500);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return parent::render($request, $exception);
|
return parent::render($request, $exception);
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,9 @@ class StoreBankIntegrationRequest extends Request
|
|||||||
public function rules()
|
public function rules()
|
||||||
{
|
{
|
||||||
|
|
||||||
$rules = [];
|
$rules = [
|
||||||
|
'bank_account_name' => 'required|min:3'
|
||||||
|
];
|
||||||
|
|
||||||
return $rules;
|
return $rules;
|
||||||
}
|
}
|
||||||
@ -41,6 +43,9 @@ class StoreBankIntegrationRequest extends Request
|
|||||||
{
|
{
|
||||||
$input = $this->all();
|
$input = $this->all();
|
||||||
|
|
||||||
|
if(!array_key_exists('provider_name', $input) || strlen($input['provider_name']) == 0)
|
||||||
|
$input['provider_name'] = $input['bank_account_name'];
|
||||||
|
|
||||||
$this->replace($input);
|
$this->replace($input);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user