Skip to content
This repository has been archived by the owner on Feb 10, 2025. It is now read-only.

Commit

Permalink
update types
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-fidd committed Jan 14, 2025
1 parent e99ac69 commit 59c965e
Show file tree
Hide file tree
Showing 8 changed files with 94 additions and 78 deletions.
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
58 changes: 30 additions & 28 deletions src/app-gocardless/banks/tests/ing_pl_ingbplpw.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ describe('IngPlIngbplpw', () => {
name: 'ING',
bic: 'INGBPLPW',
transaction_total_days: '365',
max_access_valid_for_days: '90',
countries: ['PL'],
logo: 'https://cdn.nordigen.com/ais/ING_PL_INGBPLPW.png',
supported_payments: {},
Expand All @@ -43,34 +44,35 @@ describe('IngPlIngbplpw', () => {
it('returns normalized account data returned to Frontend', () => {
const normalizedAccount = IngPlIngbplpw.normalizeAccount(accountRaw);
expect(normalizedAccount).toMatchInlineSnapshot(`
{
"account_id": "d3eccc94-9536-48d3-98be-813f79199ee3",
"iban": "PL00000000000000000987654321",
"institution": {
"bic": "INGBPLPW",
"countries": [
"PL",
],
"id": "ING_PL_INGBPLPW",
"logo": "https://cdn.nordigen.com/ais/ING_PL_INGBPLPW.png",
"name": "ING",
"supported_features": [
"access_scopes",
"business_accounts",
"card_accounts",
"corporate_accounts",
"pending_transactions",
"private_accounts",
],
"supported_payments": {},
"transaction_total_days": "365",
},
"mask": "4321",
"name": "Current Account for Individuals (Retail) (XXX 4321) PLN",
"official_name": "Current Account for Individuals (Retail)",
"type": "checking",
}
`);
{
"account_id": "d3eccc94-9536-48d3-98be-813f79199ee3",
"iban": "PL00000000000000000987654321",
"institution": {
"bic": "INGBPLPW",
"countries": [
"PL",
],
"id": "ING_PL_INGBPLPW",
"logo": "https://cdn.nordigen.com/ais/ING_PL_INGBPLPW.png",
"max_access_valid_for_days": "90",
"name": "ING",
"supported_features": [
"access_scopes",
"business_accounts",
"card_accounts",
"corporate_accounts",
"pending_transactions",
"private_accounts",
],
"supported_payments": {},
"transaction_total_days": "365",
},
"mask": "4321",
"name": "Current Account for Individuals (Retail) (XXX 4321) PLN",
"official_name": "Current Account for Individuals (Retail)",
"type": "checking",
}
`);
});
});

Expand Down
58 changes: 30 additions & 28 deletions src/app-gocardless/banks/tests/mbank_retail_brexplpw.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ describe('MbankRetailBrexplpw', () => {
name: 'mBank Retail',
bic: 'BREXPLPW',
transaction_total_days: '90',
max_access_valid_for_days: '90',
countries: ['PL'],
logo: 'https://cdn.nordigen.com/ais/MBANK_RETAIL_BREXCZPP.png',
supported_payments: {},
Expand All @@ -42,34 +43,35 @@ describe('MbankRetailBrexplpw', () => {
it('returns normalized account data returned to Frontend', () => {
expect(MbankRetailBrexplpw.normalizeAccount(accountRaw))
.toMatchInlineSnapshot(`
{
"account_id": "d3eccc94-9536-48d3-98be-813f79199ee3",
"iban": "PL00000000000000000987654321",
"institution": {
"bic": "BREXPLPW",
"countries": [
"PL",
],
"id": "MBANK_RETAIL_BREXPLPW",
"logo": "https://cdn.nordigen.com/ais/MBANK_RETAIL_BREXCZPP.png",
"name": "mBank Retail",
"supported_features": [
"access_scopes",
"business_accounts",
"card_accounts",
"corporate_accounts",
"pending_transactions",
"private_accounts",
],
"supported_payments": {},
"transaction_total_days": "90",
},
"mask": "4321",
"name": "EKONTO (XXX 4321) PLN",
"official_name": "RACHUNEK BIEŻĄCY",
"type": "checking",
}
`);
{
"account_id": "d3eccc94-9536-48d3-98be-813f79199ee3",
"iban": "PL00000000000000000987654321",
"institution": {
"bic": "BREXPLPW",
"countries": [
"PL",
],
"id": "MBANK_RETAIL_BREXPLPW",
"logo": "https://cdn.nordigen.com/ais/MBANK_RETAIL_BREXCZPP.png",
"max_access_valid_for_days": "90",
"name": "mBank Retail",
"supported_features": [
"access_scopes",
"business_accounts",
"card_accounts",
"corporate_accounts",
"pending_transactions",
"private_accounts",
],
"supported_payments": {},
"transaction_total_days": "90",
},
"mask": "4321",
"name": "EKONTO (XXX 4321) PLN",
"official_name": "RACHUNEK BIEŻĄCY",
"type": "checking",
}
`);
});
});

Expand Down
44 changes: 23 additions & 21 deletions src/app-gocardless/banks/tests/sandboxfinance_sfin0000.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ describe('SandboxfinanceSfin0000', () => {
name: 'Sandbox Finance',
bic: 'SFIN0000',
transaction_total_days: '90',
max_access_valid_for_days: '90',
countries: ['XX'],
logo: 'https://cdn.nordigen.com/ais/SANDBOXFINANCE_SFIN0000.png',
supported_payments: {},
Expand All @@ -32,27 +33,28 @@ describe('SandboxfinanceSfin0000', () => {
it('returns normalized account data returned to Frontend', () => {
expect(SandboxfinanceSfin0000.normalizeAccount(accountRaw))
.toMatchInlineSnapshot(`
{
"account_id": "99a0bfe2-0bef-46df-bff2-e9ae0c6c5838",
"iban": "GL0865354374424724",
"institution": {
"bic": "SFIN0000",
"countries": [
"XX",
],
"id": "SANDBOXFINANCE_SFIN0000",
"logo": "https://cdn.nordigen.com/ais/SANDBOXFINANCE_SFIN0000.png",
"name": "Sandbox Finance",
"supported_features": [],
"supported_payments": {},
"transaction_total_days": "90",
},
"mask": "4724",
"name": "Main Account (XXX 4724) EUR",
"official_name": "Checkings",
"type": "checking",
}
`);
{
"account_id": "99a0bfe2-0bef-46df-bff2-e9ae0c6c5838",
"iban": "GL0865354374424724",
"institution": {
"bic": "SFIN0000",
"countries": [
"XX",
],
"id": "SANDBOXFINANCE_SFIN0000",
"logo": "https://cdn.nordigen.com/ais/SANDBOXFINANCE_SFIN0000.png",
"max_access_valid_for_days": "90",
"name": "Sandbox Finance",
"supported_features": [],
"supported_payments": {},
"transaction_total_days": "90",
},
"mask": "4724",
"name": "Main Account (XXX 4724) EUR",
"official_name": "Checkings",
"type": "checking",
}
`);
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ describe('SpkMarburgBiedenkopfHeladef1mar', () => {
name: 'Sparkasse Marburg-Biedenkopf',
bic: 'HELADEF1MAR',
transaction_total_days: '360',
max_access_valid_for_days: '90',
countries: ['DE'],
logo: 'https://storage.googleapis.com/gc-prd-institution_icons-production/DE/PNG/sparkasse.png',
supported_payments: {
Expand Down Expand Up @@ -57,6 +58,7 @@ describe('SpkMarburgBiedenkopfHeladef1mar', () => {
'single-payment': ['SCT', 'ISCT'],
},
transaction_total_days: '360',
max_access_valid_for_days: '90',
},
mask: '6789',
name: 'Sichteinlagen (XXX 6789) EUR',
Expand Down
6 changes: 6 additions & 0 deletions src/app-gocardless/gocardless-node.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,12 @@ export type Institution = {
*/
logo: string;

/**
* The total number of days that a requisition stays valid before requiring
* renewal
*/
max_access_valid_for_days: string;

supported_payments?: object;
supported_features?: string[];
};
Expand Down
1 change: 0 additions & 1 deletion src/app-gocardless/services/gocardless-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,6 @@ export const goCardlessService = {
await goCardlessService.setToken();

const institution = await goCardlessService.getInstitution(institutionId);
const bank = BankFactory(institutionId);

let response;
try {
Expand Down
1 change: 1 addition & 0 deletions src/app-gocardless/services/tests/fixtures.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ export const mockInstitution = {
name: 'N26 Bank',
bic: 'NTSBDEB1',
transaction_total_days: '90',
max_access_valid_for_days: '90',
countries: ['GB', 'NO', 'SE'],
logo: 'https://cdn.nordigen.com/ais/N26_SANDBOX_NTSBDEB1.png',
};
Expand Down

0 comments on commit 59c965e

Please sign in to comment.