Add thing to apply rules to fints #2081

This commit is contained in:
James Cole
2019-02-12 21:01:12 +01:00
parent 58e55dc789
commit 2117fc2a5a
3 changed files with 6 additions and 3 deletions

View File

@@ -59,17 +59,19 @@ class NewFinTSJobHandler implements FinTSConfigurationInterface
$config['fints_bank_code'] = (string)($data['fints_bank_code'] ?? '');
$config['fints_username'] = (string)($data['fints_username'] ?? '');
$config['fints_password'] = (string)(Crypt::encrypt($data['fints_password']) ?? '');
$config['apply-rules'] = 1 === (int)$data['apply_rules'];
$this->repository->setConfiguration($this->importJob, $config);
$incomplete = false;
foreach ($config as $value) {
$incomplete = '' === $value or $incomplete;
}
if ($incomplete) {
return new MessageBag([trans('import.incomplete_fints_form')]);
}
$finTS = app(FinTS::class, ['config' => $this->importJob->configuration]);
if (true !== ($checkConnection = $finTS->checkConnection())) {
return new MessageBag([trans('import.fints_connection_failed', ['originalError' => $checkConnection])]);