stripe 8.220.0 → 8.221.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 8.221.0 - 2022-05-05
4
+ * [#1413](https://github.com/stripe/stripe-node/pull/1413) API Updates
5
+ * Add support for new resources `FinancialConnections.AccountOwner`, `FinancialConnections.AccountOwnership`, `FinancialConnections.Account`, and `FinancialConnections.Session`
6
+ * Add support for `financial_connections` on `Checkout.Session.payment_method_options.us_bank_account`, `CheckoutSessionCreateParams.payment_method_options.us_bank_account`, `Invoice.payment_settings.payment_method_options.us_bank_account`, `InvoiceCreateParams.payment_settings.payment_method_options.us_bank_account`, `InvoiceUpdateParams.payment_settings.payment_method_options.us_bank_account`, `PaymentIntent.payment_method_options.us_bank_account`, `PaymentIntentConfirmParams.payment_method_options.us_bank_account`, `PaymentIntentCreateParams.payment_method_options.us_bank_account`, `PaymentIntentUpdateParams.payment_method_options.us_bank_account`, `SetupIntent.payment_method_options.us_bank_account`, `SetupIntentConfirmParams.payment_method_options.us_bank_account`, `SetupIntentCreateParams.payment_method_options.us_bank_account`, `SetupIntentUpdateParams.payment_method_options.us_bank_account`, `Subscription.payment_settings.payment_method_options.us_bank_account`, `SubscriptionCreateParams.payment_settings.payment_method_options.us_bank_account`, and `SubscriptionUpdateParams.payment_settings.payment_method_options.us_bank_account`
7
+ * Add support for `financial_connections_account` on `PaymentIntentConfirmParams.payment_method_data.us_bank_account`, `PaymentIntentCreateParams.payment_method_data.us_bank_account`, `PaymentIntentUpdateParams.payment_method_data.us_bank_account`, `PaymentMethod.us_bank_account`, `PaymentMethodCreateParams.us_bank_account`, `SetupIntentConfirmParams.payment_method_data.us_bank_account`, `SetupIntentCreateParams.payment_method_data.us_bank_account`, and `SetupIntentUpdateParams.payment_method_data.us_bank_account`
8
+
9
+ * [#1410](https://github.com/stripe/stripe-node/pull/1410) API Updates
10
+ * Add support for `registered_address` on `AccountCreateParams.individual`, `AccountUpdateParams.individual`, `PersonCreateParams`, `PersonUpdateParams`, `Person`, `TokenCreateParams.account.individual`, and `TokenCreateParams.person`
11
+ * Change type of `PaymentIntent.amount_details.tip.amount` from `nullable(integer)` to `integer`
12
+ * Change `PaymentIntent.amount_details.tip.amount` to be optional
13
+ * Add support for `payment_method_data` on `SetupIntentConfirmParams`, `SetupIntentCreateParams`, and `SetupIntentUpdateParams`
14
+ * [#1409](https://github.com/stripe/stripe-node/pull/1409) Update autoPagination tests to be hermetic.
15
+ * [#1411](https://github.com/stripe/stripe-node/pull/1411) Enable CI on beta branch
16
+
3
17
  ## 8.220.0 - 2022-05-03
4
18
  * [#1407](https://github.com/stripe/stripe-node/pull/1407) API Updates
5
19
  * Add support for new resource `CashBalance`
package/VERSION CHANGED
@@ -1 +1 @@
1
- 8.220.0
1
+ 8.221.0
@@ -0,0 +1,25 @@
1
+ // File generated from our OpenAPI spec
2
+
3
+ 'use strict';
4
+
5
+ const StripeResource = require('../../StripeResource');
6
+ const stripeMethod = StripeResource.method;
7
+
8
+ module.exports = StripeResource.extend({
9
+ path: 'financial_connections/accounts',
10
+
11
+ retrieve: stripeMethod({
12
+ method: 'GET',
13
+ path: '/{account}',
14
+ }),
15
+
16
+ disconnect: stripeMethod({
17
+ method: 'POST',
18
+ path: '/{account}/disconnect',
19
+ }),
20
+
21
+ refresh: stripeMethod({
22
+ method: 'POST',
23
+ path: '/{account}/refresh',
24
+ }),
25
+ });
@@ -0,0 +1,20 @@
1
+ // File generated from our OpenAPI spec
2
+
3
+ 'use strict';
4
+
5
+ const StripeResource = require('../../StripeResource');
6
+ const stripeMethod = StripeResource.method;
7
+
8
+ module.exports = StripeResource.extend({
9
+ path: 'financial_connections/sessions',
10
+
11
+ create: stripeMethod({
12
+ method: 'POST',
13
+ path: '',
14
+ }),
15
+
16
+ retrieve: stripeMethod({
17
+ method: 'GET',
18
+ path: '/{session}',
19
+ }),
20
+ });
package/lib/resources.js CHANGED
@@ -63,6 +63,10 @@ module.exports = {
63
63
  Checkout: resourceNamespace('checkout', {
64
64
  Sessions: require('./resources/Checkout/Sessions'),
65
65
  }),
66
+ FinancialConnections: resourceNamespace('financialConnections', {
67
+ Accounts: require('./resources/FinancialConnections/Accounts'),
68
+ Sessions: require('./resources/FinancialConnections/Sessions'),
69
+ }),
66
70
  Identity: resourceNamespace('identity', {
67
71
  VerificationReports: require('./resources/Identity/VerificationReports'),
68
72
  VerificationSessions: require('./resources/Identity/VerificationSessions'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stripe",
3
- "version": "8.220.0",
3
+ "version": "8.221.0",
4
4
  "description": "Stripe API wrapper",
5
5
  "keywords": [
6
6
  "stripe",
@@ -1899,6 +1899,11 @@ declare module 'stripe' {
1899
1899
  */
1900
1900
  political_exposure?: Individual.PoliticalExposure;
1901
1901
 
1902
+ /**
1903
+ * The individual's registered address.
1904
+ */
1905
+ registered_address?: Individual.RegisteredAddress;
1906
+
1902
1907
  /**
1903
1908
  * The last four digits of the individual's Social Security Number (U.S. only).
1904
1909
  */
@@ -1934,6 +1939,10 @@ declare module 'stripe' {
1934
1939
 
1935
1940
  type PoliticalExposure = 'existing' | 'none';
1936
1941
 
1942
+ interface RegisteredAddress extends Omit<Stripe.AddressParam, 'line1'> {
1943
+ line1?: string;
1944
+ }
1945
+
1937
1946
  interface Verification {
1938
1947
  /**
1939
1948
  * A document showing address, either a passport, local ID card, or utility bill from a well-known utility company.
@@ -2980,6 +2989,11 @@ declare module 'stripe' {
2980
2989
  */
2981
2990
  political_exposure?: Individual.PoliticalExposure;
2982
2991
 
2992
+ /**
2993
+ * The individual's registered address.
2994
+ */
2995
+ registered_address?: Individual.RegisteredAddress;
2996
+
2983
2997
  /**
2984
2998
  * The last four digits of the individual's Social Security Number (U.S. only).
2985
2999
  */
@@ -3015,6 +3029,10 @@ declare module 'stripe' {
3015
3029
 
3016
3030
  type PoliticalExposure = 'existing' | 'none';
3017
3031
 
3032
+ interface RegisteredAddress extends Omit<Stripe.AddressParam, 'line1'> {
3033
+ line1?: string;
3034
+ }
3035
+
3018
3036
  interface Verification {
3019
3037
  /**
3020
3038
  * A document showing address, either a passport, local ID card, or utility bill from a well-known utility company.
@@ -535,6 +535,8 @@ declare module 'stripe' {
535
535
  }
536
536
 
537
537
  interface UsBankAccount {
538
+ financial_connections?: UsBankAccount.FinancialConnections;
539
+
538
540
  /**
539
541
  * Bank account verification method.
540
542
  */
@@ -542,6 +544,26 @@ declare module 'stripe' {
542
544
  }
543
545
 
544
546
  namespace UsBankAccount {
547
+ interface FinancialConnections {
548
+ /**
549
+ * The list of permissions to request. The `payment_method` permission must be included.
550
+ */
551
+ permissions?: Array<FinancialConnections.Permission>;
552
+
553
+ /**
554
+ * For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app.
555
+ */
556
+ return_url?: string;
557
+ }
558
+
559
+ namespace FinancialConnections {
560
+ type Permission =
561
+ | 'balances'
562
+ | 'ownership'
563
+ | 'payment_method'
564
+ | 'transactions';
565
+ }
566
+
545
567
  type VerificationMethod = 'automatic' | 'instant';
546
568
  }
547
569
  }
@@ -1658,6 +1680,11 @@ declare module 'stripe' {
1658
1680
  }
1659
1681
 
1660
1682
  interface UsBankAccount {
1683
+ /**
1684
+ * Additional fields for Financial Connections Session creation
1685
+ */
1686
+ financial_connections?: UsBankAccount.FinancialConnections;
1687
+
1661
1688
  /**
1662
1689
  * Verification method for the intent
1663
1690
  */
@@ -1665,6 +1692,21 @@ declare module 'stripe' {
1665
1692
  }
1666
1693
 
1667
1694
  namespace UsBankAccount {
1695
+ interface FinancialConnections {
1696
+ /**
1697
+ * The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `payment_method`, and `transactions`.
1698
+ */
1699
+ permissions?: Array<FinancialConnections.Permission>;
1700
+ }
1701
+
1702
+ namespace FinancialConnections {
1703
+ type Permission =
1704
+ | 'balances'
1705
+ | 'ownership'
1706
+ | 'payment_method'
1707
+ | 'transactions';
1708
+ }
1709
+
1668
1710
  type VerificationMethod = 'automatic' | 'instant';
1669
1711
  }
1670
1712
 
@@ -0,0 +1,52 @@
1
+ // File generated from our OpenAPI spec
2
+
3
+ declare module 'stripe' {
4
+ namespace Stripe {
5
+ namespace FinancialConnections {
6
+ /**
7
+ * The AccountOwner object.
8
+ */
9
+ interface AccountOwner {
10
+ /**
11
+ * Unique identifier for the object.
12
+ */
13
+ id: string;
14
+
15
+ /**
16
+ * String representing the object's type. Objects of the same type share the same value.
17
+ */
18
+ object: 'financial_connections.account_owner';
19
+
20
+ /**
21
+ * The email address of the owner.
22
+ */
23
+ email: string | null;
24
+
25
+ /**
26
+ * The full name of the owner.
27
+ */
28
+ name: string;
29
+
30
+ /**
31
+ * The ownership object that this owner belongs to.
32
+ */
33
+ ownership: string;
34
+
35
+ /**
36
+ * The raw phone number of the owner.
37
+ */
38
+ phone: string | null;
39
+
40
+ /**
41
+ * The raw physical address of the owner.
42
+ */
43
+ raw_address: string | null;
44
+
45
+ /**
46
+ * The timestamp of the refresh that updated this owner.
47
+ */
48
+ refreshed_at: number | null;
49
+ }
50
+ }
51
+ }
52
+ }
@@ -0,0 +1,32 @@
1
+ // File generated from our OpenAPI spec
2
+
3
+ declare module 'stripe' {
4
+ namespace Stripe {
5
+ namespace FinancialConnections {
6
+ /**
7
+ * The AccountOwnership object.
8
+ */
9
+ interface AccountOwnership {
10
+ /**
11
+ * Unique identifier for the object.
12
+ */
13
+ id: string;
14
+
15
+ /**
16
+ * String representing the object's type. Objects of the same type share the same value.
17
+ */
18
+ object: 'financial_connections.account_ownership';
19
+
20
+ /**
21
+ * Time at which the object was created. Measured in seconds since the Unix epoch.
22
+ */
23
+ created: number;
24
+
25
+ /**
26
+ * A paginated list of owners for this account.
27
+ */
28
+ owners: ApiList<Stripe.FinancialConnections.AccountOwner>;
29
+ }
30
+ }
31
+ }
32
+ }
@@ -0,0 +1,311 @@
1
+ // File generated from our OpenAPI spec
2
+
3
+ declare module 'stripe' {
4
+ namespace Stripe {
5
+ namespace FinancialConnections {
6
+ /**
7
+ * The Account object.
8
+ */
9
+ interface Account {
10
+ /**
11
+ * Unique identifier for the object.
12
+ */
13
+ id: string;
14
+
15
+ /**
16
+ * String representing the object's type. Objects of the same type share the same value.
17
+ */
18
+ object: 'financial_connections.account';
19
+
20
+ /**
21
+ * The account holder that this account belongs to.
22
+ */
23
+ account_holder: Account.AccountHolder | null;
24
+
25
+ /**
26
+ * The most recent information about the account's balance.
27
+ */
28
+ balance: Account.Balance | null;
29
+
30
+ /**
31
+ * The state of the most recent attempt to refresh the account balance.
32
+ */
33
+ balance_refresh: Account.BalanceRefresh | null;
34
+
35
+ /**
36
+ * The type of the account. Account category is further divided in `subcategory`.
37
+ */
38
+ category: Account.Category;
39
+
40
+ /**
41
+ * Time at which the object was created. Measured in seconds since the Unix epoch.
42
+ */
43
+ created: number;
44
+
45
+ /**
46
+ * A human-readable name that has been assigned to this account, either by the account holder or by the institution.
47
+ */
48
+ display_name: string | null;
49
+
50
+ /**
51
+ * The name of the institution that holds this account.
52
+ */
53
+ institution_name: string;
54
+
55
+ /**
56
+ * The last 4 digits of the account number. If present, this will be 4 numeric characters.
57
+ */
58
+ last4: string | null;
59
+
60
+ /**
61
+ * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
62
+ */
63
+ livemode: boolean;
64
+
65
+ /**
66
+ * The most recent information about the account's owners.
67
+ */
68
+ ownership: string | Stripe.FinancialConnections.AccountOwnership | null;
69
+
70
+ /**
71
+ * The state of the most recent attempt to refresh the account owners.
72
+ */
73
+ ownership_refresh: Account.OwnershipRefresh | null;
74
+
75
+ /**
76
+ * The list of permissions granted by this account.
77
+ */
78
+ permissions: Array<Account.Permission> | null;
79
+
80
+ /**
81
+ * The status of the link to the account.
82
+ */
83
+ status: Account.Status;
84
+
85
+ /**
86
+ * If `category` is `cash`, one of:
87
+ *
88
+ * - `checking`
89
+ * - `savings`
90
+ * - `other`
91
+ *
92
+ * If `category` is `credit`, one of:
93
+ *
94
+ * - `mortgage`
95
+ * - `line_of_credit`
96
+ * - `credit_card`
97
+ * - `other`
98
+ *
99
+ * If `category` is `investment` or `other`, this will be `other`.
100
+ */
101
+ subcategory: Account.Subcategory;
102
+
103
+ /**
104
+ * The [PaymentMethod type](https://stripe.com/docs/api/payment_methods/object#payment_method_object-type)(s) that can be created from this account.
105
+ */
106
+ supported_payment_method_types: Array<
107
+ Account.SupportedPaymentMethodType
108
+ >;
109
+ }
110
+
111
+ namespace Account {
112
+ interface AccountHolder {
113
+ /**
114
+ * The ID of the Stripe account this account belongs to. Should only be present if `account_holder.type` is `account`.
115
+ */
116
+ account?: string | Stripe.Account;
117
+
118
+ /**
119
+ * ID of the Stripe customer this account belongs to. Present if and only if `account_holder.type` is `customer`.
120
+ */
121
+ customer?: string | Stripe.Customer;
122
+
123
+ /**
124
+ * Type of account holder that this account belongs to.
125
+ */
126
+ type: AccountHolder.Type;
127
+ }
128
+
129
+ namespace AccountHolder {
130
+ type Type = 'account' | 'customer';
131
+ }
132
+
133
+ interface Balance {
134
+ /**
135
+ * The time that the external institution calculated this balance. Measured in seconds since the Unix epoch.
136
+ */
137
+ as_of: number;
138
+
139
+ cash?: Balance.Cash;
140
+
141
+ credit?: Balance.Credit;
142
+
143
+ /**
144
+ * The balances owed to (or by) the account holder.
145
+ *
146
+ * Each key is a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
147
+ *
148
+ * 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.
149
+ */
150
+ current: {
151
+ [key: string]: number;
152
+ };
153
+
154
+ /**
155
+ * The `type` of the balance. An additional hash is included on the balance with a name matching this value.
156
+ */
157
+ type: Balance.Type;
158
+ }
159
+
160
+ namespace Balance {
161
+ interface Cash {
162
+ /**
163
+ * The funds available to the account holder. Typically this is the current balance less any holds.
164
+ *
165
+ * Each key is a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
166
+ *
167
+ * 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.
168
+ */
169
+ available: {
170
+ [key: string]: number;
171
+ } | null;
172
+ }
173
+
174
+ interface Credit {
175
+ /**
176
+ * The credit that has been used by the account holder.
177
+ *
178
+ * Each key is a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
179
+ *
180
+ * 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.
181
+ */
182
+ used: {
183
+ [key: string]: number;
184
+ } | null;
185
+ }
186
+
187
+ type Type = 'cash' | 'credit';
188
+ }
189
+
190
+ interface BalanceRefresh {
191
+ /**
192
+ * The time at which the last refresh attempt was initiated. Measured in seconds since the Unix epoch.
193
+ */
194
+ last_attempted_at: number;
195
+
196
+ /**
197
+ * The status of the last refresh attempt.
198
+ */
199
+ status: BalanceRefresh.Status;
200
+ }
201
+
202
+ namespace BalanceRefresh {
203
+ type Status = 'failed' | 'pending' | 'succeeded';
204
+ }
205
+
206
+ type Category = 'cash' | 'credit' | 'investment' | 'other';
207
+
208
+ interface OwnershipRefresh {
209
+ /**
210
+ * The time at which the last refresh attempt was initiated. Measured in seconds since the Unix epoch.
211
+ */
212
+ last_attempted_at: number;
213
+
214
+ /**
215
+ * The status of the last refresh attempt.
216
+ */
217
+ status: OwnershipRefresh.Status;
218
+ }
219
+
220
+ namespace OwnershipRefresh {
221
+ type Status = 'failed' | 'pending' | 'succeeded';
222
+ }
223
+
224
+ type Permission =
225
+ | 'balances'
226
+ | 'ownership'
227
+ | 'payment_method'
228
+ | 'transactions';
229
+
230
+ type Status = 'active' | 'disconnected' | 'inactive';
231
+
232
+ type Subcategory =
233
+ | 'checking'
234
+ | 'credit_card'
235
+ | 'line_of_credit'
236
+ | 'mortgage'
237
+ | 'other'
238
+ | 'savings';
239
+
240
+ type SupportedPaymentMethodType = 'link' | 'us_bank_account';
241
+ }
242
+
243
+ interface AccountRetrieveParams {
244
+ /**
245
+ * Specifies which fields in the response should be expanded.
246
+ */
247
+ expand?: Array<string>;
248
+ }
249
+
250
+ interface AccountDisconnectParams {
251
+ /**
252
+ * Specifies which fields in the response should be expanded.
253
+ */
254
+ expand?: Array<string>;
255
+ }
256
+
257
+ interface AccountRefreshParams {
258
+ /**
259
+ * The list of account features that you would like to refresh. Either: `balance` or `ownership`.
260
+ */
261
+ features: Array<AccountRefreshParams.Feature>;
262
+
263
+ /**
264
+ * Specifies which fields in the response should be expanded.
265
+ */
266
+ expand?: Array<string>;
267
+ }
268
+
269
+ namespace AccountRefreshParams {
270
+ type Feature = 'balance' | 'ownership';
271
+ }
272
+
273
+ class AccountsResource {
274
+ /**
275
+ * Retrieves the details of an Financial Connections Account.
276
+ */
277
+ retrieve(
278
+ id: string,
279
+ params?: AccountRetrieveParams,
280
+ options?: RequestOptions
281
+ ): Promise<Stripe.Response<Stripe.FinancialConnections.Account>>;
282
+ retrieve(
283
+ id: string,
284
+ options?: RequestOptions
285
+ ): Promise<Stripe.Response<Stripe.FinancialConnections.Account>>;
286
+
287
+ /**
288
+ * 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).
289
+ */
290
+ disconnect(
291
+ id: string,
292
+ params?: AccountDisconnectParams,
293
+ options?: RequestOptions
294
+ ): Promise<Stripe.Response<Stripe.FinancialConnections.Account>>;
295
+ disconnect(
296
+ id: string,
297
+ options?: RequestOptions
298
+ ): Promise<Stripe.Response<Stripe.FinancialConnections.Account>>;
299
+
300
+ /**
301
+ * Refreshes the data associated with a Financial Connections Account.
302
+ */
303
+ refresh(
304
+ id: string,
305
+ params: AccountRefreshParams,
306
+ options?: RequestOptions
307
+ ): Promise<Stripe.Response<Stripe.FinancialConnections.Account>>;
308
+ }
309
+ }
310
+ }
311
+ }