From 77ad1d7b41f386648e15eac532ab8da1c8065563 Mon Sep 17 00:00:00 2001 From: spideraxal Date: Sat, 4 Jan 2025 16:24:09 +0200 Subject: [PATCH 1/5] Added special corner case --- src/app-gocardless/banks/ing-ingbrobu.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/app-gocardless/banks/ing-ingbrobu.js b/src/app-gocardless/banks/ing-ingbrobu.js index bbf39b6f4..102c6820b 100644 --- a/src/app-gocardless/banks/ing-ingbrobu.js +++ b/src/app-gocardless/banks/ing-ingbrobu.js @@ -18,7 +18,14 @@ export default { if (transaction.transactionId === 'NOTPROVIDED') { if (booked) { transaction.transactionId = transaction.internalTransactionId; + + //Some corner case transactions have a special field called `proprietaryBankTransactionCode`, this need to be copied to `remittanceInformationUnstructured` + if (transaction.proprietaryBankTransactionCode) { + transaction.remittanceInformationUnstructured = + transaction.proprietaryBankTransactionCode; + } if ( + transaction.remittanceInformationUnstructured && transaction.remittanceInformationUnstructured .toLowerCase() .includes('card no:') @@ -32,7 +39,12 @@ export default { } } else { transaction.transactionId = null; + if (transaction.proprietaryBankTransactionCode) { + transaction.remittanceInformationUnstructured = + transaction.proprietaryBankTransactionCode; + } if ( + transaction.remittanceInformationUnstructured && transaction.remittanceInformationUnstructured .toLowerCase() .includes('card no:') From 87f93419b13350521a003ada3a03ea083dd2b875 Mon Sep 17 00:00:00 2001 From: spideraxal Date: Sun, 5 Jan 2025 19:24:04 +0200 Subject: [PATCH 2/5] One additional validation + Release notes --- src/app-gocardless/banks/ing-ingbrobu.js | 11 +++++++++-- upcoming-release-notes/535.md | 6 ++++++ 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 upcoming-release-notes/535.md diff --git a/src/app-gocardless/banks/ing-ingbrobu.js b/src/app-gocardless/banks/ing-ingbrobu.js index 102c6820b..6eecbe1ab 100644 --- a/src/app-gocardless/banks/ing-ingbrobu.js +++ b/src/app-gocardless/banks/ing-ingbrobu.js @@ -20,7 +20,10 @@ export default { transaction.transactionId = transaction.internalTransactionId; //Some corner case transactions have a special field called `proprietaryBankTransactionCode`, this need to be copied to `remittanceInformationUnstructured` - if (transaction.proprietaryBankTransactionCode) { + if ( + transaction.proprietaryBankTransactionCode && + !transaction.remittanceInformationUnstructured + ) { transaction.remittanceInformationUnstructured = transaction.proprietaryBankTransactionCode; } @@ -39,7 +42,11 @@ export default { } } else { transaction.transactionId = null; - if (transaction.proprietaryBankTransactionCode) { + + if ( + transaction.proprietaryBankTransactionCode && + !transaction.remittanceInformationUnstructured + ) { transaction.remittanceInformationUnstructured = transaction.proprietaryBankTransactionCode; } diff --git a/upcoming-release-notes/535.md b/upcoming-release-notes/535.md new file mode 100644 index 000000000..95df93430 --- /dev/null +++ b/upcoming-release-notes/535.md @@ -0,0 +1,6 @@ +--- +category: Bugfix +authors: [spideraxal] +--- + +Add corner case transaction for ING Bank Romania From 7ee1fd2730b4507730816a387ab876bbf88122ae Mon Sep 17 00:00:00 2001 From: spideraxal Date: Tue, 7 Jan 2025 22:51:54 +0200 Subject: [PATCH 3/5] Fixed duplicate code --- src/app-gocardless/banks/ing-ingbrobu.js | 25 +++++++++--------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/src/app-gocardless/banks/ing-ingbrobu.js b/src/app-gocardless/banks/ing-ingbrobu.js index 6eecbe1ab..63ae547b5 100644 --- a/src/app-gocardless/banks/ing-ingbrobu.js +++ b/src/app-gocardless/banks/ing-ingbrobu.js @@ -16,17 +16,17 @@ export default { //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') { + //Some corner case transactions have a special field called `proprietaryBankTransactionCode`, this need to be copied to `remittanceInformationUnstructured` + if ( + transaction.proprietaryBankTransactionCode && + !transaction.remittanceInformationUnstructured + ) { + transaction.remittanceInformationUnstructured = + transaction.proprietaryBankTransactionCode; + } + if (booked) { transaction.transactionId = transaction.internalTransactionId; - - //Some corner case transactions have a special field called `proprietaryBankTransactionCode`, this need to be copied to `remittanceInformationUnstructured` - if ( - transaction.proprietaryBankTransactionCode && - !transaction.remittanceInformationUnstructured - ) { - transaction.remittanceInformationUnstructured = - transaction.proprietaryBankTransactionCode; - } if ( transaction.remittanceInformationUnstructured && transaction.remittanceInformationUnstructured @@ -43,13 +43,6 @@ export default { } else { transaction.transactionId = null; - if ( - transaction.proprietaryBankTransactionCode && - !transaction.remittanceInformationUnstructured - ) { - transaction.remittanceInformationUnstructured = - transaction.proprietaryBankTransactionCode; - } if ( transaction.remittanceInformationUnstructured && transaction.remittanceInformationUnstructured From 5e10971074aafaf26ec826e0ad946f20c2adb5cc Mon Sep 17 00:00:00 2001 From: spideraxal Date: Tue, 7 Jan 2025 22:53:18 +0200 Subject: [PATCH 4/5] Improved comment --- src/app-gocardless/banks/ing-ingbrobu.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app-gocardless/banks/ing-ingbrobu.js b/src/app-gocardless/banks/ing-ingbrobu.js index 63ae547b5..7986fd7b5 100644 --- a/src/app-gocardless/banks/ing-ingbrobu.js +++ b/src/app-gocardless/banks/ing-ingbrobu.js @@ -16,7 +16,7 @@ export default { //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') { - //Some corner case transactions have a special field called `proprietaryBankTransactionCode`, this need to be copied to `remittanceInformationUnstructured` + //Some corner case transactions have the `proprietaryBankTransactionCode` field, this need to be copied to `remittanceInformationUnstructured` if ( transaction.proprietaryBankTransactionCode && !transaction.remittanceInformationUnstructured From 0b2f6b1a4a343188da52c58e2e93ca484b169cd8 Mon Sep 17 00:00:00 2001 From: spideraxal Date: Tue, 7 Jan 2025 22:53:40 +0200 Subject: [PATCH 5/5] Improved comment --- src/app-gocardless/banks/ing-ingbrobu.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app-gocardless/banks/ing-ingbrobu.js b/src/app-gocardless/banks/ing-ingbrobu.js index 7986fd7b5..4f90da51c 100644 --- a/src/app-gocardless/banks/ing-ingbrobu.js +++ b/src/app-gocardless/banks/ing-ingbrobu.js @@ -16,7 +16,7 @@ export default { //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') { - //Some corner case transactions have the `proprietaryBankTransactionCode` field, this need to be copied to `remittanceInformationUnstructured` + //Some corner case transactions only have the `proprietaryBankTransactionCode` field, this need to be copied to `remittanceInformationUnstructured` if ( transaction.proprietaryBankTransactionCode && !transaction.remittanceInformationUnstructured