Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added GoCardless Integration for ING (Romania) #401

Merged
merged 2 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)