From 58f87dc80f0988f2280d526251514578200ad1ed Mon Sep 17 00:00:00 2001 From: Matt Fiddaman Date: Fri, 10 Jan 2025 11:20:11 +0000 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20standardise=20GoCardless?= =?UTF-8?q?=20handlers=20(#541)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app-gocardless/bank-factory.js | 94 +++++++++---------- ...adef1822.js => 1822_direkt_heladef1822.js} | 0 ...{abanca-caglesmm.js => abanca_caglesmm.js} | 0 src/app-gocardless/banks/abnamro_abnanl2a.js | 15 +-- ...sudef1.js => american_express_aesudef1.js} | 6 +- ...bsabesbbb.js => bancsabadell_bsabesbbb.js} | 0 .../banks/bank_of_ireland_b365_bofiie2d.js | 2 + ...nter-bkbkesmm.js => bankinter_bkbkesmm.js} | 15 +-- .../banks/berliner_sparkasse_beladebexxx.js | 16 +--- ...{bnp-be-gebabebb.js => bnp_be_gebabebb.js} | 0 src/app-gocardless/banks/cbc_cregbebb.js | 2 + ...ebank-dabno22.js => danskebank_dabno22.js} | 14 +-- ...ybank-bawaatww.js => easybank_bawaatww.js} | 0 ...card-swednokk.js => entercard_swednokk.js} | 29 ++---- ...FTNOFRP1XXX.js => fortuneo_ftnofrp1xxx.js} | 2 +- ...ATIC_HSTBDEHH.js => hanseatic_hstbdehh.js} | 0 src/app-gocardless/banks/hype_hyeeit22.js | 2 +- .../{ing-ingbrobu.js => ing_ingbrobu.js} | 0 .../{ing-ingddeff.js => ing_ingddeff.js} | 14 +-- ...{ing-pl-ingbplpw.js => ing_pl_ingbplpw.js} | 14 +-- src/app-gocardless/banks/integration-bank.js | 8 +- ...sybank-itbbitmm.js => isybank_itbbitmm.js} | 2 + src/app-gocardless/banks/kbc_kredbebb.js | 2 + ...l-brexplpw.js => mbank_retail_brexplpw.js} | 14 +-- ...ide-naiagb21.js => nationwide_naiagb21.js} | 2 - src/app-gocardless/banks/nbg_ethngraaxxx.js | 16 +--- ...x-norwnok1.js => norwegian_xx_norwnok1.js} | 14 +-- src/app-gocardless/banks/revolut_revolt21.js | 2 +- ...sfin0000.js => sandboxfinance_sfin0000.js} | 16 +--- ...eb-kort-bank-ab.js => seb_kort_bank_ab.js} | 14 +-- .../banks/{seb-privat.js => seb_privat.js} | 0 ...rnord-spnodk22.js => sparnord_spnodk22.js} | 0 ...-karsde66.js => spk_karlsruhe_karsde66.js} | 16 +--- ... => spk_marburg_biedenkopf_heladef1mar.js} | 18 +--- ...js => spk_worms_alzey_ried_malade51wor.js} | 2 +- ...ddxxx.js => ssk_dusseldorf_dussdeddxxx.js} | 2 + ...dbank-habalv22.js => swedbank_habalv22.js} | 2 +- ...glesmm.spec.js => abanca_caglesmm.spec.js} | 2 +- ...spec.js => bancsabadell_bsabesbbb.spec.js} | 2 +- ...atww.spec.js => easybank_bawaatww.spec.js} | 2 +- ...X.spec.js => fortuneo_ftnofrp1xxx.spec.js} | 2 +- ...-ingddeff.spec.js => ing_ingddeff.spec.js} | 4 +- ...gbplpw.spec.js => ing_pl_ingbplpw.spec.js} | 4 +- ...-bank.spec.js => integration_bank.spec.js} | 4 +- ....spec.js => mbank_retail_brexplpw.spec.js} | 4 +- ...21.spec.js => nationwide_naiagb21.spec.js} | 2 +- ...pec.js => sandboxfinance_sfin0000.spec.js} | 4 +- ...pk_marburg_biedenkopf_heladef1mar.spec.js} | 2 +- ...lv22.spec.js => swedbank_habalv22.spec.js} | 2 +- src/app-gocardless/banks/virgin_nrnbgb22.js | 2 - .../services/tests/gocardless-service.spec.js | 4 +- upcoming-release-notes/541.md | 6 ++ 52 files changed, 119 insertions(+), 282 deletions(-) rename src/app-gocardless/banks/{1822-direkt-heladef1822.js => 1822_direkt_heladef1822.js} (100%) rename src/app-gocardless/banks/{abanca-caglesmm.js => abanca_caglesmm.js} (100%) rename src/app-gocardless/banks/{american-express-aesudef1.js => american_express_aesudef1.js} (86%) rename src/app-gocardless/banks/{bancsabadell-bsabesbbb.js => bancsabadell_bsabesbbb.js} (100%) rename src/app-gocardless/banks/{bankinter-bkbkesmm.js => bankinter_bkbkesmm.js} (69%) rename src/app-gocardless/banks/{bnp-be-gebabebb.js => bnp_be_gebabebb.js} (100%) rename src/app-gocardless/banks/{danskebank-dabno22.js => danskebank_dabno22.js} (79%) rename src/app-gocardless/banks/{easybank-bawaatww.js => easybank_bawaatww.js} (100%) rename src/app-gocardless/banks/{entercard-swednokk.js => entercard_swednokk.js} (68%) rename src/app-gocardless/banks/{FORTUNEO_FTNOFRP1XXX.js => fortuneo_ftnofrp1xxx.js} (98%) rename src/app-gocardless/banks/{HANSEATIC_HSTBDEHH.js => hanseatic_hstbdehh.js} (100%) rename src/app-gocardless/banks/{ing-ingbrobu.js => ing_ingbrobu.js} (100%) rename src/app-gocardless/banks/{ing-ingddeff.js => ing_ingddeff.js} (80%) rename src/app-gocardless/banks/{ing-pl-ingbplpw.js => ing_pl_ingbplpw.js} (78%) rename src/app-gocardless/banks/{isybank-itbbitmm.js => isybank_itbbitmm.js} (94%) rename src/app-gocardless/banks/{mbank-retail-brexplpw.js => mbank_retail_brexplpw.js} (78%) rename src/app-gocardless/banks/{nationwide-naiagb21.js => nationwide_naiagb21.js} (98%) rename src/app-gocardless/banks/{norwegian-xx-norwnok1.js => norwegian_xx_norwnok1.js} (87%) rename src/app-gocardless/banks/{sandboxfinance-sfin0000.js => sandboxfinance_sfin0000.js} (80%) rename src/app-gocardless/banks/{seb-kort-bank-ab.js => seb_kort_bank_ab.js} (84%) rename src/app-gocardless/banks/{seb-privat.js => seb_privat.js} (100%) rename src/app-gocardless/banks/{sparnord-spnodk22.js => sparnord_spnodk22.js} (100%) rename src/app-gocardless/banks/{spk-karlsruhe-karsde66.js => spk_karlsruhe_karsde66.js} (88%) rename src/app-gocardless/banks/{spk-marburg-biedenkopf-heladef1mar.js => spk_marburg_biedenkopf_heladef1mar.js} (78%) rename src/app-gocardless/banks/{spk-worms-alzey-ried-malade51wor.js => spk_worms_alzey_ried_malade51wor.js} (96%) rename src/app-gocardless/banks/{ssk-dusseldorf-dussdeddxxx.js => ssk_dusseldorf_dussdeddxxx.js} (97%) rename src/app-gocardless/banks/{swedbank-habalv22.js => swedbank_habalv22.js} (98%) rename src/app-gocardless/banks/tests/{abanca-caglesmm.spec.js => abanca_caglesmm.spec.js} (95%) rename src/app-gocardless/banks/tests/{bancsabadell-bsabesbbb.spec.js => bancsabadell_bsabesbbb.spec.js} (97%) rename src/app-gocardless/banks/tests/{easybank-bawaatww.spec.js => easybank_bawaatww.spec.js} (97%) rename src/app-gocardless/banks/tests/{FORTUNEO_FTNOFRP1XXX.spec.js => fortuneo_ftnofrp1xxx.spec.js} (99%) rename src/app-gocardless/banks/tests/{ing-ingddeff.spec.js => ing_ingddeff.spec.js} (99%) rename src/app-gocardless/banks/tests/{ing-pl-ingbplpw.spec.js => ing_pl_ingbplpw.spec.js} (98%) rename src/app-gocardless/banks/tests/{integration-bank.spec.js => integration_bank.spec.js} (97%) rename src/app-gocardless/banks/tests/{mbank-retail-brexplpw.spec.js => mbank_retail_brexplpw.spec.js} (97%) rename src/app-gocardless/banks/tests/{nationwide-naiagb21.spec.js => nationwide_naiagb21.spec.js} (98%) rename src/app-gocardless/banks/tests/{sandboxfinance-sfin0000.spec.js => sandboxfinance_sfin0000.spec.js} (97%) rename src/app-gocardless/banks/tests/{spk-marburg-biedenkopf-heladef1mar.spec.js => spk_marburg_biedenkopf_heladef1mar.spec.js} (98%) rename src/app-gocardless/banks/tests/{swedbank-habalv22.spec.js => swedbank_habalv22.spec.js} (97%) create mode 100644 upcoming-release-notes/541.md diff --git a/src/app-gocardless/bank-factory.js b/src/app-gocardless/bank-factory.js index 1f2e3068a..33e83a78d 100644 --- a/src/app-gocardless/bank-factory.js +++ b/src/app-gocardless/bank-factory.js @@ -1,39 +1,39 @@ -import AbancaCaglesmm from './banks/abanca-caglesmm.js'; +import AbancaCaglesmm from './banks/abanca_caglesmm.js'; import AbnamroAbnanl2a from './banks/abnamro_abnanl2a.js'; -import AmericanExpressAesudef1 from './banks/american-express-aesudef1.js'; -import BancsabadellBsabesbb from './banks/bancsabadell-bsabesbbb.js'; -import BankinterBkbkesmm from './banks/bankinter-bkbkesmm.js'; -import BankOfIrelandB365 from './banks/bank_of_ireland_b365_bofiie2d.js'; -import Belfius from './banks/belfius_gkccbebb.js'; -import Berliner_Sparkasse_beladebexxx from './banks/berliner_sparkasse_beladebexxx.js'; -import BnpBeGebabebb from './banks/bnp-be-gebabebb.js'; -import CBCcregbebb from './banks/cbc_cregbebb.js'; -import DanskeBankDabNO22 from './banks/danskebank-dabno22.js'; -import EasybankBawaatww from './banks/easybank-bawaatww.js'; -import EntercardSwednokk from './banks/entercard-swednokk.js'; -import Fortuneo from './banks/FORTUNEO_FTNOFRP1XXX.js'; -import HanseaticBank from './banks/HANSEATIC_HSTBDEHH.js'; -import Hype_HYEEIT22 from './banks/hype_hyeeit22.js'; -import IngIngbrobu from './banks/ing-ingbrobu.js'; -import IngIngddeff from './banks/ing-ingddeff.js'; -import IngPlIngbplpw from './banks/ing-pl-ingbplpw.js'; +import AmericanExpressAesudef1 from './banks/american_express_aesudef1.js'; +import BancsabadellBsabesbb from './banks/bancsabadell_bsabesbbb.js'; +import BankinterBkbkesmm from './banks/bankinter_bkbkesmm.js'; +import BankOfIrelandB365Bofiie2d from './banks/bank_of_ireland_b365_bofiie2d.js'; +import BelfiusGkccbebb from './banks/belfius_gkccbebb.js'; +import BerlinerSparkasseBeladebexxx from './banks/berliner_sparkasse_beladebexxx.js'; +import BnpBeGebabebb from './banks/bnp_be_gebabebb.js'; +import CbcCregbebb from './banks/cbc_cregbebb.js'; +import DanskebankDabno22 from './banks/danskebank_dabno22.js'; +import EasybankBawaatww from './banks/easybank_bawaatww.js'; +import EntercardSwednokk from './banks/entercard_swednokk.js'; +import FortuneoFtnofrp1xxx from './banks/fortuneo_ftnofrp1xxx.js'; +import HanseaticHstbdehh from './banks/hanseatic_hstbdehh.js'; +import HypeHyeeit22 from './banks/hype_hyeeit22.js'; +import IngIngbrobu from './banks/ing_ingbrobu.js'; +import IngIngddeff from './banks/ing_ingddeff.js'; +import IngPlIngbplpw from './banks/ing_pl_ingbplpw.js'; import IntegrationBank from './banks/integration-bank.js'; -import IsyBankItbbitmm from './banks/isybank-itbbitmm.js'; -import KBCkredbebb from './banks/kbc_kredbebb.js'; -import MbankRetailBrexplpw from './banks/mbank-retail-brexplpw.js'; -import NationwideNaiaGB21 from './banks/nationwide-naiagb21.js'; +import IsyBankItbbitmm from './banks/isybank_itbbitmm.js'; +import KbcKredbebb from './banks/kbc_kredbebb.js'; +import MbankRetailBrexplpw from './banks/mbank_retail_brexplpw.js'; +import NationwideNaiagb21 from './banks/nationwide_naiagb21.js'; import NbgEthngraaxxx from './banks/nbg_ethngraaxxx.js'; -import NorwegianXxNorwnok1 from './banks/norwegian-xx-norwnok1.js'; +import NorwegianXxNorwnok1 from './banks/norwegian_xx_norwnok1.js'; import RevolutRevolt21 from './banks/revolut_revolt21.js'; -import SEBKortBankAB from './banks/seb-kort-bank-ab.js'; -import SEBPrivat from './banks/seb-privat.js'; -import SandboxfinanceSfin0000 from './banks/sandboxfinance-sfin0000.js'; -import SparNordSpNoDK22 from './banks/sparnord-spnodk22.js'; -import SpkKarlsruhekarsde66 from './banks/spk-karlsruhe-karsde66.js'; -import SpkMarburgBiedenkopfHeladef1mar from './banks/spk-marburg-biedenkopf-heladef1mar.js'; -import SpkWormsAlzeyRiedMalade51wor from './banks/spk-worms-alzey-ried-malade51wor.js'; -import SskDusseldorfDussdeddxxx from './banks/ssk-dusseldorf-dussdeddxxx.js'; -import SwedbankHabaLV22 from './banks/swedbank-habalv22.js'; +import SebKortBankAb from './banks/seb_kort_bank_ab.js'; +import SebPrivat from './banks/seb_privat.js'; +import SandboxfinanceSfin0000 from './banks/sandboxfinance_sfin0000.js'; +import SparnordSpnodk22 from './banks/sparnord_spnodk22.js'; +import SpkKarlsruheKarsde66 from './banks/spk_karlsruhe_karsde66.js'; +import SpkMarburgBiedenkopfHeladef1mar from './banks/spk_marburg_biedenkopf_heladef1mar.js'; +import SpkWormsAlzeyRiedMalade51wor from './banks/spk_worms_alzey_ried_malade51wor.js'; +import SskDusseldorfDussdeddxxx from './banks/ssk_dusseldorf_dussdeddxxx.js'; +import SwedbankHabalv22 from './banks/swedbank_habalv22.js'; import VirginNrnbgb22 from './banks/virgin_nrnbgb22.js'; export const banks = [ @@ -42,36 +42,36 @@ export const banks = [ AmericanExpressAesudef1, BancsabadellBsabesbb, BankinterBkbkesmm, - BankOfIrelandB365, - Belfius, - Berliner_Sparkasse_beladebexxx, + BankOfIrelandB365Bofiie2d, + BelfiusGkccbebb, + BerlinerSparkasseBeladebexxx, BnpBeGebabebb, - CBCcregbebb, - DanskeBankDabNO22, + CbcCregbebb, + DanskebankDabno22, EasybankBawaatww, EntercardSwednokk, - Fortuneo, - HanseaticBank, - Hype_HYEEIT22, + FortuneoFtnofrp1xxx, + HanseaticHstbdehh, + HypeHyeeit22, IngIngbrobu, IngIngddeff, IngPlIngbplpw, IsyBankItbbitmm, - KBCkredbebb, + KbcKredbebb, MbankRetailBrexplpw, - NationwideNaiaGB21, + NationwideNaiagb21, NbgEthngraaxxx, NorwegianXxNorwnok1, RevolutRevolt21, - SEBKortBankAB, - SEBPrivat, + SebKortBankAb, + SebPrivat, SandboxfinanceSfin0000, - SparNordSpNoDK22, - SpkKarlsruhekarsde66, + SparnordSpnodk22, + SpkKarlsruheKarsde66, SpkMarburgBiedenkopfHeladef1mar, SpkWormsAlzeyRiedMalade51wor, SskDusseldorfDussdeddxxx, - SwedbankHabaLV22, + SwedbankHabalv22, VirginNrnbgb22, ]; diff --git a/src/app-gocardless/banks/1822-direkt-heladef1822.js b/src/app-gocardless/banks/1822_direkt_heladef1822.js similarity index 100% rename from src/app-gocardless/banks/1822-direkt-heladef1822.js rename to src/app-gocardless/banks/1822_direkt_heladef1822.js diff --git a/src/app-gocardless/banks/abanca-caglesmm.js b/src/app-gocardless/banks/abanca_caglesmm.js similarity index 100% rename from src/app-gocardless/banks/abanca-caglesmm.js rename to src/app-gocardless/banks/abanca_caglesmm.js diff --git a/src/app-gocardless/banks/abnamro_abnanl2a.js b/src/app-gocardless/banks/abnamro_abnanl2a.js index 5d5332d32..0bf6e216f 100644 --- a/src/app-gocardless/banks/abnamro_abnanl2a.js +++ b/src/app-gocardless/banks/abnamro_abnanl2a.js @@ -1,5 +1,6 @@ import Fallback from './integration-bank.js'; -import { printIban, amountToInteger } from '../utils.js'; + +import { amountToInteger } from '../utils.js'; import { formatPayeeName } from '../../util/payee-name.js'; /** @type {import('./bank.interface.js').IBank} */ @@ -10,18 +11,6 @@ export default { accessValidForDays: 180, - normalizeAccount(account) { - return { - account_id: account.id, - institution: account.institution, - mask: account.iban.slice(-4), - iban: account.iban, - name: [account.name, printIban(account)].join(' '), - official_name: account.product, - type: 'checking', - }; - }, - normalizeTransaction(transaction, _booked) { // There is no remittanceInformationUnstructured, so we'll make it transaction.remittanceInformationUnstructured = diff --git a/src/app-gocardless/banks/american-express-aesudef1.js b/src/app-gocardless/banks/american_express_aesudef1.js similarity index 86% rename from src/app-gocardless/banks/american-express-aesudef1.js rename to src/app-gocardless/banks/american_express_aesudef1.js index 1f5e22833..2ae8168df 100644 --- a/src/app-gocardless/banks/american-express-aesudef1.js +++ b/src/app-gocardless/banks/american_express_aesudef1.js @@ -13,17 +13,13 @@ export default { normalizeAccount(account) { return { - account_id: account.id, - institution: account.institution, + ...Fallback.normalizeAccount(account), // The `iban` field for these American Express cards is actually a masked // version of the PAN. No IBAN is provided. mask: account.iban.slice(-5), iban: null, name: [account.details, `(${account.iban.slice(-5)})`].join(' '), official_name: account.details, - // The Actual account `type` field is legacy and is currently not used - // for anything, so we leave it as the default of `checking`. - type: 'checking', }; }, diff --git a/src/app-gocardless/banks/bancsabadell-bsabesbbb.js b/src/app-gocardless/banks/bancsabadell_bsabesbbb.js similarity index 100% rename from src/app-gocardless/banks/bancsabadell-bsabesbbb.js rename to src/app-gocardless/banks/bancsabadell_bsabesbbb.js diff --git a/src/app-gocardless/banks/bank_of_ireland_b365_bofiie2d.js b/src/app-gocardless/banks/bank_of_ireland_b365_bofiie2d.js index 959a0fd98..6e677775d 100644 --- a/src/app-gocardless/banks/bank_of_ireland_b365_bofiie2d.js +++ b/src/app-gocardless/banks/bank_of_ireland_b365_bofiie2d.js @@ -6,6 +6,8 @@ export default { institutionIds: ['BANK_OF_IRELAND_B365_BOFIIE2D'], + accessValidForDays: 180, + normalizeTransaction(transaction, booked) { transaction.remittanceInformationUnstructured = fixupPayee( transaction.remittanceInformationUnstructured, diff --git a/src/app-gocardless/banks/bankinter-bkbkesmm.js b/src/app-gocardless/banks/bankinter_bkbkesmm.js similarity index 69% rename from src/app-gocardless/banks/bankinter-bkbkesmm.js rename to src/app-gocardless/banks/bankinter_bkbkesmm.js index c7e17059f..92672d6de 100644 --- a/src/app-gocardless/banks/bankinter-bkbkesmm.js +++ b/src/app-gocardless/banks/bankinter_bkbkesmm.js @@ -1,6 +1,5 @@ import Fallback from './integration-bank.js'; -import { printIban } from '../utils.js'; import { formatPayeeName } from '../../util/payee-name.js'; /** @type {import('./bank.interface.js').IBank} */ @@ -9,19 +8,7 @@ export default { institutionIds: ['BANKINTER_BKBKESMM'], - accessValidForDays: 90, - - normalizeAccount(account) { - return { - account_id: account.id, - institution: account.institution, - mask: account.iban.slice(-4), - iban: account.iban, - name: [account.name, printIban(account)].join(' '), - official_name: account.product, - type: 'checking', - }; - }, + accessValidForDays: 180, normalizeTransaction(transaction, _booked) { transaction.remittanceInformationUnstructured = diff --git a/src/app-gocardless/banks/berliner_sparkasse_beladebexxx.js b/src/app-gocardless/banks/berliner_sparkasse_beladebexxx.js index 6279d9e38..2ef27d7d6 100644 --- a/src/app-gocardless/banks/berliner_sparkasse_beladebexxx.js +++ b/src/app-gocardless/banks/berliner_sparkasse_beladebexxx.js @@ -1,6 +1,6 @@ import Fallback from './integration-bank.js'; -import { printIban, amountToInteger } from '../utils.js'; +import { amountToInteger } from '../utils.js'; import { formatPayeeName } from '../../util/payee-name.js'; /** @type {import('./bank.interface.js').IBank} */ @@ -9,19 +9,7 @@ export default { institutionIds: ['BERLINER_SPARKASSE_BELADEBEXXX'], - accessValidForDays: 90, - - normalizeAccount(account) { - return { - account_id: account.id, - institution: account.institution, - mask: account.iban.slice(-4), - iban: account.iban, - name: [account.name, printIban(account)].join(' '), - official_name: account.product, - type: 'checking', - }; - }, + accessValidForDays: 180, /** * Following the GoCardless documentation[0] we should prefer `bookingDate` diff --git a/src/app-gocardless/banks/bnp-be-gebabebb.js b/src/app-gocardless/banks/bnp_be_gebabebb.js similarity index 100% rename from src/app-gocardless/banks/bnp-be-gebabebb.js rename to src/app-gocardless/banks/bnp_be_gebabebb.js diff --git a/src/app-gocardless/banks/cbc_cregbebb.js b/src/app-gocardless/banks/cbc_cregbebb.js index bf881dacf..94ab20285 100644 --- a/src/app-gocardless/banks/cbc_cregbebb.js +++ b/src/app-gocardless/banks/cbc_cregbebb.js @@ -7,6 +7,8 @@ export default { institutionIds: ['CBC_CREGBEBB'], + accessValidForDays: 180, + /** * For negative amounts, the only payee information we have is returned in * remittanceInformationUnstructured. diff --git a/src/app-gocardless/banks/danskebank-dabno22.js b/src/app-gocardless/banks/danskebank_dabno22.js similarity index 79% rename from src/app-gocardless/banks/danskebank-dabno22.js rename to src/app-gocardless/banks/danskebank_dabno22.js index 99fa891aa..3d83ea950 100644 --- a/src/app-gocardless/banks/danskebank-dabno22.js +++ b/src/app-gocardless/banks/danskebank_dabno22.js @@ -1,6 +1,6 @@ import Fallback from './integration-bank.js'; -import { printIban, amountToInteger } from '../utils.js'; +import { amountToInteger } from '../utils.js'; import { formatPayeeName } from '../../util/payee-name.js'; /** @type {import('./bank.interface.js').IBank} */ @@ -11,18 +11,6 @@ export default { accessValidForDays: 180, - normalizeAccount(account) { - return { - account_id: account.id, - institution: account.institution, - mask: account.iban.slice(-4), - iban: account.iban, - name: [account.name, printIban(account)].join(' '), - official_name: account.name, - type: 'checking', - }; - }, - normalizeTransaction(transaction, _booked) { /** * Danske Bank appends the EndToEndID: NOTPROVIDED to diff --git a/src/app-gocardless/banks/easybank-bawaatww.js b/src/app-gocardless/banks/easybank_bawaatww.js similarity index 100% rename from src/app-gocardless/banks/easybank-bawaatww.js rename to src/app-gocardless/banks/easybank_bawaatww.js diff --git a/src/app-gocardless/banks/entercard-swednokk.js b/src/app-gocardless/banks/entercard_swednokk.js similarity index 68% rename from src/app-gocardless/banks/entercard-swednokk.js rename to src/app-gocardless/banks/entercard_swednokk.js index 2742e83bf..daafbfb89 100644 --- a/src/app-gocardless/banks/entercard-swednokk.js +++ b/src/app-gocardless/banks/entercard_swednokk.js @@ -1,31 +1,18 @@ import * as d from 'date-fns'; -import { - amountToInteger, - printIban, - sortByBookingDateOrValueDate, -} from '../utils.js'; + +import Fallback from './integration-bank.js'; + +import { amountToInteger } from '../utils.js'; import { formatPayeeName } from '../../util/payee-name.js'; /** @type {import('./bank.interface.js').IBank} */ export default { + ...Fallback, + institutionIds: ['ENTERCARD_SWEDNOKK'], accessValidForDays: 180, - normalizeAccount(account) { - return { - account_id: account.id, - institution: account.institution, - mask: (account?.iban || '0000').slice(-4), - iban: account?.iban || null, - name: [account.name, printIban(account), account.currency] - .filter(Boolean) - .join(' '), - official_name: `integration-${account.institution_id}`, - type: 'checking', - }; - }, - normalizeTransaction(transaction, _booked) { // GoCardless's Entercard integration returns forex transactions with the // foreign amount in `transactionAmount`, but at least the amount actually @@ -47,10 +34,6 @@ export default { }; }, - sortTransactions(transactions = []) { - return sortByBookingDateOrValueDate(transactions); - }, - calculateStartingBalance(sortedTransactions = [], balances = []) { return sortedTransactions.reduce((total, trans) => { return total - amountToInteger(trans.transactionAmount.amount); diff --git a/src/app-gocardless/banks/FORTUNEO_FTNOFRP1XXX.js b/src/app-gocardless/banks/fortuneo_ftnofrp1xxx.js similarity index 98% rename from src/app-gocardless/banks/FORTUNEO_FTNOFRP1XXX.js rename to src/app-gocardless/banks/fortuneo_ftnofrp1xxx.js index f73d8156b..e05634e4e 100644 --- a/src/app-gocardless/banks/FORTUNEO_FTNOFRP1XXX.js +++ b/src/app-gocardless/banks/fortuneo_ftnofrp1xxx.js @@ -8,7 +8,7 @@ export default { institutionIds: ['FORTUNEO_FTNOFRP1XXX'], - accessValidForDays: 90, + accessValidForDays: 180, normalizeTransaction(transaction, _booked) { const date = diff --git a/src/app-gocardless/banks/HANSEATIC_HSTBDEHH.js b/src/app-gocardless/banks/hanseatic_hstbdehh.js similarity index 100% rename from src/app-gocardless/banks/HANSEATIC_HSTBDEHH.js rename to src/app-gocardless/banks/hanseatic_hstbdehh.js diff --git a/src/app-gocardless/banks/hype_hyeeit22.js b/src/app-gocardless/banks/hype_hyeeit22.js index 7091f3c7a..d69efda8e 100644 --- a/src/app-gocardless/banks/hype_hyeeit22.js +++ b/src/app-gocardless/banks/hype_hyeeit22.js @@ -8,7 +8,7 @@ export default { institutionIds: ['HYPE_HYEEIT22'], - accessValidForDays: 90, + accessValidForDays: 180, normalizeTransaction(transaction, _booked) { /** Online card payments - identified by "crd" transaction code diff --git a/src/app-gocardless/banks/ing-ingbrobu.js b/src/app-gocardless/banks/ing_ingbrobu.js similarity index 100% rename from src/app-gocardless/banks/ing-ingbrobu.js rename to src/app-gocardless/banks/ing_ingbrobu.js diff --git a/src/app-gocardless/banks/ing-ingddeff.js b/src/app-gocardless/banks/ing_ingddeff.js similarity index 80% rename from src/app-gocardless/banks/ing-ingddeff.js rename to src/app-gocardless/banks/ing_ingddeff.js index 2fecdaa24..3eabb9908 100644 --- a/src/app-gocardless/banks/ing-ingddeff.js +++ b/src/app-gocardless/banks/ing_ingddeff.js @@ -1,6 +1,6 @@ import Fallback from './integration-bank.js'; -import { printIban, amountToInteger } from '../utils.js'; +import { amountToInteger } from '../utils.js'; import { formatPayeeName } from '../../util/payee-name.js'; /** @type {import('./bank.interface.js').IBank} */ @@ -11,18 +11,6 @@ export default { accessValidForDays: 180, - normalizeAccount(account) { - return { - account_id: account.id, - institution: account.institution, - mask: account.iban.slice(-4), - iban: account.iban, - name: [account.product, printIban(account)].join(' '), - official_name: account.product, - type: 'checking', - }; - }, - normalizeTransaction(transaction, _booked) { const remittanceInformationMatch = /remittanceinformation:(.*)$/.exec( transaction.remittanceInformationUnstructured, diff --git a/src/app-gocardless/banks/ing-pl-ingbplpw.js b/src/app-gocardless/banks/ing_pl_ingbplpw.js similarity index 78% rename from src/app-gocardless/banks/ing-pl-ingbplpw.js rename to src/app-gocardless/banks/ing_pl_ingbplpw.js index 05b7b9dde..248068cb8 100644 --- a/src/app-gocardless/banks/ing-pl-ingbplpw.js +++ b/src/app-gocardless/banks/ing_pl_ingbplpw.js @@ -1,6 +1,6 @@ import Fallback from './integration-bank.js'; -import { printIban, amountToInteger } from '../utils.js'; +import { amountToInteger } from '../utils.js'; import { formatPayeeName } from '../../util/payee-name.js'; /** @type {import('./bank.interface.js').IBank} */ @@ -11,18 +11,6 @@ export default { accessValidForDays: 180, - normalizeAccount(account) { - return { - account_id: account.id, - institution: account.institution, - mask: account.iban.slice(-4), - iban: account.iban, - name: [account.product, printIban(account)].join(' ').trim(), - official_name: account.product, - type: 'checking', - }; - }, - normalizeTransaction(transaction, _booked) { return { ...transaction, diff --git a/src/app-gocardless/banks/integration-bank.js b/src/app-gocardless/banks/integration-bank.js index 2b4f358e3..c96b08501 100644 --- a/src/app-gocardless/banks/integration-bank.js +++ b/src/app-gocardless/banks/integration-bank.js @@ -38,10 +38,14 @@ export default { institution: account.institution, mask: (account?.iban || '0000').slice(-4), iban: account?.iban || null, - name: [account.name, printIban(account), account.currency] + name: [ + account.name ?? account.displayName ?? account.product, + printIban(account), + account.currency, + ] .filter(Boolean) .join(' '), - official_name: `integration-${account.institution_id}`, + official_name: account.product ?? `integration-${account.institution_id}`, type: 'checking', }; }, diff --git a/src/app-gocardless/banks/isybank-itbbitmm.js b/src/app-gocardless/banks/isybank_itbbitmm.js similarity index 94% rename from src/app-gocardless/banks/isybank-itbbitmm.js rename to src/app-gocardless/banks/isybank_itbbitmm.js index a6685ccae..cc7e78ac3 100644 --- a/src/app-gocardless/banks/isybank-itbbitmm.js +++ b/src/app-gocardless/banks/isybank_itbbitmm.js @@ -6,6 +6,8 @@ export default { institutionIds: ['ISYBANK_ITBBITMM'], + accessValidForDays: 180, + // It has been reported that valueDate is more accurate than booking date // when it is provided normalizeTransaction(transaction, booked) { diff --git a/src/app-gocardless/banks/kbc_kredbebb.js b/src/app-gocardless/banks/kbc_kredbebb.js index 739734073..6818a2f55 100644 --- a/src/app-gocardless/banks/kbc_kredbebb.js +++ b/src/app-gocardless/banks/kbc_kredbebb.js @@ -7,6 +7,8 @@ export default { institutionIds: ['KBC_KREDBEBB'], + accessValidForDays: 180, + /** * For negative amounts, the only payee information we have is returned in * remittanceInformationUnstructured. diff --git a/src/app-gocardless/banks/mbank-retail-brexplpw.js b/src/app-gocardless/banks/mbank_retail_brexplpw.js similarity index 78% rename from src/app-gocardless/banks/mbank-retail-brexplpw.js rename to src/app-gocardless/banks/mbank_retail_brexplpw.js index c2f84ad32..2f6e3c943 100644 --- a/src/app-gocardless/banks/mbank-retail-brexplpw.js +++ b/src/app-gocardless/banks/mbank_retail_brexplpw.js @@ -1,6 +1,6 @@ import Fallback from './integration-bank.js'; -import { printIban, amountToInteger } from '../utils.js'; +import { amountToInteger } from '../utils.js'; import { formatPayeeName } from '../../util/payee-name.js'; /** @type {import('./bank.interface.js').IBank} */ @@ -11,18 +11,6 @@ export default { accessValidForDays: 179, - normalizeAccount(account) { - return { - account_id: account.id, - institution: account.institution, - mask: account.iban.slice(-4), - iban: account.iban, - name: [account.displayName, printIban(account)].join(' '), - official_name: account.product, - type: 'checking', - }; - }, - normalizeTransaction(transaction, _booked) { return { ...transaction, diff --git a/src/app-gocardless/banks/nationwide-naiagb21.js b/src/app-gocardless/banks/nationwide_naiagb21.js similarity index 98% rename from src/app-gocardless/banks/nationwide-naiagb21.js rename to src/app-gocardless/banks/nationwide_naiagb21.js index 90a4c81a3..fdcb93352 100644 --- a/src/app-gocardless/banks/nationwide-naiagb21.js +++ b/src/app-gocardless/banks/nationwide_naiagb21.js @@ -6,8 +6,6 @@ export default { institutionIds: ['NATIONWIDE_NAIAGB21'], - accessValidForDays: 90, - normalizeTransaction(transaction, booked) { // Nationwide can sometimes return pending transactions with a date // representing the latest a transaction could be booked. This stops diff --git a/src/app-gocardless/banks/nbg_ethngraaxxx.js b/src/app-gocardless/banks/nbg_ethngraaxxx.js index a03c1663e..b915ee3bd 100644 --- a/src/app-gocardless/banks/nbg_ethngraaxxx.js +++ b/src/app-gocardless/banks/nbg_ethngraaxxx.js @@ -1,6 +1,6 @@ import Fallback from './integration-bank.js'; -import { printIban, amountToInteger } from '../utils.js'; +import { amountToInteger } from '../utils.js'; import { formatPayeeName } from '../../util/payee-name.js'; /** @type {import('./bank.interface.js').IBank} */ @@ -9,19 +9,7 @@ export default { institutionIds: ['NBG_ETHNGRAAXXX'], - accessValidForDays: 90, - - normalizeAccount(account) { - return { - account_id: account.id, - institution: account.institution, - mask: account.iban.slice(-4), - iban: account.iban, - name: [account.name, printIban(account)].join(' '), - official_name: account.product, - type: 'checking', - }; - }, + accessValidForDays: 180, /** * Fixes for the pending transactions: diff --git a/src/app-gocardless/banks/norwegian-xx-norwnok1.js b/src/app-gocardless/banks/norwegian_xx_norwnok1.js similarity index 87% rename from src/app-gocardless/banks/norwegian-xx-norwnok1.js rename to src/app-gocardless/banks/norwegian_xx_norwnok1.js index 6e8404e04..0a00a34e9 100644 --- a/src/app-gocardless/banks/norwegian-xx-norwnok1.js +++ b/src/app-gocardless/banks/norwegian_xx_norwnok1.js @@ -1,6 +1,6 @@ import Fallback from './integration-bank.js'; -import { printIban, amountToInteger } from '../utils.js'; +import { amountToInteger } from '../utils.js'; import { formatPayeeName } from '../../util/payee-name.js'; /** @type {import('./bank.interface.js').IBank} */ @@ -18,18 +18,6 @@ export default { accessValidForDays: 180, - normalizeAccount(account) { - return { - account_id: account.id, - institution: account.institution, - mask: account.iban.slice(-4), - iban: account.iban, - name: [account.name, printIban(account)].join(' '), - official_name: account.product, - type: 'checking', - }; - }, - normalizeTransaction(transaction, booked) { if (booked) { return { diff --git a/src/app-gocardless/banks/revolut_revolt21.js b/src/app-gocardless/banks/revolut_revolt21.js index 9e660c465..61b27c5a2 100644 --- a/src/app-gocardless/banks/revolut_revolt21.js +++ b/src/app-gocardless/banks/revolut_revolt21.js @@ -8,7 +8,7 @@ export default { institutionIds: ['REVOLUT_REVOLT21'], - accessValidForDays: 90, + accessValidForDays: 180, normalizeTransaction(transaction, _booked) { if ( diff --git a/src/app-gocardless/banks/sandboxfinance-sfin0000.js b/src/app-gocardless/banks/sandboxfinance_sfin0000.js similarity index 80% rename from src/app-gocardless/banks/sandboxfinance-sfin0000.js rename to src/app-gocardless/banks/sandboxfinance_sfin0000.js index 015886b03..0debc6030 100644 --- a/src/app-gocardless/banks/sandboxfinance-sfin0000.js +++ b/src/app-gocardless/banks/sandboxfinance_sfin0000.js @@ -1,6 +1,6 @@ import Fallback from './integration-bank.js'; -import { printIban, amountToInteger } from '../utils.js'; +import { amountToInteger } from '../utils.js'; import { formatPayeeName } from '../../util/payee-name.js'; /** @type {import('./bank.interface.js').IBank} */ @@ -9,19 +9,7 @@ export default { institutionIds: ['SANDBOXFINANCE_SFIN0000'], - accessValidForDays: 90, - - normalizeAccount(account) { - return { - account_id: account.id, - institution: account.institution, - mask: account.iban.slice(-4), - iban: account.iban, - name: [account.name, printIban(account)].join(' '), - official_name: account.product, - type: 'checking', - }; - }, + accessValidForDays: 180, /** * Following the GoCardless documentation[0] we should prefer `bookingDate` diff --git a/src/app-gocardless/banks/seb-kort-bank-ab.js b/src/app-gocardless/banks/seb_kort_bank_ab.js similarity index 84% rename from src/app-gocardless/banks/seb-kort-bank-ab.js rename to src/app-gocardless/banks/seb_kort_bank_ab.js index bdb606759..3b465641f 100644 --- a/src/app-gocardless/banks/seb-kort-bank-ab.js +++ b/src/app-gocardless/banks/seb_kort_bank_ab.js @@ -1,6 +1,6 @@ import Fallback from './integration-bank.js'; -import { printIban, amountToInteger } from '../utils.js'; +import { amountToInteger } from '../utils.js'; import { formatPayeeName } from '../../util/payee-name.js'; /** @type {import('./bank.interface.js').IBank} */ @@ -15,18 +15,6 @@ export default { accessValidForDays: 180, - normalizeAccount(account) { - return { - account_id: account.id, - institution: account.institution, - mask: account.iban.slice(-4), - iban: account.iban, - name: [account.name, printIban(account)].join(' '), - official_name: account.product, - type: 'checking', - }; - }, - /** * Sign of transaction amount needs to be flipped for SEB credit cards */ diff --git a/src/app-gocardless/banks/seb-privat.js b/src/app-gocardless/banks/seb_privat.js similarity index 100% rename from src/app-gocardless/banks/seb-privat.js rename to src/app-gocardless/banks/seb_privat.js diff --git a/src/app-gocardless/banks/sparnord-spnodk22.js b/src/app-gocardless/banks/sparnord_spnodk22.js similarity index 100% rename from src/app-gocardless/banks/sparnord-spnodk22.js rename to src/app-gocardless/banks/sparnord_spnodk22.js diff --git a/src/app-gocardless/banks/spk-karlsruhe-karsde66.js b/src/app-gocardless/banks/spk_karlsruhe_karsde66.js similarity index 88% rename from src/app-gocardless/banks/spk-karlsruhe-karsde66.js rename to src/app-gocardless/banks/spk_karlsruhe_karsde66.js index 317d63ec0..9b8e6a215 100644 --- a/src/app-gocardless/banks/spk-karlsruhe-karsde66.js +++ b/src/app-gocardless/banks/spk_karlsruhe_karsde66.js @@ -1,6 +1,6 @@ import Fallback from './integration-bank.js'; -import { printIban, amountToInteger } from '../utils.js'; +import { amountToInteger } from '../utils.js'; import { formatPayeeName } from '../../util/payee-name.js'; /** @type {import('./bank.interface.js').IBank} */ @@ -9,19 +9,7 @@ export default { institutionIds: ['SPK_KARLSRUHE_KARSDE66XXX'], - accessValidForDays: 90, - - normalizeAccount(account) { - return { - account_id: account.id, - institution: account.institution, - mask: account.iban.slice(-4), - iban: account.iban, - name: [account.name, printIban(account)].join(' '), - official_name: account.product, - type: 'checking', - }; - }, + accessValidForDays: 180, /** * Following the GoCardless documentation[0] we should prefer `bookingDate` diff --git a/src/app-gocardless/banks/spk-marburg-biedenkopf-heladef1mar.js b/src/app-gocardless/banks/spk_marburg_biedenkopf_heladef1mar.js similarity index 78% rename from src/app-gocardless/banks/spk-marburg-biedenkopf-heladef1mar.js rename to src/app-gocardless/banks/spk_marburg_biedenkopf_heladef1mar.js index 70615bb76..3491b131b 100644 --- a/src/app-gocardless/banks/spk-marburg-biedenkopf-heladef1mar.js +++ b/src/app-gocardless/banks/spk_marburg_biedenkopf_heladef1mar.js @@ -1,7 +1,7 @@ +import d from 'date-fns'; + import Fallback from './integration-bank.js'; -import d from 'date-fns'; -import { printIban } from '../utils.js'; import { formatPayeeName } from '../../util/payee-name.js'; /** @type {import('./bank.interface.js').IBank} */ @@ -12,20 +12,6 @@ export default { accessValidForDays: 180, - normalizeAccount(account) { - return { - account_id: account.id, - institution: account.institution, - mask: (account?.iban || '0000').slice(-4), - iban: account?.iban || null, - name: [account.product, printIban(account), account.currency] - .filter(Boolean) - .join(' '), - official_name: account.product, - type: 'checking', - }; - }, - normalizeTransaction(transaction, _booked) { const date = transaction.bookingDate || diff --git a/src/app-gocardless/banks/spk-worms-alzey-ried-malade51wor.js b/src/app-gocardless/banks/spk_worms_alzey_ried_malade51wor.js similarity index 96% rename from src/app-gocardless/banks/spk-worms-alzey-ried-malade51wor.js rename to src/app-gocardless/banks/spk_worms_alzey_ried_malade51wor.js index fb45cee0d..0d38a0244 100644 --- a/src/app-gocardless/banks/spk-worms-alzey-ried-malade51wor.js +++ b/src/app-gocardless/banks/spk_worms_alzey_ried_malade51wor.js @@ -8,7 +8,7 @@ export default { institutionIds: ['SPK_WORMS_ALZEY_RIED_MALADE51WOR'], - accessValidForDays: 90, + accessValidForDays: 180, normalizeTransaction(transaction, _booked) { const date = transaction.bookingDate || transaction.valueDate; diff --git a/src/app-gocardless/banks/ssk-dusseldorf-dussdeddxxx.js b/src/app-gocardless/banks/ssk_dusseldorf_dussdeddxxx.js similarity index 97% rename from src/app-gocardless/banks/ssk-dusseldorf-dussdeddxxx.js rename to src/app-gocardless/banks/ssk_dusseldorf_dussdeddxxx.js index 1de9f4848..2e320d366 100644 --- a/src/app-gocardless/banks/ssk-dusseldorf-dussdeddxxx.js +++ b/src/app-gocardless/banks/ssk_dusseldorf_dussdeddxxx.js @@ -6,6 +6,8 @@ export default { institutionIds: ['SSK_DUSSELDORF_DUSSDEDDXXX'], + accessValidForDays: 180, + normalizeTransaction(transaction, _booked) { // Prioritize unstructured information, falling back to structured formats let remittanceInformationUnstructured = diff --git a/src/app-gocardless/banks/swedbank-habalv22.js b/src/app-gocardless/banks/swedbank_habalv22.js similarity index 98% rename from src/app-gocardless/banks/swedbank-habalv22.js rename to src/app-gocardless/banks/swedbank_habalv22.js index 87c745cd1..8bea1360a 100644 --- a/src/app-gocardless/banks/swedbank-habalv22.js +++ b/src/app-gocardless/banks/swedbank_habalv22.js @@ -8,7 +8,7 @@ export default { institutionIds: ['SWEDBANK_HABALV22'], - accessValidForDays: 90, + accessValidForDays: 180, /** * The actual transaction date for card transactions is only available in the remittanceInformationUnstructured field when the transaction is booked. diff --git a/src/app-gocardless/banks/tests/abanca-caglesmm.spec.js b/src/app-gocardless/banks/tests/abanca_caglesmm.spec.js similarity index 95% rename from src/app-gocardless/banks/tests/abanca-caglesmm.spec.js rename to src/app-gocardless/banks/tests/abanca_caglesmm.spec.js index c57961375..3ceb0817c 100644 --- a/src/app-gocardless/banks/tests/abanca-caglesmm.spec.js +++ b/src/app-gocardless/banks/tests/abanca_caglesmm.spec.js @@ -1,4 +1,4 @@ -import Abanca from '../abanca-caglesmm.js'; +import Abanca from '../abanca_caglesmm.js'; import { mockTransactionAmount } from '../../services/tests/fixtures.js'; describe('Abanca', () => { diff --git a/src/app-gocardless/banks/tests/bancsabadell-bsabesbbb.spec.js b/src/app-gocardless/banks/tests/bancsabadell_bsabesbbb.spec.js similarity index 97% rename from src/app-gocardless/banks/tests/bancsabadell-bsabesbbb.spec.js rename to src/app-gocardless/banks/tests/bancsabadell_bsabesbbb.spec.js index 61071084e..1e7cb9140 100644 --- a/src/app-gocardless/banks/tests/bancsabadell-bsabesbbb.spec.js +++ b/src/app-gocardless/banks/tests/bancsabadell_bsabesbbb.spec.js @@ -1,4 +1,4 @@ -import Sabadell from '../bancsabadell-bsabesbbb.js'; +import Sabadell from '../bancsabadell_bsabesbbb.js'; describe('BancSabadell', () => { describe('#normalizeTransaction', () => { diff --git a/src/app-gocardless/banks/tests/easybank-bawaatww.spec.js b/src/app-gocardless/banks/tests/easybank_bawaatww.spec.js similarity index 97% rename from src/app-gocardless/banks/tests/easybank-bawaatww.spec.js rename to src/app-gocardless/banks/tests/easybank_bawaatww.spec.js index 09363b7a4..c55be72a9 100644 --- a/src/app-gocardless/banks/tests/easybank-bawaatww.spec.js +++ b/src/app-gocardless/banks/tests/easybank_bawaatww.spec.js @@ -1,4 +1,4 @@ -import EasybankBawaatww from '../easybank-bawaatww.js'; +import EasybankBawaatww from '../easybank_bawaatww.js'; import { mockTransactionAmount } from '../../services/tests/fixtures.js'; describe('easybank', () => { diff --git a/src/app-gocardless/banks/tests/FORTUNEO_FTNOFRP1XXX.spec.js b/src/app-gocardless/banks/tests/fortuneo_ftnofrp1xxx.spec.js similarity index 99% rename from src/app-gocardless/banks/tests/FORTUNEO_FTNOFRP1XXX.spec.js rename to src/app-gocardless/banks/tests/fortuneo_ftnofrp1xxx.spec.js index 5188699ea..d4a1b30ff 100644 --- a/src/app-gocardless/banks/tests/FORTUNEO_FTNOFRP1XXX.spec.js +++ b/src/app-gocardless/banks/tests/fortuneo_ftnofrp1xxx.spec.js @@ -1,4 +1,4 @@ -import Fortuneo from '../FORTUNEO_FTNOFRP1XXX.js'; +import Fortuneo from '../fortuneo_ftnofrp1xxx.js'; describe('Fortuneo', () => { describe('#normalizeTransaction', () => { diff --git a/src/app-gocardless/banks/tests/ing-ingddeff.spec.js b/src/app-gocardless/banks/tests/ing_ingddeff.spec.js similarity index 99% rename from src/app-gocardless/banks/tests/ing-ingddeff.spec.js rename to src/app-gocardless/banks/tests/ing_ingddeff.spec.js index a3d027c2f..156875bdf 100644 --- a/src/app-gocardless/banks/tests/ing-ingddeff.spec.js +++ b/src/app-gocardless/banks/tests/ing_ingddeff.spec.js @@ -1,4 +1,4 @@ -import IngIngddeff from '../ing-ingddeff.js'; +import IngIngddeff from '../ing_ingddeff.js'; describe('IngIngddeff', () => { describe('#normalizeAccount', () => { @@ -61,7 +61,7 @@ describe('IngIngddeff', () => { transaction_total_days: '390', }, mask: '5030', - name: 'Girokonto (XXX 5030)', + name: 'Girokonto (XXX 5030) EUR', official_name: 'Girokonto', type: 'checking', }); diff --git a/src/app-gocardless/banks/tests/ing-pl-ingbplpw.spec.js b/src/app-gocardless/banks/tests/ing_pl_ingbplpw.spec.js similarity index 98% rename from src/app-gocardless/banks/tests/ing-pl-ingbplpw.spec.js rename to src/app-gocardless/banks/tests/ing_pl_ingbplpw.spec.js index ac8699ef6..a38a61646 100644 --- a/src/app-gocardless/banks/tests/ing-pl-ingbplpw.spec.js +++ b/src/app-gocardless/banks/tests/ing_pl_ingbplpw.spec.js @@ -1,4 +1,4 @@ -import IngPlIngbplpw from '../ing-pl-ingbplpw.js'; +import IngPlIngbplpw from '../ing_pl_ingbplpw.js'; import { mockTransactionAmount } from '../../services/tests/fixtures.js'; describe('IngPlIngbplpw', () => { @@ -66,7 +66,7 @@ describe('IngPlIngbplpw', () => { "transaction_total_days": "365", }, "mask": "4321", - "name": "Current Account for Individuals (Retail) (XXX 4321)", + "name": "Current Account for Individuals (Retail) (XXX 4321) PLN", "official_name": "Current Account for Individuals (Retail)", "type": "checking", } diff --git a/src/app-gocardless/banks/tests/integration-bank.spec.js b/src/app-gocardless/banks/tests/integration_bank.spec.js similarity index 97% rename from src/app-gocardless/banks/tests/integration-bank.spec.js rename to src/app-gocardless/banks/tests/integration_bank.spec.js index f244d00a9..a73da647c 100644 --- a/src/app-gocardless/banks/tests/integration-bank.spec.js +++ b/src/app-gocardless/banks/tests/integration_bank.spec.js @@ -23,7 +23,7 @@ describe('IntegrationBank', () => { mask: '4321', iban: account.iban, name: 'account-example-one (XXX 4321) PLN', - official_name: 'integration-SANDBOXFINANCE_SFIN0000', + official_name: 'Savings Account for Individuals (Retail)', type: 'checking', }); }); @@ -39,7 +39,7 @@ describe('IntegrationBank', () => { mask: '0000', iban: null, name: 'account-example-one PLN', - official_name: 'integration-SANDBOXFINANCE_SFIN0000', + official_name: 'Savings Account for Individuals (Retail)', type: 'checking', }); }); diff --git a/src/app-gocardless/banks/tests/mbank-retail-brexplpw.spec.js b/src/app-gocardless/banks/tests/mbank_retail_brexplpw.spec.js similarity index 97% rename from src/app-gocardless/banks/tests/mbank-retail-brexplpw.spec.js rename to src/app-gocardless/banks/tests/mbank_retail_brexplpw.spec.js index d8212b260..d4113df8f 100644 --- a/src/app-gocardless/banks/tests/mbank-retail-brexplpw.spec.js +++ b/src/app-gocardless/banks/tests/mbank_retail_brexplpw.spec.js @@ -1,4 +1,4 @@ -import MbankRetailBrexplpw from '../mbank-retail-brexplpw.js'; +import MbankRetailBrexplpw from '../mbank_retail_brexplpw.js'; describe('MbankRetailBrexplpw', () => { describe('#normalizeAccount', () => { @@ -65,7 +65,7 @@ describe('MbankRetailBrexplpw', () => { "transaction_total_days": "90", }, "mask": "4321", - "name": "EKONTO (XXX 4321)", + "name": "EKONTO (XXX 4321) PLN", "official_name": "RACHUNEK BIEŻĄCY", "type": "checking", } diff --git a/src/app-gocardless/banks/tests/nationwide-naiagb21.spec.js b/src/app-gocardless/banks/tests/nationwide_naiagb21.spec.js similarity index 98% rename from src/app-gocardless/banks/tests/nationwide-naiagb21.spec.js rename to src/app-gocardless/banks/tests/nationwide_naiagb21.spec.js index 5dc549528..9e95c85f4 100644 --- a/src/app-gocardless/banks/tests/nationwide-naiagb21.spec.js +++ b/src/app-gocardless/banks/tests/nationwide_naiagb21.spec.js @@ -1,4 +1,4 @@ -import Nationwide from '../nationwide-naiagb21.js'; +import Nationwide from '../nationwide_naiagb21.js'; import { mockTransactionAmount } from '../../services/tests/fixtures.js'; describe('Nationwide', () => { diff --git a/src/app-gocardless/banks/tests/sandboxfinance-sfin0000.spec.js b/src/app-gocardless/banks/tests/sandboxfinance_sfin0000.spec.js similarity index 97% rename from src/app-gocardless/banks/tests/sandboxfinance-sfin0000.spec.js rename to src/app-gocardless/banks/tests/sandboxfinance_sfin0000.spec.js index ba705f7e7..a0ac23c1f 100644 --- a/src/app-gocardless/banks/tests/sandboxfinance-sfin0000.spec.js +++ b/src/app-gocardless/banks/tests/sandboxfinance_sfin0000.spec.js @@ -1,4 +1,4 @@ -import SandboxfinanceSfin0000 from '../sandboxfinance-sfin0000.js'; +import SandboxfinanceSfin0000 from '../sandboxfinance_sfin0000.js'; describe('SandboxfinanceSfin0000', () => { describe('#normalizeAccount', () => { @@ -48,7 +48,7 @@ describe('SandboxfinanceSfin0000', () => { "transaction_total_days": "90", }, "mask": "4724", - "name": "Main Account (XXX 4724)", + "name": "Main Account (XXX 4724) EUR", "official_name": "Checkings", "type": "checking", } diff --git a/src/app-gocardless/banks/tests/spk-marburg-biedenkopf-heladef1mar.spec.js b/src/app-gocardless/banks/tests/spk_marburg_biedenkopf_heladef1mar.spec.js similarity index 98% rename from src/app-gocardless/banks/tests/spk-marburg-biedenkopf-heladef1mar.spec.js rename to src/app-gocardless/banks/tests/spk_marburg_biedenkopf_heladef1mar.spec.js index 5641400b2..bf3bf365b 100644 --- a/src/app-gocardless/banks/tests/spk-marburg-biedenkopf-heladef1mar.spec.js +++ b/src/app-gocardless/banks/tests/spk_marburg_biedenkopf_heladef1mar.spec.js @@ -1,4 +1,4 @@ -import SpkMarburgBiedenkopfHeladef1mar from '../spk-marburg-biedenkopf-heladef1mar.js'; +import SpkMarburgBiedenkopfHeladef1mar from '../spk_marburg_biedenkopf_heladef1mar.js'; describe('SpkMarburgBiedenkopfHeladef1mar', () => { describe('#normalizeAccount', () => { diff --git a/src/app-gocardless/banks/tests/swedbank-habalv22.spec.js b/src/app-gocardless/banks/tests/swedbank_habalv22.spec.js similarity index 97% rename from src/app-gocardless/banks/tests/swedbank-habalv22.spec.js rename to src/app-gocardless/banks/tests/swedbank_habalv22.spec.js index 91e2e0121..31673a4eb 100644 --- a/src/app-gocardless/banks/tests/swedbank-habalv22.spec.js +++ b/src/app-gocardless/banks/tests/swedbank_habalv22.spec.js @@ -1,4 +1,4 @@ -import SwedbankHabaLV22 from '../swedbank-habalv22.js'; +import SwedbankHabaLV22 from '../swedbank_habalv22.js'; describe('#normalizeTransaction', () => { const bookedCardTransaction = { diff --git a/src/app-gocardless/banks/virgin_nrnbgb22.js b/src/app-gocardless/banks/virgin_nrnbgb22.js index 7340cdeb1..78418bc2d 100644 --- a/src/app-gocardless/banks/virgin_nrnbgb22.js +++ b/src/app-gocardless/banks/virgin_nrnbgb22.js @@ -6,8 +6,6 @@ export default { institutionIds: ['VIRGIN_NRNBGB22'], - accessValidForDays: 90, - normalizeTransaction(transaction, booked) { const transferPrefixes = ['MOB', 'FPS']; const methodRegex = /^(Card|WLT)\s\d+/; diff --git a/src/app-gocardless/services/tests/gocardless-service.spec.js b/src/app-gocardless/services/tests/gocardless-service.spec.js index 40758ac85..081fc85e0 100644 --- a/src/app-gocardless/services/tests/gocardless-service.spec.js +++ b/src/app-gocardless/services/tests/gocardless-service.spec.js @@ -130,12 +130,12 @@ describe('goCardlessService', () => { expect.objectContaining({ account_id: mockDetailedAccountExample1.id, institution: mockInstitution, - official_name: expect.stringContaining('integration-'), // It comes from IntegrationBank + official_name: 'Savings Account for Individuals (Retail)', }), expect.objectContaining({ account_id: mockDetailedAccountExample2.id, institution: mockInstitution, - official_name: expect.stringContaining('integration-'), // It comes from IntegrationBank + official_name: 'Savings Account for Individuals (Retail)', }), ]), ); diff --git a/upcoming-release-notes/541.md b/upcoming-release-notes/541.md new file mode 100644 index 000000000..56a0e2b54 --- /dev/null +++ b/upcoming-release-notes/541.md @@ -0,0 +1,6 @@ +--- +category: Maintenance +authors: [matt-fidd] +--- + +Standardize GoCardless bank handlers