Skip to content

Commit

Permalink
Added GoCardless Integration for ING (Romania) (actualbudget#401)
Browse files Browse the repository at this point in the history
  • Loading branch information
spideraxal authored Jul 18, 2024
1 parent 40e432d commit c19cc56
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/app-gocardless/bank-factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import BankinterBkbkesmm from './banks/bankinter-bkbkesmm.js';
import Belfius from './banks/belfius_gkccbebb.js';
import BnpBeGebabebb from './banks/bnp-be-gebabebb.js';
import DanskeBankDabNO22 from './banks/danskebank-dabno22.js';
import EasybankBawaatww from './banks/easybank-bawaatww.js';
import Fortuneo from './banks/FORTUNEO_FTNOFRP1XXX.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';
Expand All @@ -18,7 +20,6 @@ import SparNordSpNoDK22 from './banks/sparnord-spnodk22.js';
import SpkMarburgBiedenkopfHeladef1mar from './banks/spk-marburg-biedenkopf-heladef1mar.js';
import SpkKarlsruhekarsde66 from './banks/spk-karlsruhe-karsde66.js';
import VirginNrnbgb22 from './banks/virgin_nrnbgb22.js';
import EasybankBawaatww from './banks/easybank-bawaatww.js';

export const banks = [
AbancaCaglesmm,
Expand All @@ -31,6 +32,7 @@ export const banks = [
Fortuneo,
IngIngddeff,
IngPlIngbplpw,
IngIngbrobu,
MbankRetailBrexplpw,
NationwideNaiaGB21,
NorwegianXxNorwnok1,
Expand Down
48 changes: 48 additions & 0 deletions src/app-gocardless/banks/ing-ingbrobu.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import Fallback from './integration-bank.js';

/** @type {import('./bank.interface.js').IBank} */
export default {
...Fallback,

institutionIds: ['ING_INGBROBU'],

accessValidForDays: 180,

normalizeTransaction(transaction, booked) {
//Merchant transactions all have the same transactionId of 'NOTPROVIDED'.
//For booked transactions, this can be set to the internalTransactionId
//For pending transactions, this needs to be removed for them to show up in Actual

//For deduplication to work, payeeName needs to be standardized.
//And converted from a pending transaction form ("payeeName":"Card no: xxxxxxxxxxxx1111"') to a booked transaction form ("payeeName":"Card no: Xxxx Xxxx Xxxx 1111")
if (transaction.transactionId === 'NOTPROVIDED') {
if (booked) {
transaction.transactionId = transaction.internalTransactionId;

if (
transaction.remittanceInformationUnstructured
.toLowerCase()
.includes('card no:')
) {
transaction.creditorName =
transaction.remittanceInformationUnstructured.split(',')[0];
}
} else {
transaction.transactionId = null;
if (
transaction.remittanceInformationUnstructured
.toLowerCase()
.includes('card no:')
) {
transaction.creditorName =
transaction.remittanceInformationUnstructured.replace(
/x{4}/g,
'Xxxx ',
);
}
}
}

return Fallback.normalizeTransaction(transaction, booked);
},
};
6 changes: 6 additions & 0 deletions upcoming-release-notes/401.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Enhancements
authors: [spideraxal]
---

Added GoCardless Integration for ING (Romania)

0 comments on commit c19cc56

Please sign in to comment.