-
-
Notifications
You must be signed in to change notification settings - Fork 681
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ✨ add bank adapter for BOI * Remove console log
- Loading branch information
1 parent
e6ed450
commit 0637b1d
Showing
3 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
category: Enhancements | ||
authors: [MatissJanis] | ||
--- | ||
|
||
Add GoCardless formatter for `BANK_OF_IRELAND_B365_BOFIIE2D` Bank of Ireland. |