-
Notifications
You must be signed in to change notification settings - Fork 463
/
Copy pathfinancialconnections_account.go
271 lines (240 loc) · 13.1 KB
/
financialconnections_account.go
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
//
//
// File generated from our OpenAPI spec
//
//
package stripe
// Type of account holder that this account belongs to.
type FinancialConnectionsAccountAccountHolderType string
// List of values that FinancialConnectionsAccountAccountHolderType can take
const (
FinancialConnectionsAccountAccountHolderTypeAccount FinancialConnectionsAccountAccountHolderType = "account"
FinancialConnectionsAccountAccountHolderTypeCustomer FinancialConnectionsAccountAccountHolderType = "customer"
)
// The `type` of the balance. An additional hash is included on the balance with a name matching this value.
type FinancialConnectionsAccountBalanceType string
// List of values that FinancialConnectionsAccountBalanceType can take
const (
FinancialConnectionsAccountBalanceTypeCash FinancialConnectionsAccountBalanceType = "cash"
FinancialConnectionsAccountBalanceTypeCredit FinancialConnectionsAccountBalanceType = "credit"
)
// The status of the last refresh attempt.
type FinancialConnectionsAccountBalanceRefreshStatus string
// List of values that FinancialConnectionsAccountBalanceRefreshStatus can take
const (
FinancialConnectionsAccountBalanceRefreshStatusFailed FinancialConnectionsAccountBalanceRefreshStatus = "failed"
FinancialConnectionsAccountBalanceRefreshStatusPending FinancialConnectionsAccountBalanceRefreshStatus = "pending"
FinancialConnectionsAccountBalanceRefreshStatusSucceeded FinancialConnectionsAccountBalanceRefreshStatus = "succeeded"
)
// The type of the account. Account category is further divided in `subcategory`.
type FinancialConnectionsAccountCategory string
// List of values that FinancialConnectionsAccountCategory can take
const (
FinancialConnectionsAccountCategoryCash FinancialConnectionsAccountCategory = "cash"
FinancialConnectionsAccountCategoryCredit FinancialConnectionsAccountCategory = "credit"
FinancialConnectionsAccountCategoryInvestment FinancialConnectionsAccountCategory = "investment"
FinancialConnectionsAccountCategoryOther FinancialConnectionsAccountCategory = "other"
)
// The status of the last refresh attempt.
type FinancialConnectionsAccountOwnershipRefreshStatus string
// List of values that FinancialConnectionsAccountOwnershipRefreshStatus can take
const (
FinancialConnectionsAccountOwnershipRefreshStatusFailed FinancialConnectionsAccountOwnershipRefreshStatus = "failed"
FinancialConnectionsAccountOwnershipRefreshStatusPending FinancialConnectionsAccountOwnershipRefreshStatus = "pending"
FinancialConnectionsAccountOwnershipRefreshStatusSucceeded FinancialConnectionsAccountOwnershipRefreshStatus = "succeeded"
)
// The list of permissions granted by this account.
type FinancialConnectionsAccountPermission string
// List of values that FinancialConnectionsAccountPermission can take
const (
FinancialConnectionsAccountPermissionBalances FinancialConnectionsAccountPermission = "balances"
FinancialConnectionsAccountPermissionOwnership FinancialConnectionsAccountPermission = "ownership"
FinancialConnectionsAccountPermissionPaymentMethod FinancialConnectionsAccountPermission = "payment_method"
FinancialConnectionsAccountPermissionTransactions FinancialConnectionsAccountPermission = "transactions"
)
// The status of the link to the account.
type FinancialConnectionsAccountStatus string
// List of values that FinancialConnectionsAccountStatus can take
const (
FinancialConnectionsAccountStatusActive FinancialConnectionsAccountStatus = "active"
FinancialConnectionsAccountStatusDisconnected FinancialConnectionsAccountStatus = "disconnected"
FinancialConnectionsAccountStatusInactive FinancialConnectionsAccountStatus = "inactive"
)
// If `category` is `cash`, one of:
//
// - `checking`
// - `savings`
// - `other`
//
// If `category` is `credit`, one of:
//
// - `mortgage`
// - `line_of_credit`
// - `credit_card`
// - `other`
//
// If `category` is `investment` or `other`, this will be `other`.
type FinancialConnectionsAccountSubcategory string
// List of values that FinancialConnectionsAccountSubcategory can take
const (
FinancialConnectionsAccountSubcategoryChecking FinancialConnectionsAccountSubcategory = "checking"
FinancialConnectionsAccountSubcategoryCreditCard FinancialConnectionsAccountSubcategory = "credit_card"
FinancialConnectionsAccountSubcategoryLineOfCredit FinancialConnectionsAccountSubcategory = "line_of_credit"
FinancialConnectionsAccountSubcategoryMortgage FinancialConnectionsAccountSubcategory = "mortgage"
FinancialConnectionsAccountSubcategoryOther FinancialConnectionsAccountSubcategory = "other"
FinancialConnectionsAccountSubcategorySavings FinancialConnectionsAccountSubcategory = "savings"
)
// The [PaymentMethod type](https://stripe.com/docs/api/payment_methods/object#payment_method_object-type)(s) that can be created from this account.
type FinancialConnectionsAccountSupportedPaymentMethodType string
// List of values that FinancialConnectionsAccountSupportedPaymentMethodType can take
const (
FinancialConnectionsAccountSupportedPaymentMethodTypeLink FinancialConnectionsAccountSupportedPaymentMethodType = "link"
FinancialConnectionsAccountSupportedPaymentMethodTypeUSBankAccount FinancialConnectionsAccountSupportedPaymentMethodType = "us_bank_account"
)
// If present, only return accounts that belong to the specified account holder. `account_holder[customer]` and `account_holder[account]` are mutually exclusive.
type FinancialConnectionsAccountListAccountHolderParams struct {
// The ID of the Stripe account whose accounts will be retrieved.
Account *string `form:"account"`
// The ID of the Stripe customer whose accounts will be retrieved.
Customer *string `form:"customer"`
}
// Returns a list of Financial Connections Account objects.
type FinancialConnectionsAccountListParams struct {
ListParams `form:"*"`
// If present, only return accounts that belong to the specified account holder. `account_holder[customer]` and `account_holder[account]` are mutually exclusive.
AccountHolder *FinancialConnectionsAccountListAccountHolderParams `form:"account_holder"`
// If present, only return accounts that were collected as part of the given session.
Session *string `form:"session"`
}
// Retrieves the details of an Financial Connections Account.
type FinancialConnectionsAccountParams struct {
Params `form:"*"`
}
// Lists all owners for a given Account
type FinancialConnectionsAccountListOwnersParams struct {
ListParams `form:"*"`
Account *string `form:"-"` // Included in URL
// The ID of the ownership object to fetch owners from.
Ownership *string `form:"ownership"`
}
// Refreshes the data associated with a Financial Connections Account.
type FinancialConnectionsAccountRefreshParams struct {
Params `form:"*"`
// The list of account features that you would like to refresh. Either: `balance` or `ownership`.
Features []*string `form:"features"`
}
// Disables your access to a Financial Connections Account. You will no longer be able to access data associated with the account (e.g. balances, transactions).
type FinancialConnectionsAccountDisconnectParams struct {
Params `form:"*"`
}
// The account holder that this account belongs to.
type FinancialConnectionsAccountAccountHolder struct {
// The ID of the Stripe account this account belongs to. Should only be present if `account_holder.type` is `account`.
Account *Account `json:"account"`
// ID of the Stripe customer this account belongs to. Present if and only if `account_holder.type` is `customer`.
Customer *Customer `json:"customer"`
// Type of account holder that this account belongs to.
Type FinancialConnectionsAccountAccountHolderType `json:"type"`
}
type FinancialConnectionsAccountBalanceCash struct {
// The funds available to the account holder. Typically this is the current balance less any holds.
//
// Each key is a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
//
// Each value is a integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder.
Available map[string]int64 `json:"available"`
}
type FinancialConnectionsAccountBalanceCredit struct {
// The credit that has been used by the account holder.
//
// Each key is a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
//
// Each value is a integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder.
Used map[string]int64 `json:"used"`
}
// The most recent information about the account's balance.
type FinancialConnectionsAccountBalance struct {
// The time that the external institution calculated this balance. Measured in seconds since the Unix epoch.
AsOf int64 `json:"as_of"`
Cash *FinancialConnectionsAccountBalanceCash `json:"cash"`
Credit *FinancialConnectionsAccountBalanceCredit `json:"credit"`
// The balances owed to (or by) the account holder.
//
// Each key is a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
//
// Each value is a integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder.
Current map[string]int64 `json:"current"`
// The `type` of the balance. An additional hash is included on the balance with a name matching this value.
Type FinancialConnectionsAccountBalanceType `json:"type"`
}
// The state of the most recent attempt to refresh the account balance.
type FinancialConnectionsAccountBalanceRefresh struct {
// The time at which the last refresh attempt was initiated. Measured in seconds since the Unix epoch.
LastAttemptedAt int64 `json:"last_attempted_at"`
// The status of the last refresh attempt.
Status FinancialConnectionsAccountBalanceRefreshStatus `json:"status"`
}
// The state of the most recent attempt to refresh the account owners.
type FinancialConnectionsAccountOwnershipRefresh struct {
// The time at which the last refresh attempt was initiated. Measured in seconds since the Unix epoch.
LastAttemptedAt int64 `json:"last_attempted_at"`
// The status of the last refresh attempt.
Status FinancialConnectionsAccountOwnershipRefreshStatus `json:"status"`
}
// A Financial Connections Account represents an account that exists outside of Stripe, to which you have been granted some degree of access.
type FinancialConnectionsAccount struct {
APIResource
// The account holder that this account belongs to.
AccountHolder *FinancialConnectionsAccountAccountHolder `json:"account_holder"`
// The most recent information about the account's balance.
Balance *FinancialConnectionsAccountBalance `json:"balance"`
// The state of the most recent attempt to refresh the account balance.
BalanceRefresh *FinancialConnectionsAccountBalanceRefresh `json:"balance_refresh"`
// The type of the account. Account category is further divided in `subcategory`.
Category FinancialConnectionsAccountCategory `json:"category"`
// Time at which the object was created. Measured in seconds since the Unix epoch.
Created int64 `json:"created"`
// A human-readable name that has been assigned to this account, either by the account holder or by the institution.
DisplayName string `json:"display_name"`
// Unique identifier for the object.
ID string `json:"id"`
// The name of the institution that holds this account.
InstitutionName string `json:"institution_name"`
// The last 4 digits of the account number. If present, this will be 4 numeric characters.
Last4 string `json:"last4"`
// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
Livemode bool `json:"livemode"`
// String representing the object's type. Objects of the same type share the same value.
Object string `json:"object"`
// The most recent information about the account's owners.
Ownership *FinancialConnectionsAccountOwnership `json:"ownership"`
// The state of the most recent attempt to refresh the account owners.
OwnershipRefresh *FinancialConnectionsAccountOwnershipRefresh `json:"ownership_refresh"`
// The list of permissions granted by this account.
Permissions []FinancialConnectionsAccountPermission `json:"permissions"`
// The status of the link to the account.
Status FinancialConnectionsAccountStatus `json:"status"`
// If `category` is `cash`, one of:
//
// - `checking`
// - `savings`
// - `other`
//
// If `category` is `credit`, one of:
//
// - `mortgage`
// - `line_of_credit`
// - `credit_card`
// - `other`
//
// If `category` is `investment` or `other`, this will be `other`.
Subcategory FinancialConnectionsAccountSubcategory `json:"subcategory"`
// The [PaymentMethod type](https://stripe.com/docs/api/payment_methods/object#payment_method_object-type)(s) that can be created from this account.
SupportedPaymentMethodTypes []FinancialConnectionsAccountSupportedPaymentMethodType `json:"supported_payment_method_types"`
}
// FinancialConnectionsAccountList is a list of Accounts as retrieved from a list endpoint.
type FinancialConnectionsAccountList struct {
APIResource
ListMeta
Data []*FinancialConnectionsAccount `json:"data"`
}