-
-
Notifications
You must be signed in to change notification settings - Fork 650
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added GoCardless Integration for ING (Romania) (#401)
- Loading branch information
1 parent
40e432d
commit c19cc56
Showing
3 changed files
with
57 additions
and
1 deletion.
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,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); | ||
}, | ||
}; |
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: [spideraxal] | ||
--- | ||
|
||
Added GoCardless Integration for ING (Romania) |