mirror of
https://github.com/actualbudget/actual.git
synced 2026-03-11 20:44:32 -05:00
Grab payee name for Abanca gocardless integration (#359)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import AbancaCaglesmm from './banks/abanca-caglesmm.js';
|
||||
import AmericanExpressAesudef1 from './banks/american-express-aesudef1.js';
|
||||
import BankinterBkbkesmm from './banks/bankinter-bkbkesmm.js';
|
||||
import Belfius from './banks/belfius_gkccbebb.js';
|
||||
@@ -16,6 +17,7 @@ import SpkMarburgBiedenkopfHeladef1mar from './banks/spk-marburg-biedenkopf-hela
|
||||
import SpkKarlsruhekarsde66 from './banks/spk-karlsruhe-karsde66.js';
|
||||
|
||||
export const banks = [
|
||||
AbancaCaglesmm,
|
||||
AmericanExpressAesudef1,
|
||||
BankinterBkbkesmm,
|
||||
Belfius,
|
||||
|
||||
20
src/app-gocardless/banks/abanca-caglesmm.js
Normal file
20
src/app-gocardless/banks/abanca-caglesmm.js
Normal file
@@ -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,
|
||||
};
|
||||
},
|
||||
};
|
||||
25
src/app-gocardless/banks/tests/abanca-caglesmm.spec.js
Normal file
25
src/app-gocardless/banks/tests/abanca-caglesmm.spec.js
Normal file
@@ -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,
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
6
upcoming-release-notes/359.md
Normal file
6
upcoming-release-notes/359.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
category: Enhancements
|
||||
authors: [daca11]
|
||||
---
|
||||
|
||||
Get creditorName and debtorName from remittanceInformationStructured for ABANCA_CAGLESMM
|
||||
Reference in New Issue
Block a user