-
-
Notifications
You must be signed in to change notification settings - Fork 651
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Grab payee name for Abanca gocardless integration (#359)
- Loading branch information
Showing
4 changed files
with
53 additions
and
0 deletions.
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,20 @@ | ||
import Fallback from './integration-bank.js'; | ||
|
||
/** @type {import('./bank.interface.js').IBank} */ | ||
export default { | ||
...Fallback, | ||
|
||
institutionIds: ['ABANCA_CAGLESMM'], | ||
|
||
accessValidForDays: 180, | ||
|
||
// Abanca transactions doesn't get the creditorName/debtorName properly | ||
normalizeTransaction(transaction, _booked) { | ||
return { | ||
...transaction, | ||
creditorName: transaction.remittanceInformationStructured, | ||
debtorName: transaction.remittanceInformationStructured, | ||
date: transaction.bookingDate || transaction.valueDate, | ||
}; | ||
}, | ||
}; |
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,25 @@ | ||
import Abanca from '../abanca-caglesmm.js'; | ||
import { mockTransactionAmount } from '../../services/tests/fixtures.js'; | ||
|
||
describe('Abanca', () => { | ||
describe('#normalizeTransaction', () => { | ||
it('returns the creditorName and debtorName as remittanceInformationStructured', () => { | ||
const transaction = { | ||
transactionId: 'non-unique-id', | ||
internalTransactionId: 'D202301180000003', | ||
transactionAmount: mockTransactionAmount, | ||
remittanceInformationStructured: 'some-creditor-name', | ||
}; | ||
const normalizedTransaction = Abanca.normalizeTransaction( | ||
transaction, | ||
true, | ||
); | ||
expect(normalizedTransaction.creditorName).toEqual( | ||
transaction.remittanceInformationStructured, | ||
); | ||
expect(normalizedTransaction.debtorName).toEqual( | ||
transaction.remittanceInformationStructured, | ||
); | ||
}); | ||
}); | ||
}); |
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: [daca11] | ||
--- | ||
|
||
Get creditorName and debtorName from remittanceInformationStructured for ABANCA_CAGLESMM |