Skip to content

A local-first personal finance app

:recycle: (Nordigen) rename to GoCardless (#1361)

Matiss Janis Aboltins63d48032c583
diff --git a/packages/desktop-client/src/components/FinancesApp.js b/packages/desktop-client/src/components/FinancesApp.js
index f165766f75..bc098f9fca 100644
--- a/packages/desktop-client/src/components/FinancesApp.js
+++ b/packages/desktop-client/src/components/FinancesApp.js
@@ -40,9 +40,9 @@ import MobileBudget from './budget/MobileBudget';
import { View } from './common';
import FloatableSidebar, { SidebarProvider } from './FloatableSidebar';
import GlobalKeys from './GlobalKeys';
+import GoCardlessLink from './gocardless/GoCardlessLink';
import { ManageRulesPage } from './ManageRulesPage';
import Modals from './Modals';
-import NordigenLink from './nordigen/NordigenLink';
import Notifications from './Notifications';
import { ManagePayeesPage } from './payees/ManagePayeesPage';
import Reports from './reports';
@@ -135,11 +135,21 @@ function StackedRoutesInner({ location }) {
<Route path="/payees" element={<ManagePayeesPage />} />
<Route path="/rules" element={<ManageRulesPage />} />
<Route path="/settings" element={<Settings />} />
+
+ {/* TODO: remove Nordigen route after v23.8.0 */}
<Route
path="/nordigen/link"
element={
<NarrowNotSupported>
- <NordigenLink />
+ <GoCardlessLink />
+ </NarrowNotSupported>
+ }
+ />
+ <Route
+ path="/gocardless/link"
+ element={
+ <NarrowNotSupported>
+ <GoCardlessLink />
</NarrowNotSupported>
}
/>
diff --git a/packages/desktop-client/src/components/Modals.tsx b/packages/desktop-client/src/components/Modals.tsx
index b26cc34ef9..1934a56237 100644
--- a/packages/desktop-client/src/components/Modals.tsx
+++ b/packages/desktop-client/src/components/Modals.tsx
@@ -15,12 +15,12 @@ import CreateLocalAccount from './modals/CreateLocalAccount';
import EditField from './modals/EditField';
import EditRule from './modals/EditRule';
import FixEncryptionKey from './modals/FixEncryptionKey';
+import GoCardlessExternalMsg from './modals/GoCardlessExternalMsg';
+import GoCardlessInitialise from './modals/GoCardlessInitialise';
import ImportTransactions from './modals/ImportTransactions';
import LoadBackup from './modals/LoadBackup';
import ManageRulesModal from './modals/ManageRulesModal';
import MergeUnusedPayees from './modals/MergeUnusedPayees';
-import NordigenExternalMsg from './modals/NordigenExternalMsg';
-import NordigenInitialise from './modals/NordigenInitialise';
import PlaidExternalMsg from './modals/PlaidExternalMsg';
import SelectLinkedAccounts from './modals/SelectLinkedAccounts';
@@ -158,22 +158,22 @@ export default function Modals() {
/>
);
- case 'nordigen-init':
+ case 'gocardless-init':
return (
- <NordigenInitialise
+ <GoCardlessInitialise
modalProps={modalProps}
onSuccess={options.onSuccess}
/>
);
- case 'nordigen-external-msg':
+ case 'gocardless-external-msg':
return (
- <NordigenExternalMsg
+ <GoCardlessExternalMsg
modalProps={modalProps}
onMoveExternal={options.onMoveExternal}
onClose={() => {
options.onClose?.();
- send('nordigen-poll-web-token-stop');
+ send('gocardless-poll-web-token-stop');
}}
onSuccess={options.onSuccess}
/>
diff --git a/packages/desktop-client/src/components/accounts/Account.js b/packages/desktop-client/src/components/accounts/Account.js
index 040b8da552..e20366d8da 100644
--- a/packages/desktop-client/src/components/accounts/Account.js
+++ b/packages/desktop-client/src/components/accounts/Account.js
@@ -24,8 +24,8 @@ import {
} from 'loot-core/src/shared/transactions';
import { applyChanges, groupById } from 'loot-core/src/shared/util';
+import { authorizeBank } from '../../gocardless';
import { SelectedProviderWithItems } from '../../hooks/useSelected';
-import { authorizeBank } from '../../nordigen';
import { styles, colors } from '../../style';
import { useActiveLocation } from '../ActiveLocation';
import { View, Text, Button } from '../common';
diff --git a/packages/desktop-client/src/components/accounts/AccountSyncCheck.js b/packages/desktop-client/src/components/accounts/AccountSyncCheck.js
index 164d0f2c36..b9f97679d0 100644
--- a/packages/desktop-client/src/components/accounts/AccountSyncCheck.js
+++ b/packages/desktop-client/src/components/accounts/AccountSyncCheck.js
@@ -4,8 +4,8 @@ import { useParams } from 'react-router-dom';
import * as actions from 'loot-core/src/client/actions';
+import { authorizeBank } from '../../gocardless';
import ExclamationOutline from '../../icons/v1/ExclamationOutline';
-import { authorizeBank } from '../../nordigen';
import { colors } from '../../style';
import { View, Button, Tooltip, ExternalLink } from '../common';
diff --git a/packages/desktop-client/src/components/nordigen/NordigenLink.js b/packages/desktop-client/src/components/gocardless/GoCardlessLink.js
similarity index 91%
rename from packages/desktop-client/src/components/nordigen/NordigenLink.js
rename to packages/desktop-client/src/components/gocardless/GoCardlessLink.js
index 82d60ff048..4f2cfe57d6 100644
--- a/packages/desktop-client/src/components/nordigen/NordigenLink.js
+++ b/packages/desktop-client/src/components/gocardless/GoCardlessLink.js
@@ -2,7 +2,7 @@ import React from 'react';
import { Modal, P, View } from '../common';
-export default function NordigenLink() {
+export default function GoCardlessLink() {
window.close();
return (
diff --git a/packages/desktop-client/src/components/modals/CreateAccount.js b/packages/desktop-client/src/components/modals/CreateAccount.js
index 86cf1bee2a..322fa12e4a 100644
--- a/packages/desktop-client/src/components/modals/CreateAccount.js
+++ b/packages/desktop-client/src/components/modals/CreateAccount.js
@@ -3,8 +3,8 @@ import { useDispatch } from 'react-redux';
import { pushModal } from 'loot-core/src/client/actions/modals';
-import useNordigenStatus from '../../hooks/useNordigenStatus';
-import { authorizeBank } from '../../nordigen';
+import { authorizeBank } from '../../gocardless';
+import useGoCardlessStatus from '../../hooks/useGoCardlessStatus';
import {
View,
Text,
@@ -17,21 +17,22 @@ import {
export default function CreateAccount({ modalProps, syncServerStatus }) {
const dispatch = useDispatch();
- const [isNordigenSetupComplete, setIsNordigenSetupComplete] = useState(null);
+ const [isGoCardlessSetupComplete, setIsGoCardlessSetupComplete] =
+ useState(null);
const onConnect = () => {
- if (!isNordigenSetupComplete) {
- onNordigenInit();
+ if (!isGoCardlessSetupComplete) {
+ onGoCardlessInit();
return;
}
authorizeBank((modal, params) => dispatch(pushModal(modal, params)));
};
- const onNordigenInit = () => {
+ const onGoCardlessInit = () => {
dispatch(
- pushModal('nordigen-init', {
- onSuccess: () => setIsNordigenSetupComplete(true),
+ pushModal('gocardless-init', {
+ onSuccess: () => setIsGoCardlessSetupComplete(true),
}),
);
};
@@ -40,9 +41,9 @@ export default function CreateAccount({ modalProps, syncServerStatus }) {
dispatch(pushModal('add-local-account'));
};
- const { configured } = useNordigenStatus();
+ const { configured } = useGoCardlessStatus();
useEffect(() => {
- setIsNordigenSetupComplete(configured);
+ setIsGoCardlessSetupComplete(configured);
}, [configured]);
return (
@@ -88,13 +89,13 @@ export default function CreateAccount({ modalProps, syncServerStatus }) {
}}
onClick={onConnect}
>
- {isNordigenSetupComplete
- ? 'Link bank account with Nordigen'
- : 'Set up Nordigen for bank sync'}
+ {isGoCardlessSetupComplete
+ ? 'Link bank account with GoCardless'
+ : 'Set up GoCardless for bank sync'}
</ButtonWithLoading>
<Text style={{ lineHeight: '1.4em', fontSize: 15 }}>
<strong>Link a bank account</strong> to automatically download
- transactions. Nordigen provides reliable, up-to-date
+ transactions. GoCardless provides reliable, up-to-date
information from hundreds of banks.
</Text>
</>
@@ -108,7 +109,7 @@ export default function CreateAccount({ modalProps, syncServerStatus }) {
fontWeight: 600,
}}
>
- Set up Nordigen for bank sync
+ Set up GoCardless for bank sync
</Button>
<P style={{ fontSize: 15 }}>
Connect to an Actual server to set up{' '}
@@ -116,7 +117,7 @@ export default function CreateAccount({ modalProps, syncServerStatus }) {
to="https://actualbudget.org/docs/advanced/bank-sync"
linkColor="muted"
>
- automatic syncing with Nordigen
+ automatic syncing with GoCardless
</ExternalLink>
.
</P>
diff --git a/packages/desktop-client/src/components/modals/NordigenExternalMsg.js b/packages/desktop-client/src/components/modals/GoCardlessExternalMsg.js
similarity index 83%
rename from packages/desktop-client/src/components/modals/NordigenExternalMsg.js
rename to packages/desktop-client/src/components/modals/GoCardlessExternalMsg.js
index b2d1737ed0..5bf4674d24 100644
--- a/packages/desktop-client/src/components/modals/NordigenExternalMsg.js
+++ b/packages/desktop-client/src/components/modals/GoCardlessExternalMsg.js
@@ -4,7 +4,7 @@ import { useDispatch } from 'react-redux';
import { pushModal } from 'loot-core/src/client/actions/modals';
import { sendCatch } from 'loot-core/src/platform/client/fetch';
-import useNordigenStatus from '../../hooks/useNordigenStatus';
+import useGoCardlessStatus from '../../hooks/useGoCardlessStatus';
import AnimatedLoading from '../../icons/AnimatedLoading';
import DotsHorizontalTriple from '../../icons/v1/DotsHorizontalTriple';
import { colors } from '../../style';
@@ -41,7 +41,7 @@ function useAvailableBanks(country) {
setIsLoading(true);
- const { data, error } = await sendCatch('nordigen-get-banks', country);
+ const { data, error } = await sendCatch('gocardless-get-banks', country);
if (error) {
setIsError(true);
@@ -73,7 +73,7 @@ function renderError(error) {
);
}
-export default function NordigenExternalMsg({
+export default function GoCardlessExternalMsg({
modalProps,
onMoveExternal,
onSuccess,
@@ -86,7 +86,8 @@ export default function NordigenExternalMsg({
let [institutionId, setInstitutionId] = useState();
let [country, setCountry] = useState();
let [error, setError] = useState(null);
- let [isNordigenSetupComplete, setIsNordigenSetupComplete] = useState(null);
+ let [isGoCardlessSetupComplete, setIsGoCardlessSetupComplete] =
+ useState(null);
let [menuOpen, setMenuOpen] = useState(false);
let data = useRef(null);
@@ -96,7 +97,7 @@ export default function NordigenExternalMsg({
isError: isBankOptionError,
} = useAvailableBanks(country);
const { configured: isConfigured, isLoading: isConfigurationLoading } =
- useNordigenStatus();
+ useGoCardlessStatus();
async function onJump() {
setError(null);
@@ -125,10 +126,10 @@ export default function NordigenExternalMsg({
setWaiting(null);
}
- const onNordigenInit = () => {
+ const onGoCardlessInit = () => {
dispatch(
- pushModal('nordigen-init', {
- onSuccess: () => setIsNordigenSetupComplete(true),
+ pushModal('gocardless-init', {
+ onSuccess: () => setIsGoCardlessSetupComplete(true),
}),
);
};
@@ -151,10 +152,10 @@ export default function NordigenExternalMsg({
{isBankOptionError ? (
<Error>
- Failed loading available banks: Nordigen access credentials might be
- misconfigured. Please{' '}
+ Failed loading available banks: GoCardless access credentials might
+ be misconfigured. Please{' '}
<LinkButton
- onClick={onNordigenInit}
+ onClick={onGoCardlessInit}
style={{ color: colors.b3, display: 'inline' }}
>
set them up
@@ -185,17 +186,13 @@ export default function NordigenExternalMsg({
)}
<Warning>
- By enabling bank-sync, you will be granting Nordigen (a third party
+ By enabling bank-sync, you will be granting GoCardless (a third party
service) read-only access to your entire account’s transaction
history. This service is not affiliated with Actual in any way. Make
- sure you’ve read and understand Nordigen’s{' '}
- <ExternalLink to="https://nordigen.com/en/company/privacy-policy/">
+ sure you’ve read and understand GoCardless’s{' '}
+ <ExternalLink to="https://gocardless.com/privacy/">
Privacy Policy
</ExternalLink>{' '}
- and{' '}
- <ExternalLink to="https://nordigen.com/en/company/privacy-policy-end-user/">
- End User Privacy Policy
- </ExternalLink>{' '}
before proceeding.
</Warning>
@@ -229,7 +226,7 @@ export default function NordigenExternalMsg({
<Menu
onMenuSelect={item => {
if (item === 'reconfigure') {
- onNordigenInit();
+ onGoCardlessInit();
}
}}
items={[
@@ -258,8 +255,8 @@ export default function NordigenExternalMsg({
<View>
<P style={{ fontSize: 15 }}>
To link your bank account, you will be redirected to a new page
- where Nordigen will ask to connect to your bank. Nordigen will not
- be able to withdraw funds from your accounts.
+ where GoCardless will ask to connect to your bank. GoCardless will
+ not be able to withdraw funds from your accounts.
</P>
{error && renderError(error)}
@@ -272,9 +269,9 @@ export default function NordigenExternalMsg({
/>
<View style={{ marginTop: 10, color: colors.n4 }}>
{isConfigurationLoading
- ? 'Checking Nordigen configuration..'
+ ? 'Checking GoCardless configuration..'
: waiting === 'browser'
- ? 'Waiting on Nordigen...'
+ ? 'Waiting on GoCardless...'
: waiting === 'accounts'
? 'Loading accounts...'
: null}
@@ -301,15 +298,15 @@ export default function NordigenExternalMsg({
>
Success! Click to continue &rarr;
</Button>
- ) : isConfigured || isNordigenSetupComplete ? (
+ ) : isConfigured || isGoCardlessSetupComplete ? (
renderLinkButton()
) : (
<>
<P style={{ color: colors.r5 }}>
- Nordigen integration has not yet been configured.
+ GoCardless integration has not yet been configured.
</P>
- <Button primary onClick={onNordigenInit}>
- Configure Nordigen integration
+ <Button primary onClick={onGoCardlessInit}>
+ Configure GoCardless integration
</Button>
</>
)}
diff --git a/packages/desktop-client/src/components/modals/NordigenInitialise.tsx b/packages/desktop-client/src/components/modals/GoCardlessInitialise.tsx
similarity index 82%
rename from packages/desktop-client/src/components/modals/NordigenInitialise.tsx
rename to packages/desktop-client/src/components/modals/GoCardlessInitialise.tsx
index c67f01e787..06612ae1d0 100644
--- a/packages/desktop-client/src/components/modals/NordigenInitialise.tsx
+++ b/packages/desktop-client/src/components/modals/GoCardlessInitialise.tsx
@@ -12,15 +12,15 @@ import Text from '../common/Text';
import View from '../common/View';
import { FormField, FormLabel } from '../forms';
-type NordigenInitialiseProps = {
+type GoCardlessInitialiseProps = {
modalProps?: Partial<ModalProps>;
onSuccess: () => void;
};
-const NordigenInitialise = ({
+const GoCardlessInitialise = ({
modalProps,
onSuccess,
-}: NordigenInitialiseProps) => {
+}: GoCardlessInitialiseProps) => {
const [secretId, setSecretId] = useState('');
const [secretKey, setSecretKey] = useState('');
const [isValid, setIsValid] = useState(true);
@@ -51,13 +51,13 @@ const NordigenInitialise = ({
};
return (
- <Modal title="Set-up Nordigen" size={{ width: 300 }} {...modalProps}>
+ <Modal title="Set-up GoCardless" size={{ width: 300 }} {...modalProps}>
<View style={{ display: 'flex', gap: 10 }}>
<Text>
- In order to enable bank-sync via Nordigen (only for EU banks) you will
- need to create access credentials. This can be done by creating an
- account with{' '}
- <ExternalLink to="https://nordigen.com/">Nordigen</ExternalLink>.
+ In order to enable bank-sync via GoCardless (only for EU banks) you
+ will need to create access credentials. This can be done by creating
+ an account with{' '}
+ <ExternalLink to="https://gocardless.com/">GoCardless</ExternalLink>.
</Text>
<FormField>
@@ -98,4 +98,4 @@ const NordigenInitialise = ({
);
};
-export default NordigenInitialise;
+export default GoCardlessInitialise;
diff --git a/packages/desktop-client/src/nordigen.js b/packages/desktop-client/src/gocardless.js
similarity index 83%
rename from packages/desktop-client/src/nordigen.js
rename to packages/desktop-client/src/gocardless.js
index 853a0af277..6db92f4867 100644
--- a/packages/desktop-client/src/nordigen.js
+++ b/packages/desktop-client/src/gocardless.js
@@ -1,10 +1,10 @@
import { send } from 'loot-core/src/platform/client/fetch';
function _authorize(pushModal, upgradingAccountId, { onSuccess, onClose }) {
- pushModal('nordigen-external-msg', {
+ pushModal('gocardless-external-msg', {
onMoveExternal: async ({ institutionId }) => {
const accessValidForDays = 30;
- const resp = await send('nordigen-create-web-token', {
+ const resp = await send('gocardless-create-web-token', {
upgradingAccountId,
institutionId,
accessValidForDays,
@@ -14,7 +14,7 @@ function _authorize(pushModal, upgradingAccountId, { onSuccess, onClose }) {
const { link, requisitionId } = resp;
window.Actual.openURLInBrowser(link);
- let { error, data } = await send('nordigen-poll-web-token', {
+ let { error, data } = await send('gocardless-poll-web-token', {
upgradingAccountId,
requisitionId,
});
diff --git a/packages/desktop-client/src/hooks/useNordigenStatus.ts b/packages/desktop-client/src/hooks/useGoCardlessStatus.ts
similarity index 85%
rename from packages/desktop-client/src/hooks/useNordigenStatus.ts
rename to packages/desktop-client/src/hooks/useGoCardlessStatus.ts
index e93e87d6a8..bfacf126f0 100644
--- a/packages/desktop-client/src/hooks/useNordigenStatus.ts
+++ b/packages/desktop-client/src/hooks/useGoCardlessStatus.ts
@@ -4,7 +4,7 @@ import { send } from 'loot-core/src/platform/client/fetch';
import useSyncServerStatus from './useSyncServerStatus';
-export default function useNordigenStatus() {
+export default function useGoCardlessStatus() {
const [configured, setConfigured] = useState<boolean | null>(null);
const [isLoading, setIsLoading] = useState(false);
const status = useSyncServerStatus();
@@ -13,7 +13,7 @@ export default function useNordigenStatus() {
async function fetch() {
setIsLoading(true);
- const results = await send('nordigen-status');
+ const results = await send('gocardless-status');
setConfigured(results.configured || false);
setIsLoading(false);
diff --git a/packages/loot-core/src/client/actions/account.ts b/packages/loot-core/src/client/actions/account.ts
index 14f14d6133..311a5cf00a 100644
--- a/packages/loot-core/src/client/actions/account.ts
+++ b/packages/loot-core/src/client/actions/account.ts
@@ -60,7 +60,7 @@ export function unlinkAccount(id: string): ActionResult {
export function linkAccount(requisitionId, account, upgradingId): ActionResult {
return async dispatch => {
- await send('nordigen-accounts-link', {
+ await send('gocardless-accounts-link', {
requisitionId,
account,
upgradingId,
@@ -89,14 +89,14 @@ export function connectAccounts(
};
}
-export function connectNordigenAccounts(
+export function connectGoCardlessAccounts(
institution,
publicToken,
accountIds,
offbudgetIds,
): ActionResult {
return async dispatch => {
- let ids = await send('nordigen-accounts-connect', {
+ let ids = await send('gocardless-accounts-connect', {
institution,
publicToken,
accountIds,
@@ -122,7 +122,7 @@ export function syncAccounts(id): ActionResult {
}
const { errors, newTransactions, matchedTransactions, updatedAccounts } =
- await send('nordigen-accounts-sync', { id });
+ await send('gocardless-accounts-sync', { id });
dispatch(setAccountsSyncing(null));
if (id) {
diff --git a/packages/loot-core/src/client/state-types/modals.d.ts b/packages/loot-core/src/client/state-types/modals.d.ts
index 3f77b35323..6065b00265 100644
--- a/packages/loot-core/src/client/state-types/modals.d.ts
+++ b/packages/loot-core/src/client/state-types/modals.d.ts
@@ -54,10 +54,10 @@ type FinanceModals = {
onSuccess: (data: unknown) => Promise<void>;
};
- 'nordigen-init': {
+ 'gocardless-init': {
onSuccess: () => void;
};
- 'nordigen-external-msg': {
+ 'gocardless-external-msg': {
onMoveExternal: (arg: {
institutionId: string;
}) => Promise<{ error: string } | { data: unknown }>;
diff --git a/packages/loot-core/src/server/accounts/link.ts b/packages/loot-core/src/server/accounts/link.ts
index e7a663af2f..99229977f1 100644
--- a/packages/loot-core/src/server/accounts/link.ts
+++ b/packages/loot-core/src/server/accounts/link.ts
@@ -104,7 +104,7 @@ export async function addAccounts(bankId, accountIds, offbudgetIds = []) {
);
}
-export async function addNordigenAccounts(
+export async function addGoCardlessAccounts(
bankId,
accountIds,
offbudgetIds = [],
@@ -115,7 +115,7 @@ export async function addNordigenAccounts(
]);
// Get all the available accounts
- let accounts = await bankSync.getNordigenAccounts(userId, userKey, bankId);
+ let accounts = await bankSync.getGoCardlessAccounts(userId, userKey, bankId);
// Only add the selected accounts
accounts = accounts.filter(acct => accountIds.includes(acct.account_id));
@@ -143,7 +143,7 @@ export async function addNordigenAccounts(
});
// Do an initial sync
- await bankSync.syncNordigenAccount(
+ await bankSync.syncGoCardlessAccount(
userId,
userKey,
id,
diff --git a/packages/loot-core/src/server/accounts/sync.ts b/packages/loot-core/src/server/accounts/sync.ts
index 4e97ad717e..f15160a6c7 100644
--- a/packages/loot-core/src/server/accounts/sync.ts
+++ b/packages/loot-core/src/server/accounts/sync.ts
@@ -75,12 +75,12 @@ export async function getAccounts(userId, userKey, id) {
return accounts;
}
-export async function getNordigenAccounts(userId, userKey, id) {
+export async function getGoCardlessAccounts(userId, userKey, id) {
const userToken = await asyncStorage.getItem('user-token');
if (!userToken) return;
let res = await post(
- getServer().NORDIGEN_SERVER + '/accounts',
+ getServer().GOCARDLESS_SERVER + '/accounts',
{
userId,
key: userKey,
@@ -174,7 +174,7 @@ async function downloadTransactions(
};
}
-async function downloadNordigenTransactions(
+async function downloadGoCardlessTransactions(
userId,
userKey,
acctId,
@@ -187,7 +187,7 @@ async function downloadNordigenTransactions(
const endDate = new Date().toISOString().split('T')[0];
const res = await post(
- getServer().NORDIGEN_SERVER + '/transactions',
+ getServer().GOCARDLESS_SERVER + '/transactions',
{
userId: userId,
key: userKey,
@@ -289,7 +289,7 @@ async function normalizeTransactions(
return { normalized, payeesToCreate };
}
-async function normalizeNordigenTransactions(transactions, acctId) {
+async function normalizeGoCardlessTransactions(transactions, acctId) {
let payeesToCreate = new Map();
let normalized = [];
@@ -398,12 +398,12 @@ async function createNewPayees(payeesToCreate, addsAndUpdates) {
});
}
-export async function reconcileNordigenTransactions(acctId, transactions) {
+export async function reconcileGoCardlessTransactions(acctId, transactions) {
const hasMatched = new Set();
const updated = [];
const added = [];
- let { normalized, payeesToCreate } = await normalizeNordigenTransactions(
+ let { normalized, payeesToCreate } = await normalizeGoCardlessTransactions(
transactions,
acctId,
);
@@ -738,7 +738,13 @@ export async function addTransactions(
return newTransactions;
}
-export async function syncNordigenAccount(userId, userKey, id, acctId, bankId) {
+export async function syncGoCardlessAccount(
+ userId,
+ userKey,
+ id,
+ acctId,
+ bankId,
+) {
// TODO: Handle the case where transactions exist in the future
// (that will make start date after end date)
const latestTransaction = await db.first(
@@ -770,7 +776,7 @@ export async function syncNordigenAccount(userId, userKey, id, acctId, bankId) {
date = startingDate;
}
- let { transactions, accountBalance } = await downloadNordigenTransactions(
+ let { transactions, accountBalance } = await downloadGoCardlessTransactions(
userId,
userKey,
acctId,
@@ -785,7 +791,7 @@ export async function syncNordigenAccount(userId, userKey, id, acctId, bankId) {
transactions = transactions.map(trans => ({ ...trans, account: id }));
return runMutator(async () => {
- const result = await reconcileNordigenTransactions(id, transactions);
+ const result = await reconcileGoCardlessTransactions(id, transactions);
await updateAccountBalance(id, accountBalance);
return result;
});
@@ -794,7 +800,7 @@ export async function syncNordigenAccount(userId, userKey, id, acctId, bankId) {
const startingDay = monthUtils.subDays(monthUtils.currentDay(), 30);
const { transactions, startingBalance } =
- await downloadNordigenTransactions(
+ await downloadGoCardlessTransactions(
userId,
userKey,
acctId,
@@ -828,7 +834,7 @@ export async function syncNordigenAccount(userId, userKey, id, acctId, bankId) {
starting_balance_flag: true,
});
- let result = await reconcileNordigenTransactions(id, transactions);
+ let result = await reconcileGoCardlessTransactions(id, transactions);
return {
...result,
added: [initialId, ...result.added],
diff --git a/packages/loot-core/src/server/main.ts b/packages/loot-core/src/server/main.ts
index 712756faa2..00fee7daef 100644
--- a/packages/loot-core/src/server/main.ts
+++ b/packages/loot-core/src/server/main.ts
@@ -740,7 +740,7 @@ handlers['accounts-link'] = async function ({
]);
// Get all the available accounts and find the selected one
- let accounts = await bankSync.getNordigenAccounts(userId, userKey, bankId);
+ let accounts = await bankSync.getGoCardlessAccounts(userId, userKey, bankId);
let account = accounts.find(acct => acct.account_id === accountId);
await db.update('accounts', {
@@ -770,7 +770,7 @@ handlers['accounts-link'] = async function ({
return 'ok';
};
-handlers['nordigen-accounts-link'] = async function ({
+handlers['gocardless-accounts-link'] = async function ({
requisitionId,
account,
upgradingId,
@@ -804,7 +804,7 @@ handlers['nordigen-accounts-link'] = async function ({
});
}
- await bankSync.syncNordigenAccount(
+ await bankSync.syncGoCardlessAccount(
undefined,
undefined,
id,
@@ -831,14 +831,14 @@ handlers['accounts-connect'] = async function ({
return ids;
};
-handlers['nordigen-accounts-connect'] = async function ({
+handlers['gocardless-accounts-connect'] = async function ({
institution,
publicToken,
accountIds,
offbudgetIds,
}) {
let bankId = await link.handoffPublicToken(institution, publicToken);
- let ids = await link.addNordigenAccounts(bankId, accountIds, offbudgetIds);
+ let ids = await link.addGoCardlessAccounts(bankId, accountIds, offbudgetIds);
return ids;
};
@@ -1162,7 +1162,7 @@ handlers['secret-check'] = async function (name) {
}
};
-handlers['nordigen-poll-web-token'] = async function ({
+handlers['gocardless-poll-web-token'] = async function ({
upgradingAccountId,
requisitionId,
}) {
@@ -1183,7 +1183,7 @@ handlers['nordigen-poll-web-token'] = async function ({
}
let data = await post(
- getServer().NORDIGEN_SERVER + '/get-accounts',
+ getServer().GOCARDLESS_SERVER + '/get-accounts',
{
upgradingAccountId,
requisitionId,
@@ -1215,7 +1215,7 @@ handlers['nordigen-poll-web-token'] = async function ({
});
};
-handlers['nordigen-status'] = async function () {
+handlers['gocardless-status'] = async function () {
const userToken = await asyncStorage.getItem('user-token');
if (!userToken) {
@@ -1223,7 +1223,7 @@ handlers['nordigen-status'] = async function () {
}
return post(
- getServer().NORDIGEN_SERVER + '/status',
+ getServer().GOCARDLESS_SERVER + '/status',
{},
{
'X-ACTUAL-TOKEN': userToken,
@@ -1231,7 +1231,7 @@ handlers['nordigen-status'] = async function () {
);
};
-handlers['nordigen-get-banks'] = async function (country) {
+handlers['gocardless-get-banks'] = async function (country) {
const userToken = await asyncStorage.getItem('user-token');
if (!userToken) {
@@ -1239,7 +1239,7 @@ handlers['nordigen-get-banks'] = async function (country) {
}
return post(
- getServer().NORDIGEN_SERVER + '/get-banks',
+ getServer().GOCARDLESS_SERVER + '/get-banks',
{ country, showDemo: isNonProductionEnvironment() },
{
'X-ACTUAL-TOKEN': userToken,
@@ -1247,12 +1247,12 @@ handlers['nordigen-get-banks'] = async function (country) {
);
};
-handlers['nordigen-poll-web-token-stop'] = async function () {
+handlers['gocardless-poll-web-token-stop'] = async function () {
stopPolling = true;
return 'ok';
};
-handlers['nordigen-create-web-token'] = async function ({
+handlers['gocardless-create-web-token'] = async function ({
upgradingAccountId,
institutionId,
accessValidForDays,
@@ -1265,7 +1265,7 @@ handlers['nordigen-create-web-token'] = async function ({
try {
return await post(
- getServer().NORDIGEN_SERVER + '/create-web-token',
+ getServer().GOCARDLESS_SERVER + '/create-web-token',
{
upgradingAccountId,
institutionId,
@@ -1281,7 +1281,7 @@ handlers['nordigen-create-web-token'] = async function ({
}
};
-handlers['nordigen-accounts-sync'] = async function ({ id }) {
+handlers['gocardless-accounts-sync'] = async function ({ id }) {
let [[, userId], [, userKey]] = await asyncStorage.multiGet([
'user-id',
'user-key',
@@ -1307,7 +1307,7 @@ handlers['nordigen-accounts-sync'] = async function ({ id }) {
const acct = accounts[i];
if (acct.bankId) {
try {
- const res = await bankSync.syncNordigenAccount(
+ const res = await bankSync.syncGoCardlessAccount(
userId,
userKey,
acct.id,
@@ -1408,7 +1408,7 @@ handlers['account-unlink'] = mutator(async function ({ id }) {
);
// No more accounts are associated with this bank. We can remove
- // it from Nordigen.
+ // it from GoCardless.
let userToken = await asyncStorage.getItem('user-token');
if (!userToken) {
return 'ok';
@@ -1421,7 +1421,7 @@ handlers['account-unlink'] = mutator(async function ({ id }) {
);
try {
await post(
- getServer().NORDIGEN_SERVER + '/remove-account',
+ getServer().GOCARDLESS_SERVER + '/remove-account',
{
requisitionId: requisitionId,
},
diff --git a/packages/loot-core/src/server/server-config.ts b/packages/loot-core/src/server/server-config.ts
index 56f62cd10e..2bf09ec5ef 100644
--- a/packages/loot-core/src/server/server-config.ts
+++ b/packages/loot-core/src/server/server-config.ts
@@ -24,7 +24,8 @@ export function getServer(url?) {
SYNC_SERVER: joinURL(url, '/sync'),
SIGNUP_SERVER: joinURL(url, '/account'),
PLAID_SERVER: joinURL(url, '/plaid'),
- NORDIGEN_SERVER: joinURL(url, '/nordigen'),
+ // TODO: change to use `/gocardless` after v23.8.0
+ GOCARDLESS_SERVER: joinURL(url, '/nordigen'),
};
}
return config;
diff --git a/packages/loot-core/src/types/server-handlers.d.ts b/packages/loot-core/src/types/server-handlers.d.ts
index 5fd3046481..32b56f1c12 100644
--- a/packages/loot-core/src/types/server-handlers.d.ts
+++ b/packages/loot-core/src/types/server-handlers.d.ts
@@ -150,7 +150,7 @@ export interface ServerHandlers {
upgradingId;
}) => Promise<'ok'>;
- 'nordigen-accounts-link': (arg: {
+ 'gocardless-accounts-link': (arg: {
requisitionId;
account;
upgradingId;
@@ -163,7 +163,7 @@ export interface ServerHandlers {
offbudgetIds;
}) => Promise<unknown>;
- 'nordigen-accounts-connect': (arg: {
+ 'gocardless-accounts-connect': (arg: {
institution;
publicToken;
accountIds;
@@ -202,24 +202,24 @@ export interface ServerHandlers {
'secret-set': (arg: { name: string; value: string }) => Promise<null>;
'secret-check': (arg: string) => Promise<string | { error?: string }>;
- 'nordigen-poll-web-token': (arg: {
+ 'gocardless-poll-web-token': (arg: {
upgradingAccountId;
requisitionId;
}) => Promise<{ error } | { data }>;
- 'nordigen-status': () => Promise<{ configured: boolean }>;
+ 'gocardless-status': () => Promise<{ configured: boolean }>;
- 'nordigen-get-banks': (country) => Promise<unknown>;
+ 'gocardless-get-banks': (country) => Promise<unknown>;
- 'nordigen-poll-web-token-stop': () => Promise<'ok'>;
+ 'gocardless-poll-web-token-stop': () => Promise<'ok'>;
- 'nordigen-create-web-token': (arg: {
+ 'gocardless-create-web-token': (arg: {
upgradingAccountId;
institutionId;
accessValidForDays;
}) => Promise<unknown>;
- 'nordigen-accounts-sync': (arg: { id }) => Promise<{
+ 'gocardless-accounts-sync': (arg: { id }) => Promise<{
errors;
newTransactions;
matchedTransactions;
diff --git a/upcoming-release-notes/1361.md b/upcoming-release-notes/1361.md
new file mode 100644
index 0000000000..a0d531dfea
--- /dev/null
+++ b/upcoming-release-notes/1361.md
@@ -0,0 +1,6 @@
+---
+category: Maintenance
+authors: [MatissJanis]
+---
+
+Rename Nordigen to GoCardless