You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 10, 2025. It is now read-only.
Copy file name to clipboardexpand all lines: src/app-gocardless/README.md
+33-2
Original file line number
Diff line number
Diff line change
@@ -10,9 +10,9 @@ If the default bank integration does not work for you, you can integrate a new b
10
10
11
11
This will trigger the process of fetching the data from the bank and will log the data in the backend. Use this data to fill the logic of the bank class.
12
12
13
-
4. Create new a bank class based on `app-gocardless/banks/sandboxfinance-sfin0000.js`.
13
+
4. Create new a bank class based on an existing example in `app-gocardless/banks`.
14
14
15
-
Name of the file and class should be created based on the ID of the integrated institution, found in step 1.
15
+
Name of the file and class should follow the existing patterns and be created based on the ID of the integrated institution, found in step 1.
16
16
17
17
5. Fill the logic of `normalizeAccount`, `normalizeTransaction`, `sortTransactions`, and `calculateStartingBalance` functions.
18
18
You do not need to fill every function, only those which are necessary for the integration to work.
@@ -162,3 +162,34 @@ If the default bank integration does not work for you, you can integrate a new b
162
162
6. Add new bank integration to `BankFactory` class in file `actual-server/app-gocardless/bank-factory.js`
163
163
164
164
7. Remember to add tests for new bank integration in
165
+
166
+
## normalizeTransaction
167
+
This is the most commonly used override as it allows you to change the data that is returned to the client.
168
+
169
+
Please follow the following patterns when implementing a custom normalizeTransaction method:
170
+
1. If you need to edit the values of transaction fields (excluding the transaction amount) do not mutate the original transaction object. Instead, create a shallow copy and make your changes there.
171
+
2. End the function by returning the result of calling the fallback normalizeTransaction method from integration-bank.js
172
+
173
+
E.g.
174
+
```js
175
+
import Fallback from './integration-bank.js';
176
+
177
+
export default {
178
+
...
179
+
180
+
normalizeTransaction(transaction, booked) {
181
+
// create a shallow copy of the transaction object
0 commit comments