-
Notifications
You must be signed in to change notification settings - Fork 724
/
Accounts.js
106 lines (106 loc) · 3.1 KB
/
Accounts.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
96
97
98
99
100
101
102
103
104
105
106
// File generated from our OpenAPI spec
'use strict';
const StripeResource = require('../StripeResource');
const stripeMethod = StripeResource.method;
// Since path can either be `account` or `accounts`, support both through stripeMethod path;
module.exports = StripeResource.extend({
create: stripeMethod({
method: 'POST',
fullPath: '/v1/accounts',
}),
retrieve(id) {
// No longer allow an api key to be passed as the first string to this function due to ambiguity between
// old account ids and api keys. To request the account for an api key, send null as the id
if (typeof id === 'string') {
return stripeMethod({
method: 'GET',
fullPath: '/v1/accounts/{id}',
}).apply(this, arguments);
} else {
if (id === null || id === undefined) {
// Remove id as stripeMethod would complain of unexpected argument
[].shift.apply(arguments);
}
return stripeMethod({
method: 'GET',
fullPath: '/v1/account',
}).apply(this, arguments);
}
},
update: stripeMethod({
method: 'POST',
fullPath: '/v1/accounts/{account}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/accounts',
methodType: 'list',
}),
del: stripeMethod({
method: 'DELETE',
fullPath: '/v1/accounts/{account}',
}),
reject: stripeMethod({
method: 'POST',
fullPath: '/v1/accounts/{account}/reject',
}),
retrieveCapability: stripeMethod({
method: 'GET',
fullPath: '/v1/accounts/{account}/capabilities/{capability}',
}),
updateCapability: stripeMethod({
method: 'POST',
fullPath: '/v1/accounts/{account}/capabilities/{capability}',
}),
listCapabilities: stripeMethod({
method: 'GET',
fullPath: '/v1/accounts/{account}/capabilities',
methodType: 'list',
}),
createExternalAccount: stripeMethod({
method: 'POST',
fullPath: '/v1/accounts/{account}/external_accounts',
}),
retrieveExternalAccount: stripeMethod({
method: 'GET',
fullPath: '/v1/accounts/{account}/external_accounts/{id}',
}),
updateExternalAccount: stripeMethod({
method: 'POST',
fullPath: '/v1/accounts/{account}/external_accounts/{id}',
}),
listExternalAccounts: stripeMethod({
method: 'GET',
fullPath: '/v1/accounts/{account}/external_accounts',
methodType: 'list',
}),
deleteExternalAccount: stripeMethod({
method: 'DELETE',
fullPath: '/v1/accounts/{account}/external_accounts/{id}',
}),
createLoginLink: stripeMethod({
method: 'POST',
fullPath: '/v1/accounts/{account}/login_links',
}),
createPerson: stripeMethod({
method: 'POST',
fullPath: '/v1/accounts/{account}/persons',
}),
retrievePerson: stripeMethod({
method: 'GET',
fullPath: '/v1/accounts/{account}/persons/{person}',
}),
updatePerson: stripeMethod({
method: 'POST',
fullPath: '/v1/accounts/{account}/persons/{person}',
}),
listPersons: stripeMethod({
method: 'GET',
fullPath: '/v1/accounts/{account}/persons',
methodType: 'list',
}),
deletePerson: stripeMethod({
method: 'DELETE',
fullPath: '/v1/accounts/{account}/persons/{person}',
}),
});