James Cole 1 year ago
parent
commit
c8e15fa177
No known key found for this signature in database GPG Key ID: B49A324B7EAD6D80
  1. 14
      app/Console/AutoImports.php
  2. 2
      app/Http/Controllers/Import/ConversionController.php
  3. 2
      app/Http/Controllers/Import/MapController.php
  4. 2
      app/Http/Controllers/Import/Nordigen/LinkController.php
  5. 2
      app/Http/Middleware/IsReadyForStep.php
  6. 2
      app/Services/Nordigen/Conversion/Routine/GenerateTransactions.php
  7. 2
      app/Services/Nordigen/Conversion/Routine/TransactionProcessor.php
  8. 2
      app/Services/Nordigen/Conversion/RoutineManager.php
  9. 2
      app/Services/Nordigen/Model/Transaction.php
  10. 2
      app/Services/Nordigen/Request/Request.php
  11. 2
      app/Services/Nordigen/Response/ErrorResponse.php
  12. 2
      app/Support/Internal/CollectsAccounts.php
  13. 2
      app/Support/Internal/MergesAccountLists.php
  14. 2
      readme.md

14
app/Console/AutoImports.php

@ -516,7 +516,7 @@ trait AutoImports
foreach ($this->importerAccounts as $account) {
// check if account exists:
if (!array_key_exists($account->getIdentifier(), $localAccounts)) {
Log::debug(sprintf('Nordigen account "%s" (IBAN "%s") is not being imported, so skipped.', $account->getIdentifier(), $account->getIban()));
Log::debug(sprintf('GoCardless account "%s" (IBAN "%s") is not being imported, so skipped.', $account->getIdentifier(), $account->getIban()));
continue;
}
@ -545,8 +545,8 @@ trait AutoImports
private function reportBalanceDifference(Account $account, LocalAccount $localAccount): void
{
Log::debug(sprintf('Report balance difference between Nordigen account "%s" and Firefly III account #%d.', $account->getIdentifier(), $localAccount->id));
app('log')->debug(sprintf('Nordigen account has %d balance entry (entries)', count($account->getBalances())));
Log::debug(sprintf('Report balance difference between GoCardless account "%s" and Firefly III account #%d.', $account->getIdentifier(), $localAccount->id));
app('log')->debug(sprintf('GoCardless account has %d balance entry (entries)', count($account->getBalances())));
/** @var Balance $balance */
foreach ($account->getBalances() as $index => $balance) {
@ -559,7 +559,7 @@ trait AutoImports
{
// compare currencies, and warn if necessary.
if ($balance->currency !== $localAccount->currencyCode) {
app('log')->warning(sprintf('Nordigen account "%s" has currency %s, Firefly III account #%d uses %s.', $account->getIdentifier(), $localAccount->id, $balance->currency, $localAccount->currencyCode));
app('log')->warning(sprintf('GoCardless account "%s" has currency %s, Firefly III account #%d uses %s.', $account->getIdentifier(), $localAccount->id, $balance->currency, $localAccount->currencyCode));
$this->line(sprintf('Balance comparison (%s): Firefly III account #%d: Currency mismatch', $balance->type, $localAccount->id));
}
@ -567,15 +567,15 @@ trait AutoImports
$date = Carbon::parse($balance->date);
$localDate = Carbon::parse($localAccount->currentBalanceDate);
if (!$date->isSameDay($localDate)) {
app('log')->warning(sprintf('Nordigen balance is from day %s, Firefly III account from %s.', $date->format('Y-m-d'), $date->format('Y-m-d')));
app('log')->warning(sprintf('GoCardless balance is from day %s, Firefly III account from %s.', $date->format('Y-m-d'), $date->format('Y-m-d')));
$this->line(sprintf('Balance comparison (%s): Firefly III account #%d: Date mismatch', $balance->type, $localAccount->id));
}
// compare balance, warn (also a message)
app('log')->debug(sprintf('Comparing %s and %s', $balance->amount, $localAccount->currentBalance));
if (0 !== bccomp($balance->amount, $localAccount->currentBalance)) {
app('log')->warning(sprintf('Nordigen balance is %s, Firefly III balance is %s.', $balance->amount, $localAccount->currentBalance));
$this->line(sprintf('Balance comparison (%s): Firefly III account #%d: Nordigen reports %s %s, Firefly III reports %s %d', $balance->type, $localAccount->id, $balance->currency, $balance->amount, $localAccount->currencyCode, $localAccount->currentBalance));
app('log')->warning(sprintf('GoCardless balance is %s, Firefly III balance is %s.', $balance->amount, $localAccount->currentBalance));
$this->line(sprintf('Balance comparison (%s): Firefly III account #%d: GoCardless reports %s %s, Firefly III reports %s %d', $balance->type, $localAccount->id, $balance->currency, $balance->amount, $localAccount->currencyCode, $localAccount->currentBalance));
}
if (0 === bccomp($balance->amount, $localAccount->currentBalance)) {
$this->line(sprintf('Balance comparison (%s): Firefly III account #%d: Balance OK', $balance->type, $localAccount->id));

2
app/Http/Controllers/Import/ConversionController.php

@ -111,7 +111,7 @@ class ConversionController extends Controller
}
}
if ('nordigen' === $flow) {
app('log')->debug('Create Nordigen routine manager.');
app('log')->debug('Create GoCardless routine manager.');
$routine = new NordigenRoutineManager($identifier);
}
if ('spectre' === $flow) {

2
app/Http/Controllers/Import/MapController.php

@ -85,7 +85,7 @@ class MapController extends Controller
// nordigen, spectre and others:
if ('file' !== $configuration->getFlow()) {
app('log')->debug('Get mapping data for nordigen and spectre');
app('log')->debug('Get mapping data for GoCardless and spectre');
$roles = [];
$data = $this->getImporterMapInformation();
}

2
app/Http/Controllers/Import/Nordigen/LinkController.php

@ -133,7 +133,7 @@ class LinkController extends Controller
app('log')->debug(sprintf('Reference is "%s"', $reference));
if ('' === $reference) {
throw new ImporterHttpException('The reference returned by Nordigen was unexpectedly empty.');
throw new ImporterHttpException('The reference returned by GoCardless was unexpectedly empty.');
}
// create a new config thing

2
app/Http/Middleware/IsReadyForStep.php

@ -207,7 +207,7 @@ trait IsReadyForStep
// must already have the conversion, or not ready for this step:
if (session()->has(Constants::READY_FOR_CONVERSION) && true === session()->get(Constants::READY_FOR_CONVERSION)) {
app('log')->debug('Nordigen: return false, not yet ready for step [2].');
app('log')->debug('GoCardless: return false, not yet ready for step [2].');
return false;
}

2
app/Services/Nordigen/Conversion/Routine/GenerateTransactions.php

@ -103,7 +103,7 @@ class GenerateTransactions
$accountInfo = $response->data['account'] ?? [];
$set['iban'] = $accountInfo['iban'] ?? '';
$info[$nordigenIdentifier] = $set;
app('log')->debug(sprintf('Collected IBAN "%s" for Nordigen account "%s"', $set['iban'], $nordigenIdentifier));
app('log')->debug(sprintf('Collected IBAN "%s" for GoCardless account "%s"', $set['iban'], $nordigenIdentifier));
}
$this->nordigenAccountInfo = $info;
}

2
app/Services/Nordigen/Conversion/Routine/TransactionProcessor.php

@ -86,7 +86,7 @@ class TransactionProcessor
} catch (AgreementExpiredException $e) {
$this->addError(
0,
'Your Nordigen End User Agreement has expired. You must refresh it by generating a new one through the Firefly III Data Importer user interface. See the other error messages for more information.'
'Your GoCardless End User Agreement has expired. You must refresh it by generating a new one through the Firefly III Data Importer user interface. See the other error messages for more information.'
);
if (array_key_exists('summary', $e->json) && '' !== (string) $e->json['summary']) {
$this->addError(0, $e->json['summary']);

2
app/Services/Nordigen/Conversion/RoutineManager.php

@ -241,7 +241,7 @@ class RoutineManager implements RoutineManagerInterface
try {
$this->downloaded = $this->transactionProcessor->download();
} catch (ImporterErrorException $e) {
app('log')->error('Could not download transactions from Nordigen.');
app('log')->error('Could not download transactions from GoCardless.');
app('log')->error($e->getMessage());
// add error to current error thing:

2
app/Services/Nordigen/Model/Transaction.php

@ -95,7 +95,7 @@ class Transaction
*/
public static function fromArray($array): self
{
app('log')->debug('Nordigen transaction from array', $array);
app('log')->debug('GoCardless transaction from array', $array);
$object = new self();
$object->tags = [];
$object->additionalInformation = trim($array['additionalInformation'] ?? '');

2
app/Services/Nordigen/Request/Request.php

@ -108,7 +108,7 @@ abstract class Request
'Accept' => 'application/json',
'Content-Type' => 'application/json',
'Authorization' => sprintf('Bearer %s', $this->getToken()),
'user-agent' => sprintf('Firefly III Nordigen importer / %s / %s', config('importer.version'), config('auth.line_b')),
'user-agent' => sprintf('Firefly III GoCardless importer / %s / %s', config('importer.version'), config('auth.line_b')),
],
]
);

2
app/Services/Nordigen/Response/ErrorResponse.php

@ -36,7 +36,7 @@ class ErrorResponse extends Response
public function __construct(array $data)
{
$this->class = $data['error']['class'] ?? 'Unknown Nordigen Error Class';
$this->class = $data['error']['class'] ?? 'Unknown GoCardless Error Class';
$this->message = $data['error']['message'] ?? 'Unknown Error';
}
}

2
app/Support/Internal/CollectsAccounts.php

@ -123,7 +123,7 @@ trait CollectsAccounts
$total = count($response);
$return = [];
$cache = [];
app('log')->debug(sprintf('Found %d Nordigen accounts.', $total));
app('log')->debug(sprintf('Found %d GoCardless accounts.', $total));
/** @var NordigenAccount $account */
foreach ($response as $index => $account) {

2
app/Support/Internal/MergesAccountLists.php

@ -33,7 +33,7 @@ trait MergesAccountLists
{
protected function mergeNordigenAccountLists(array $nordigen, array $fireflyIII): array
{
app('log')->debug('Now merging Nordigen account lists.');
app('log')->debug('Now merging GoCardless account lists.');
$generic = ImportServiceAccount::convertNordigenArray($nordigen);
return $this->mergeGenericAccountList($generic, $fireflyIII);

2
readme.md

@ -32,7 +32,7 @@
"Firefly III" is a (self-hosted) manager for your personal finances. It can help you keep track of your expenses and income, so you can spend less and save more. The **data importer** is built to help you import transactions into Firefly III. It is separated from Firefly III for security and maintenance reasons.
The data importer does not connect to your bank directly. Instead, it uses [Nordigen](https://nordigen.com/en/coverage/) and [SaltEdge](https://www.saltedge.com/products/spectre/countries) to connect to over 6000 banks worldwide. These services are free for Firefly III users, but require registration. Keep in mind these services have their own privacy and data usage policies.
The data importer does not connect to your bank directly. Instead, it uses [GoCardless](https://gocardless.com/) and [SaltEdge](https://www.saltedge.com/products/spectre/countries) to connect to over 6000 banks worldwide. These services are free for Firefly III users, but require registration. Keep in mind these services have their own privacy and data usage policies.
The data importer can import CSV files you've downloaded from your bank.

Loading…
Cancel
Save