add bank adapter for BOI (#539)

*  add bank adapter for BOI

* Remove console log
This commit is contained in:
Matiss Janis Aboltins
2025-01-07 21:30:48 +00:00
committed by GitHub
parent e6ed4505b3
commit 0637b1d5f8
3 changed files with 45 additions and 0 deletions

View File

@@ -3,6 +3,7 @@ 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';
@@ -41,6 +42,7 @@ export const banks = [
AmericanExpressAesudef1,
BancsabadellBsabesbb,
BankinterBkbkesmm,
BankOfIrelandB365,
Belfius,
Berliner_Sparkasse_beladebexxx,
BnpBeGebabebb,

View File

@@ -0,0 +1,37 @@
import Fallback from './integration-bank.js';
/** @type {import('./bank.interface.js').IBank} */
export default {
...Fallback,
institutionIds: ['BANK_OF_IRELAND_B365_BOFIIE2D'],
normalizeTransaction(transaction, booked) {
transaction.remittanceInformationUnstructured = fixupPayee(
transaction.remittanceInformationUnstructured,
);
return Fallback.normalizeTransaction(transaction, booked);
},
};
function fixupPayee(/** @type {string} */ payee) {
let fixedPayee = payee;
// remove all duplicate whitespace
fixedPayee = fixedPayee.replace(/\s+/g, ' ').trim();
// remove date prefix
fixedPayee = fixedPayee.replace(/^(POS)?(C)?[0-9]{1,2}\w{3}/, '').trim();
// remove direct debit postfix
fixedPayee = fixedPayee.replace(/sepa dd$/i, '').trim();
// remove bank transfer prefix
fixedPayee = fixedPayee.replace(/^365 online/i, '').trim();
// remove curve card prefix
fixedPayee = fixedPayee.replace(/^CRV\*/, '').trim();
return fixedPayee;
}

View File

@@ -0,0 +1,6 @@
---
category: Enhancements
authors: [MatissJanis]
---
Add GoCardless formatter for `BANK_OF_IRELAND_B365_BOFIIE2D` Bank of Ireland.