-
Notifications
You must be signed in to change notification settings - Fork 4
/
config.js
95 lines (90 loc) · 2.87 KB
/
config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
// *** EDIT BELOW THIS LINE ***
// Environment can either be 'sandbox' or 'development'. Keep this as 'sandbox' if you want to play around with the example data, or change this to 'development' once you have put in your own credentials.
// You can include multiple accounts here under the same client. Use this format per account. Owner name, then account name.
// Owner: {
// Account1: {
// token: "access-sandbox-e5ad8ed8-e0c6-4b69-8681-279c0cf172b4",
// earliestDate: "2019-07-29",
// },
// Account2: {
// token: "access-sandbox-e5ad8ed8-e0c6-4b67-8681-279c0cf172b9",
// earliestDate: "2019-07-29",
// },
// },
const environment = "development";
const client_id = "yourIDHere";
const secret = "yourSecretHere";
const tokens = {
Sandbox: {
// change "Sandbox" to the owner's name
Chase: {
// change "Chase" to the account's name
token: "accessTokenHere",
// Earliest date signified a hard stop of the earliest date to pull transactions.
earliestDate: "2019-07-29",
},
},
};
// *** EDIT ABOVE THIS LINE ***
// *** NOT NECESSARY TO EDIT BELOW THIS LINE, BUT YOU CAN IF YOU WANT ***
const runningTransactionsSheetName = "Transactions (Running)";
const dateRangeTransactionsSheetName = "Transactions (Date Range)";
const accountBalancesSheetName = "Account Balances";
const importSettingsSheetName = "Date Range Import Settings";
const rulesSheetName = "Rules";
const email = "";
const count = 500;
const transactionHeaders = [
"Date",
"Name",
"Merchant Name",
"Payment Channel",
"ISO Currency Code",
"Plaid Category 1",
"Plaid Category 2",
"Plaid Category 3",
"Category ID",
"Transaction Space",
"Transaction Type",
"Transaction ID",
"Pending Transaction ID",
"Owner",
"Account",
"Mask",
"Account Name",
"Account Type",
"Account Subtype",
"Address",
"City",
"Region",
"Postal Code",
"Country",
"Store Number",
"Category",
"Amount",
"Rollup",
];
const accountBalanceHeaders = [
"Date",
"Owner",
"Account ID",
"Mask",
"Name",
"Official Name",
"Account Type",
"Account Subtype",
"Currency",
"Available Balance",
"Value (USD)",
"Limit",
];
// *** NOT NECESSARY TO EDIT ABOVE THIS LINE, BUT YOU CAN IF YOU WANT ***
// *** DO NOT EDIT BELOW THIS LINE ***
const developmentEndpoint = "https://development.plaid.com/transactions/get";
const sandboxEndpoint = "https://sandbox.plaid.com/transactions/get";
const transactionIdColumnNumber = transactionHeaders.indexOf("Transaction ID"); // Index values are zero indexed.
const pendingTransactionIdColumnNumber = transactionHeaders.indexOf("Pending Transaction ID");
const accountBalancesMaskColumnNumber = accountBalanceHeaders.indexOf("Mask");
const accountBalancesDateColumnNumber = accountBalanceHeaders.indexOf("Date");
const transactionsDateColumnNumber = transactionHeaders.indexOf("Date");
const ss = SpreadsheetApp.getActiveSpreadsheet();