Repository navigation
Expand file tree
/
Copy pathauthentication.js
More file actions
63 lines (63 loc) · 2.1 KB
/
Copy pathauthentication.js
File metadata and controls
63 lines (63 loc) · 2.1 KB
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
module.exports = {
test: {
body: {},
url: 'https://connect.squareup.com/v2/locations',
removeMissingValuesFrom: {},
headers: {
Authorization: 'Bearer {{bundle.authData.access_token}}',
Accept: 'application/json',
},
params: {},
method: 'GET',
},
oauth2Config: {
authorizeUrl: {
url: 'https://connect.squareup.com/oauth2/authorize',
params: {
state: '{{bundle.inputData.state}}',
redirect_uri: '{{bundle.inputData.redirect_uri}}',
response_type: 'code',
client_id: '{{process.env.CLIENT_ID}}',
},
method: 'GET',
},
refreshAccessToken: {
body: {
client_secret: '{{process.env.CLIENT_SECRET}}',
grant_type: 'refresh_token',
refresh_token: '{{bundle.authData.refresh_token}}',
client_id: '{{process.env.CLIENT_ID}}',
},
url: 'https://connect.squareup.com/oauth2/token',
removeMissingValuesFrom: {},
headers: {
'content-type': 'application/x-www-form-urlencoded',
accept: 'application/json',
},
params: {},
method: 'POST',
},
getAccessToken: {
body: {
code: '{{bundle.inputData.code}}',
client_secret: '{{process.env.CLIENT_SECRET}}',
redirect_uri: '{{bundle.inputData.redirect_uri}}',
client_id: '{{process.env.CLIENT_ID}}',
grant_type: 'authorization_code',
},
url: 'https://connect.squareup.com/oauth2/token',
removeMissingValuesFrom: {},
headers: {
'content-type': 'application/x-www-form-urlencoded',
accept: 'application/json',
},
params: {},
method: 'POST',
},
autoRefresh: true,
scope:
'BANK_ACCOUNTS_READ,CUSTOMERS_READ,CUSTOMERS_WRITE,EMPLOYEES_READ,EMPLOYEES_WRITE,INVENTORY_READ,INVENTORY_WRITE,ITEMS_READ,ITEMS_WRITE,MERCHANT_PROFILE_READ,ORDERS_READ,ORDERS_WRITE,PAYMENTS_READ,PAYMENTS_WRITE,PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS,PAYMENTS_WRITE_IN_PERSON,SETTLEMENTS_READ,TIMECARDS_READ,TIMECARDS_WRITE,TIMECARDS_SETTINGS_READ,TIMECARDS_SETTINGS_WRITE',
},
type: 'oauth2',
connectionLabel: '',
};