Skip to content

Commit

Permalink
Improve GoCardless adapter for ING (Romania) (#405)
Browse files Browse the repository at this point in the history
* Alphabetical order of banks

* Fix notes field for pendingg transactions

* Release notes fix

---------

Co-authored-by: spideraxal <me@spideraxal.com>
  • Loading branch information
spideraxal and spideraxal authored Aug 1, 2024
1 parent 943f903 commit e3101fb
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/app-gocardless/bank-factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ export const banks = [
DanskeBankDabNO22,
EasybankBawaatww,
Fortuneo,
IngIngbrobu,
IngIngddeff,
IngPlIngbplpw,
IngIngbrobu,
MbankRetailBrexplpw,
NationwideNaiaGB21,
NorwegianXxNorwnok1,
Expand Down
16 changes: 13 additions & 3 deletions src/app-gocardless/banks/ing-ingbrobu.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,22 @@ export default {
//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")
//For deduplication to work better, 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];
//Catch all case for other types of payees
} else {
transaction.creditorName =
transaction.remittanceInformationUnstructured;
}
} else {
transaction.transactionId = null;
Expand All @@ -39,7 +42,14 @@ export default {
/x{4}/g,
'Xxxx ',
);
//Catch all case for other types of payees
} else {
transaction.creditorName =
transaction.remittanceInformationUnstructured;
}
//Remove remittanceInformationUnstructured from pending transactions, so the `notes` field remains empty (there is no merchant information)
//Once booked, the right `notes` (containing the merchant) will be populated
transaction.remittanceInformationUnstructured = null;
}
}

Expand Down
6 changes: 6 additions & 0 deletions upcoming-release-notes/405.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Bugfix
authors: [spideraxal]
---

Modified GoCardless Integration for ING (Romania) so that the `notes` field will be updated once a transaction gets booked.

0 comments on commit e3101fb

Please sign in to comment.