Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
JC5 committed Sep 28, 2024
1 parent 4cc7089 commit c8e15fa
Show file tree
Hide file tree
Showing 14 changed files with 20 additions and 20 deletions.
14 changes: 7 additions & 7 deletions app/Console/AutoImports.php
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ private function reportBalanceDifferences(Configuration $configuration): void
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;
}
Expand Down Expand Up @@ -545,8 +545,8 @@ private function reportBalanceDifferences(Configuration $configuration): void

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) {
Expand All @@ -559,23 +559,23 @@ private function reportSingleDifference(Account $account, LocalAccount $localAcc
{
// 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));
}

// compare dates, warn
$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));
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Import/ConversionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public function index()
}
}
if ('nordigen' === $flow) {
app('log')->debug('Create Nordigen routine manager.');
app('log')->debug('Create GoCardless routine manager.');
$routine = new NordigenRoutineManager($identifier);
}
if ('spectre' === $flow) {
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Import/MapController.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function index()

// 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();
}
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Import/Nordigen/LinkController.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public function callback(Request $request)
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
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Middleware/IsReadyForStep.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ private function isReadyForNordigenStep(): bool

// 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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public function collectNordigenAccounts(): void
$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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function download(): array
} 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']);
Expand Down
2 changes: 1 addition & 1 deletion app/Services/Nordigen/Conversion/RoutineManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ private function downloadFromGoCardless(): void
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:
Expand Down
2 changes: 1 addition & 1 deletion app/Services/Nordigen/Model/Transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'] ?? '');
Expand Down
2 changes: 1 addition & 1 deletion app/Services/Nordigen/Request/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ protected function authenticatedGet(): array
'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')),
],
]
);
Expand Down
2 changes: 1 addition & 1 deletion app/Services/Nordigen/Response/ErrorResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 1 addition & 1 deletion app/Support/Internal/CollectsAccounts.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ protected function getNordigenAccounts(Configuration $configuration): array
$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) {
Expand Down
2 changes: 1 addition & 1 deletion app/Support/Internal/MergesAccountLists.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down

0 comments on commit c8e15fa

Please sign in to comment.