Skip to content

Commit

Permalink
Use the maximum access validity time provided by GoCardless (#551)
Browse files Browse the repository at this point in the history
* use validForMax supplied by GoCardless

* remove overrides in bank handlers

* note

* update types
  • Loading branch information
matt-fidd authored Jan 15, 2025
1 parent 205ccfe commit 45d53ff
Show file tree
Hide file tree
Showing 46 changed files with 101 additions and 166 deletions.
2 changes: 0 additions & 2 deletions src/app-gocardless/bank-factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import DanskebankDabno22 from './banks/danskebank_dabno22.js';
import EasybankBawaatww from './banks/easybank_bawaatww.js';
import EntercardSwednokk from './banks/entercard_swednokk.js';
import FortuneoFtnofrp1xxx from './banks/fortuneo_ftnofrp1xxx.js';
import HanseaticHstbdehh from './banks/hanseatic_hstbdehh.js';
import HypeHyeeit22 from './banks/hype_hyeeit22.js';
import IngIngbrobu from './banks/ing_ingbrobu.js';
import IngIngddeff from './banks/ing_ingddeff.js';
Expand Down Expand Up @@ -53,7 +52,6 @@ export const banks = [
EasybankBawaatww,
EntercardSwednokk,
FortuneoFtnofrp1xxx,
HanseaticHstbdehh,
HypeHyeeit22,
IngIngbrobu,
IngIngddeff,
Expand Down
2 changes: 0 additions & 2 deletions src/app-gocardless/banks/abanca_caglesmm.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ export default {

institutionIds: ['ABANCA_CAGLESMM', 'ABANCA_CAGLPTPL'],

accessValidForDays: 180,

// Abanca transactions doesn't get the creditorName/debtorName properly
normalizeTransaction(transaction, _booked) {
transaction.creditorName = transaction.remittanceInformationStructured;
Expand Down
2 changes: 0 additions & 2 deletions src/app-gocardless/banks/abnamro_abnanl2a.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ export default {

institutionIds: ['ABNAMRO_ABNANL2A'],

accessValidForDays: 180,

normalizeTransaction(transaction, _booked) {
// There is no remittanceInformationUnstructured, so we'll make it
transaction.remittanceInformationUnstructured =
Expand Down
2 changes: 0 additions & 2 deletions src/app-gocardless/banks/american_express_aesudef1.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ export default {

institutionIds: ['AMERICAN_EXPRESS_AESUDEF1'],

accessValidForDays: 180,

normalizeAccount(account) {
return {
...Fallback.normalizeAccount(account),
Expand Down
2 changes: 0 additions & 2 deletions src/app-gocardless/banks/bancsabadell_bsabesbbb.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ export default {

institutionIds: ['BANCSABADELL_BSABESBB'],

accessValidForDays: 180,

// Sabadell transactions don't get the creditorName/debtorName properly
normalizeTransaction(transaction, _booked) {
const amount = transaction.transactionAmount.amount;
Expand Down
2 changes: 0 additions & 2 deletions src/app-gocardless/banks/bank.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import { Transaction, Balance } from '../gocardless-node.types.js';
export interface IBank {
institutionIds: string[];

accessValidForDays: number;

/**
* Returns normalized object with required data for the frontend
*/
Expand Down
2 changes: 0 additions & 2 deletions src/app-gocardless/banks/bank_of_ireland_b365_bofiie2d.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ export default {

institutionIds: ['BANK_OF_IRELAND_B365_BOFIIE2D'],

accessValidForDays: 180,

normalizeTransaction(transaction, booked) {
transaction.remittanceInformationUnstructured = fixupPayee(
transaction.remittanceInformationUnstructured,
Expand Down
2 changes: 0 additions & 2 deletions src/app-gocardless/banks/bankinter_bkbkesmm.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ export default {

institutionIds: ['BANKINTER_BKBKESMM'],

accessValidForDays: 180,

normalizeTransaction(transaction, _booked) {
transaction.remittanceInformationUnstructured =
transaction.remittanceInformationUnstructured
Expand Down
2 changes: 0 additions & 2 deletions src/app-gocardless/banks/belfius_gkccbebb.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ export default {

institutionIds: ['BELFIUS_GKCCBEBB'],

accessValidForDays: 180,

// The problem is that we have transaction with duplicated transaction ids.
// This is not expected and the nordigen api has a work-around for some backs
// They will set an internalTransactionId which is unique
Expand Down
2 changes: 0 additions & 2 deletions src/app-gocardless/banks/berliner_sparkasse_beladebexxx.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ export default {

institutionIds: ['BERLINER_SPARKASSE_BELADEBEXXX'],

accessValidForDays: 180,

/**
* Following the GoCardless documentation[0] we should prefer `bookingDate`
* here, though some of their bank integrations uses the date field
Expand Down
2 changes: 0 additions & 2 deletions src/app-gocardless/banks/bnp_be_gebabebb.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ export default {
'BNP_BE_GEBABEBB',
],

accessValidForDays: 180,

/** BNP_BE_GEBABEBB provides a lot of useful information via the 'additionalField'
* There does not seem to be a specification of this field, but the following information is contained in its subfields:
* - for pending transactions: the 'atmPosName'
Expand Down
2 changes: 0 additions & 2 deletions src/app-gocardless/banks/cbc_cregbebb.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ export default {

institutionIds: ['CBC_CREGBEBB'],

accessValidForDays: 180,

/**
* For negative amounts, the only payee information we have is returned in
* remittanceInformationUnstructured.
Expand Down
2 changes: 0 additions & 2 deletions src/app-gocardless/banks/danskebank_dabno22.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ export default {

institutionIds: ['DANSKEBANK_DABANO22'],

accessValidForDays: 180,

normalizeTransaction(transaction, _booked) {
/**
* Danske Bank appends the EndToEndID: NOTPROVIDED to
Expand Down
2 changes: 0 additions & 2 deletions src/app-gocardless/banks/easybank_bawaatww.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ export default {

institutionIds: ['EASYBANK_BAWAATWW'],

accessValidForDays: 179,

// If date is same, sort by transactionId
sortTransactions: (transactions = []) =>
transactions.sort((a, b) => {
Expand Down
2 changes: 0 additions & 2 deletions src/app-gocardless/banks/entercard_swednokk.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ export default {

institutionIds: ['ENTERCARD_SWEDNOKK'],

accessValidForDays: 180,

normalizeTransaction(transaction, _booked) {
// GoCardless's Entercard integration returns forex transactions with the
// foreign amount in `transactionAmount`, but at least the amount actually
Expand Down
2 changes: 0 additions & 2 deletions src/app-gocardless/banks/fortuneo_ftnofrp1xxx.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ export default {

institutionIds: ['FORTUNEO_FTNOFRP1XXX'],

accessValidForDays: 180,

normalizeTransaction(transaction, _booked) {
const date =
transaction.bookingDate ||
Expand Down
10 changes: 0 additions & 10 deletions src/app-gocardless/banks/hanseatic_hstbdehh.js

This file was deleted.

2 changes: 0 additions & 2 deletions src/app-gocardless/banks/hype_hyeeit22.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ export default {

institutionIds: ['HYPE_HYEEIT22'],

accessValidForDays: 180,

normalizeTransaction(transaction, _booked) {
/** Online card payments - identified by "crd" transaction code
* always start with PAGAMENTO PRESSO + <payee name>
Expand Down
2 changes: 0 additions & 2 deletions src/app-gocardless/banks/ing_ingbrobu.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ export default {

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
Expand Down
2 changes: 0 additions & 2 deletions src/app-gocardless/banks/ing_ingddeff.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ export default {

institutionIds: ['ING_INGDDEFF'],

accessValidForDays: 180,

normalizeTransaction(transaction, _booked) {
const remittanceInformationMatch = /remittanceinformation:(.*)$/.exec(
transaction.remittanceInformationUnstructured,
Expand Down
2 changes: 0 additions & 2 deletions src/app-gocardless/banks/ing_pl_ingbplpw.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ export default {

institutionIds: ['ING_PL_INGBPLPW'],

accessValidForDays: 180,

normalizeTransaction(transaction, _booked) {
return {
...transaction,
Expand Down
7 changes: 0 additions & 7 deletions src/app-gocardless/banks/integration-bank.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,6 @@ const SORTED_BALANCE_TYPE_LIST = [
export default {
institutionIds: ['IntegrationBank'],

// EEA need to allow at least 180 days now but this doesn't apply to UK
// banks, and it's possible that there are EEA banks which still don't follow
// the new requirements. See:
// - https://nordigen.zendesk.com/hc/en-gb/articles/13239212055581-EEA-180-day-access
// - https://nordigen.zendesk.com/hc/en-gb/articles/6760902653085-Extended-history-and-continuous-access-edge-cases
accessValidForDays: 90,

normalizeAccount(account) {
console.debug(
'Available account properties for new institution integration',
Expand Down
2 changes: 0 additions & 2 deletions src/app-gocardless/banks/isybank_itbbitmm.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ export default {

institutionIds: ['ISYBANK_ITBBITMM'],

accessValidForDays: 180,

// It has been reported that valueDate is more accurate than booking date
// when it is provided
normalizeTransaction(transaction, booked) {
Expand Down
2 changes: 0 additions & 2 deletions src/app-gocardless/banks/kbc_kredbebb.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ export default {

institutionIds: ['KBC_KREDBEBB'],

accessValidForDays: 180,

/**
* For negative amounts, the only payee information we have is returned in
* remittanceInformationUnstructured.
Expand Down
2 changes: 0 additions & 2 deletions src/app-gocardless/banks/mbank_retail_brexplpw.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ export default {

institutionIds: ['MBANK_RETAIL_BREXPLPW'],

accessValidForDays: 179,

normalizeTransaction(transaction, _booked) {
return {
...transaction,
Expand Down
2 changes: 0 additions & 2 deletions src/app-gocardless/banks/nbg_ethngraaxxx.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ export default {

institutionIds: ['NBG_ETHNGRAAXXX'],

accessValidForDays: 180,

/**
* Fixes for the pending transactions:
* - Corrects amount to negative (nbg erroneously omits the minus sign in pending transactions)
Expand Down
2 changes: 0 additions & 2 deletions src/app-gocardless/banks/norwegian_xx_norwnok1.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ export default {
'NORWEGIAN_FI_NORWNOK1',
],

accessValidForDays: 180,

normalizeTransaction(transaction, booked) {
if (booked) {
return {
Expand Down
2 changes: 0 additions & 2 deletions src/app-gocardless/banks/revolut_revolt21.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ export default {

institutionIds: ['REVOLUT_REVOLT21'],

accessValidForDays: 180,

normalizeTransaction(transaction, _booked) {
if (
transaction.remittanceInformationUnstructuredArray[0].startsWith(
Expand Down
2 changes: 0 additions & 2 deletions src/app-gocardless/banks/sandboxfinance_sfin0000.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ export default {

institutionIds: ['SANDBOXFINANCE_SFIN0000'],

accessValidForDays: 180,

/**
* Following the GoCardless documentation[0] we should prefer `bookingDate`
* here, though some of their bank integrations uses the date field
Expand Down
2 changes: 0 additions & 2 deletions src/app-gocardless/banks/seb_kort_bank_ab.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ export default {
'SEB_CARD_ESSESESS',
],

accessValidForDays: 180,

/**
* Sign of transaction amount needs to be flipped for SEB credit cards
*/
Expand Down
2 changes: 0 additions & 2 deletions src/app-gocardless/banks/seb_privat.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ export default {

institutionIds: ['SEB_ESSESESS_PRIVATE'],

accessValidForDays: 180,

normalizeTransaction(transaction, _booked) {
const date =
transaction.bookingDate ||
Expand Down
2 changes: 0 additions & 2 deletions src/app-gocardless/banks/sparnord_spnodk22.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ export default {
'ANDELSKASSEN_FALLESKASSEN_FAELDKK1',
],

accessValidForDays: 180,

/**
* Banks on the BEC backend only give information regarding the transaction in additionalInformation
*/
Expand Down
2 changes: 0 additions & 2 deletions src/app-gocardless/banks/spk_karlsruhe_karsde66.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ export default {

institutionIds: ['SPK_KARLSRUHE_KARSDE66XXX'],

accessValidForDays: 180,

/**
* Following the GoCardless documentation[0] we should prefer `bookingDate`
* here, though some of their bank integrations uses the date field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ export default {

institutionIds: ['SPK_MARBURG_BIEDENKOPF_HELADEF1MAR'],

accessValidForDays: 180,

normalizeTransaction(transaction, _booked) {
const date =
transaction.bookingDate ||
Expand Down
2 changes: 0 additions & 2 deletions src/app-gocardless/banks/spk_worms_alzey_ried_malade51wor.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ export default {

institutionIds: ['SPK_WORMS_ALZEY_RIED_MALADE51WOR'],

accessValidForDays: 180,

normalizeTransaction(transaction, _booked) {
const date = transaction.bookingDate || transaction.valueDate;
if (!date) {
Expand Down
2 changes: 0 additions & 2 deletions src/app-gocardless/banks/ssk_dusseldorf_dussdeddxxx.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ export default {

institutionIds: ['SSK_DUSSELDORF_DUSSDEDDXXX'],

accessValidForDays: 180,

normalizeTransaction(transaction, _booked) {
// Prioritize unstructured information, falling back to structured formats
let remittanceInformationUnstructured =
Expand Down
2 changes: 0 additions & 2 deletions src/app-gocardless/banks/swedbank_habalv22.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ export default {

institutionIds: ['SWEDBANK_HABALV22'],

accessValidForDays: 180,

/**
* The actual transaction date for card transactions is only available in the remittanceInformationUnstructured field when the transaction is booked.
*/
Expand Down
2 changes: 2 additions & 0 deletions src/app-gocardless/banks/tests/ing_ingddeff.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ describe('IngIngddeff', () => {
name: 'ING',
bic: 'INGDDEFFXXX',
transaction_total_days: '390',
max_access_valid_for_days: '90',
countries: ['DE'],
logo: 'https://storage.googleapis.com/gc-prd-institution_icons-production/DE/PNG/ing.png',
supported_payments: {
Expand Down Expand Up @@ -59,6 +60,7 @@ describe('IngIngddeff', () => {
'single-payment': ['SCT'],
},
transaction_total_days: '390',
max_access_valid_for_days: '90',
},
mask: '5030',
name: 'Girokonto (XXX 5030) EUR',
Expand Down
Loading

0 comments on commit 45d53ff

Please sign in to comment.