stripe 9.0.0 → 9.3.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.
Files changed (69) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/VERSION +1 -1
  3. package/lib/resources/Apps/Secrets.js +31 -0
  4. package/lib/resources/Customers.js +5 -0
  5. package/lib/resources/FinancialConnections/Accounts.js +12 -0
  6. package/lib/resources/TestHelpers/Treasury/InboundTransfers.js +25 -0
  7. package/lib/resources/TestHelpers/Treasury/OutboundPayments.js +25 -0
  8. package/lib/resources/TestHelpers/Treasury/OutboundTransfers.js +25 -0
  9. package/lib/resources/TestHelpers/Treasury/ReceivedCredits.js +15 -0
  10. package/lib/resources/TestHelpers/Treasury/ReceivedDebits.js +15 -0
  11. package/lib/resources/Treasury/CreditReversals.js +26 -0
  12. package/lib/resources/Treasury/DebitReversals.js +26 -0
  13. package/lib/resources/Treasury/FinancialAccounts.js +41 -0
  14. package/lib/resources/Treasury/InboundTransfers.js +31 -0
  15. package/lib/resources/Treasury/OutboundPayments.js +31 -0
  16. package/lib/resources/Treasury/OutboundTransfers.js +31 -0
  17. package/lib/resources/Treasury/ReceivedCredits.js +21 -0
  18. package/lib/resources/Treasury/ReceivedDebits.js +21 -0
  19. package/lib/resources/Treasury/TransactionEntries.js +21 -0
  20. package/lib/resources/Treasury/Transactions.js +21 -0
  21. package/lib/resources.js +22 -0
  22. package/package.json +1 -1
  23. package/types/2020-08-27/Accounts.d.ts +5 -5
  24. package/types/2020-08-27/Apps/Secrets.d.ts +241 -0
  25. package/types/2020-08-27/BillingPortal/Configurations.d.ts +1 -1
  26. package/types/2020-08-27/BillingPortal/Sessions.d.ts +1 -1
  27. package/types/2020-08-27/Charges.d.ts +8 -0
  28. package/types/2020-08-27/Checkout/Sessions.d.ts +51 -3
  29. package/types/2020-08-27/Customers.d.ts +24 -0
  30. package/types/2020-08-27/Discounts.d.ts +4 -4
  31. package/types/2020-08-27/FinancialConnections/Accounts.d.ts +63 -0
  32. package/types/2020-08-27/Invoices.d.ts +3 -0
  33. package/types/2020-08-27/Issuing/Authorizations.d.ts +22 -0
  34. package/types/2020-08-27/Issuing/Cards.d.ts +7 -0
  35. package/types/2020-08-27/Issuing/Disputes.d.ts +29 -0
  36. package/types/2020-08-27/Issuing/Transactions.d.ts +17 -0
  37. package/types/2020-08-27/LineItems.d.ts +2 -3
  38. package/types/2020-08-27/Mandates.d.ts +4 -0
  39. package/types/2020-08-27/Orders.d.ts +84 -4
  40. package/types/2020-08-27/PaymentIntents.d.ts +332 -2
  41. package/types/2020-08-27/PaymentLinks.d.ts +167 -0
  42. package/types/2020-08-27/PaymentMethods.d.ts +73 -0
  43. package/types/2020-08-27/PromotionCodes.d.ts +2 -2
  44. package/types/2020-08-27/Quotes.d.ts +6 -9
  45. package/types/2020-08-27/Refunds.d.ts +1 -1
  46. package/types/2020-08-27/SetupAttempts.d.ts +4 -0
  47. package/types/2020-08-27/SetupIntents.d.ts +157 -0
  48. package/types/2020-08-27/SubscriptionSchedules.d.ts +15 -0
  49. package/types/2020-08-27/Subscriptions.d.ts +41 -2
  50. package/types/2020-08-27/Terminal/Configurations.d.ts +63 -0
  51. package/types/2020-08-27/TestHelpers/Treasury/InboundTransfers.d.ts +108 -0
  52. package/types/2020-08-27/TestHelpers/Treasury/OutboundPayments.d.ts +105 -0
  53. package/types/2020-08-27/TestHelpers/Treasury/OutboundTransfers.d.ts +105 -0
  54. package/types/2020-08-27/TestHelpers/Treasury/ReceivedCredits.d.ts +93 -0
  55. package/types/2020-08-27/TestHelpers/Treasury/ReceivedDebits.d.ts +91 -0
  56. package/types/2020-08-27/Tokens.d.ts +2 -2
  57. package/types/2020-08-27/Treasury/CreditReversals.d.ts +168 -0
  58. package/types/2020-08-27/Treasury/DebitReversals.d.ts +187 -0
  59. package/types/2020-08-27/Treasury/FinancialAccountFeatures.d.ts +622 -0
  60. package/types/2020-08-27/Treasury/FinancialAccounts.d.ts +833 -0
  61. package/types/2020-08-27/Treasury/InboundTransfers.d.ts +349 -0
  62. package/types/2020-08-27/Treasury/OutboundPayments.d.ts +550 -0
  63. package/types/2020-08-27/Treasury/OutboundTransfers.d.ts +385 -0
  64. package/types/2020-08-27/Treasury/ReceivedCredits.d.ts +303 -0
  65. package/types/2020-08-27/Treasury/ReceivedDebits.d.ts +231 -0
  66. package/types/2020-08-27/Treasury/TransactionEntries.d.ts +257 -0
  67. package/types/2020-08-27/Treasury/Transactions.d.ts +268 -0
  68. package/types/2020-08-27/WebhookEndpoints.d.ts +62 -2
  69. package/types/2020-08-27/index.d.ts +39 -0
@@ -0,0 +1,231 @@
1
+ // File generated from our OpenAPI spec
2
+
3
+ declare module 'stripe' {
4
+ namespace Stripe {
5
+ namespace Treasury {
6
+ /**
7
+ * The ReceivedDebit object.
8
+ */
9
+ interface ReceivedDebit {
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: 'treasury.received_debit';
19
+
20
+ /**
21
+ * Amount (in cents) transferred.
22
+ */
23
+ amount: number;
24
+
25
+ /**
26
+ * Time at which the object was created. Measured in seconds since the Unix epoch.
27
+ */
28
+ created: number;
29
+
30
+ /**
31
+ * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
32
+ */
33
+ currency: string;
34
+
35
+ /**
36
+ * An arbitrary string attached to the object. Often useful for displaying to users.
37
+ */
38
+ description: string;
39
+
40
+ /**
41
+ * Reason for the failure. A ReceivedDebit might fail because the FinancialAccount doesn't have sufficient funds, is closed, or is frozen.
42
+ */
43
+ failure_code: ReceivedDebit.FailureCode | null;
44
+
45
+ /**
46
+ * The FinancialAccount that funds were pulled from.
47
+ */
48
+ financial_account: string | null;
49
+
50
+ initiating_payment_method_details?: ReceivedDebit.InitiatingPaymentMethodDetails;
51
+
52
+ linked_flows: ReceivedDebit.LinkedFlows;
53
+
54
+ /**
55
+ * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
56
+ */
57
+ livemode: boolean;
58
+
59
+ /**
60
+ * The network used for the ReceivedDebit.
61
+ */
62
+ network: ReceivedDebit.Network;
63
+
64
+ /**
65
+ * Status of the ReceivedDebit. ReceivedDebits are created with a status of either `succeeded` (approved) or `failed` (declined). The failure reason can be found under the `failure_code`.
66
+ */
67
+ status: ReceivedDebit.Status;
68
+
69
+ /**
70
+ * The Transaction associated with this object.
71
+ */
72
+ transaction: string | Stripe.Treasury.Transaction | null;
73
+ }
74
+
75
+ namespace ReceivedDebit {
76
+ type FailureCode =
77
+ | 'account_closed'
78
+ | 'account_frozen'
79
+ | 'insufficient_funds'
80
+ | 'other';
81
+
82
+ interface InitiatingPaymentMethodDetails {
83
+ /**
84
+ * Set when `type` is `balance`.
85
+ */
86
+ balance?: 'payments';
87
+
88
+ billing_details: InitiatingPaymentMethodDetails.BillingDetails;
89
+
90
+ financial_account?: InitiatingPaymentMethodDetails.FinancialAccount;
91
+
92
+ /**
93
+ * Set when `type` is `issuing_card`. This is an [Issuing Card](https://stripe.com/docs/api#issuing_cards) ID.
94
+ */
95
+ issuing_card?: string;
96
+
97
+ /**
98
+ * Polymorphic type matching the originating money movement's source. This can be an external account, a Stripe balance, or a FinancialAccount.
99
+ */
100
+ type: InitiatingPaymentMethodDetails.Type;
101
+
102
+ us_bank_account?: InitiatingPaymentMethodDetails.UsBankAccount;
103
+ }
104
+
105
+ namespace InitiatingPaymentMethodDetails {
106
+ interface BillingDetails {
107
+ address: Stripe.Address;
108
+
109
+ /**
110
+ * Email address.
111
+ */
112
+ email: string | null;
113
+
114
+ /**
115
+ * Full name.
116
+ */
117
+ name: string | null;
118
+ }
119
+
120
+ interface FinancialAccount {
121
+ /**
122
+ * The FinancialAccount ID.
123
+ */
124
+ id: string;
125
+
126
+ /**
127
+ * The rails the ReceivedCredit was sent over. A FinancialAccount can only send funds over `stripe`.
128
+ */
129
+ network: 'stripe';
130
+ }
131
+
132
+ type Type =
133
+ | 'balance'
134
+ | 'financial_account'
135
+ | 'issuing_card'
136
+ | 'stripe'
137
+ | 'us_bank_account';
138
+
139
+ interface UsBankAccount {
140
+ /**
141
+ * Bank name.
142
+ */
143
+ bank_name: string | null;
144
+
145
+ /**
146
+ * The last four digits of the bank account number.
147
+ */
148
+ last4: string | null;
149
+
150
+ /**
151
+ * The routing number for the bank account.
152
+ */
153
+ routing_number: string | null;
154
+ }
155
+ }
156
+
157
+ interface LinkedFlows {
158
+ /**
159
+ * Set if the ReceivedDebit is associated with an InboundTransfer's return of funds.
160
+ */
161
+ inbound_transfer: string | null;
162
+
163
+ /**
164
+ * Set if the ReceivedCredit was created due to an [Issuing Authorization](https://stripe.com/docs/api#issuing_authorizations) object.
165
+ */
166
+ issuing_authorization: string | null;
167
+
168
+ /**
169
+ * Set if the ReceivedDebit is also viewable as an [Issuing Dispute](https://stripe.com/docs/api#issuing_disputes) object.
170
+ */
171
+ issuing_transaction: string | null;
172
+ }
173
+
174
+ type Network = 'ach' | 'card' | 'stripe';
175
+
176
+ type Status = 'failed' | 'succeeded';
177
+ }
178
+
179
+ interface ReceivedDebitRetrieveParams {
180
+ /**
181
+ * Specifies which fields in the response should be expanded.
182
+ */
183
+ expand?: Array<string>;
184
+ }
185
+
186
+ interface ReceivedDebitListParams extends PaginationParams {
187
+ /**
188
+ * The FinancialAccount that funds were pulled from.
189
+ */
190
+ financial_account: string;
191
+
192
+ /**
193
+ * Specifies which fields in the response should be expanded.
194
+ */
195
+ expand?: Array<string>;
196
+
197
+ /**
198
+ * Only return ReceivedDebits that have the given status: `succeeded` or `failed`.
199
+ */
200
+ status?: ReceivedDebitListParams.Status;
201
+ }
202
+
203
+ namespace ReceivedDebitListParams {
204
+ type Status = 'failed' | 'succeeded';
205
+ }
206
+
207
+ class ReceivedDebitsResource {
208
+ /**
209
+ * Retrieves the details of an existing ReceivedDebit by passing the unique ReceivedDebit ID from the ReceivedDebit list
210
+ */
211
+ retrieve(
212
+ id: string,
213
+ params?: ReceivedDebitRetrieveParams,
214
+ options?: RequestOptions
215
+ ): Promise<Stripe.Response<Stripe.Treasury.ReceivedDebit>>;
216
+ retrieve(
217
+ id: string,
218
+ options?: RequestOptions
219
+ ): Promise<Stripe.Response<Stripe.Treasury.ReceivedDebit>>;
220
+
221
+ /**
222
+ * Returns a list of ReceivedDebits.
223
+ */
224
+ list(
225
+ params: ReceivedDebitListParams,
226
+ options?: RequestOptions
227
+ ): ApiListPromise<Stripe.Treasury.ReceivedDebit>;
228
+ }
229
+ }
230
+ }
231
+ }
@@ -0,0 +1,257 @@
1
+ // File generated from our OpenAPI spec
2
+
3
+ declare module 'stripe' {
4
+ namespace Stripe {
5
+ namespace Treasury {
6
+ /**
7
+ * The TransactionEntry object.
8
+ */
9
+ interface TransactionEntry {
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: 'treasury.transaction_entry';
19
+
20
+ /**
21
+ * Change to a FinancialAccount's balance
22
+ */
23
+ balance_impact: TransactionEntry.BalanceImpact;
24
+
25
+ /**
26
+ * Time at which the object was created. Measured in seconds since the Unix epoch.
27
+ */
28
+ created: number;
29
+
30
+ /**
31
+ * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
32
+ */
33
+ currency: string;
34
+
35
+ /**
36
+ * When the TransactionEntry will impact the FinancialAccount's balance.
37
+ */
38
+ effective_at: number;
39
+
40
+ /**
41
+ * The FinancialAccount associated with this object.
42
+ */
43
+ financial_account: string;
44
+
45
+ /**
46
+ * Token of the flow associated with the TransactionEntry.
47
+ */
48
+ flow: string | null;
49
+
50
+ /**
51
+ * Details of the flow associated with the TransactionEntry.
52
+ */
53
+ flow_details: TransactionEntry.FlowDetails | null;
54
+
55
+ /**
56
+ * Type of the flow associated with the TransactionEntry.
57
+ */
58
+ flow_type: TransactionEntry.FlowType;
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 Transaction associated with this object.
67
+ */
68
+ transaction: string | Stripe.Treasury.Transaction;
69
+
70
+ /**
71
+ * The specific money movement that generated the TransactionEntry.
72
+ */
73
+ type: TransactionEntry.Type;
74
+ }
75
+
76
+ namespace TransactionEntry {
77
+ interface BalanceImpact {
78
+ /**
79
+ * The change made to funds the user can spend right now.
80
+ */
81
+ cash: number;
82
+
83
+ /**
84
+ * The change made to funds that are not spendable yet, but will become available at a later time.
85
+ */
86
+ inbound_pending: number;
87
+
88
+ /**
89
+ * The change made to funds in the account, but not spendable because they are being held for pending outbound flows.
90
+ */
91
+ outbound_pending: number;
92
+ }
93
+
94
+ interface FlowDetails {
95
+ /**
96
+ * You can reverse some [ReceivedCredits](https://stripe.com/docs/api#received_credits) depending on their network and source flow. Reversing a ReceivedCredit leads to the creation of a new object known as a CreditReversal.
97
+ */
98
+ credit_reversal?: Stripe.Treasury.CreditReversal;
99
+
100
+ /**
101
+ * You can reverse some [ReceivedDebits](https://stripe.com/docs/api#received_debits) depending on their network and source flow. Reversing a ReceivedDebit leads to the creation of a new object known as a DebitReversal.
102
+ */
103
+ debit_reversal?: Stripe.Treasury.DebitReversal;
104
+
105
+ /**
106
+ * Use InboundTransfers to add funds to your [FinancialAccount](https://stripe.com/docs/api#financial_accounts) via a PaymentMethod that is owned by you. The funds will be transferred via an ACH debit.
107
+ */
108
+ inbound_transfer?: Stripe.Treasury.InboundTransfer;
109
+
110
+ /**
111
+ * When an [issued card](https://stripe.com/docs/issuing) is used to make a purchase, an Issuing `Authorization`
112
+ * object is created. [Authorizations](https://stripe.com/docs/issuing/purchases/authorizations) must be approved for the
113
+ * purchase to be completed successfully.
114
+ *
115
+ * Related guide: [Issued Card Authorizations](https://stripe.com/docs/issuing/purchases/authorizations).
116
+ */
117
+ issuing_authorization?: Stripe.Issuing.Authorization;
118
+
119
+ /**
120
+ * Use OutboundPayments to send funds to another party's external bank account or [FinancialAccount](https://stripe.com/docs/api#financial_accounts). To send money to an account belonging to the same user, use an [OutboundTransfer](https://stripe.com/docs/api#outbound_transfers).
121
+ *
122
+ * Simulate OutboundPayment state changes with the `/v1/test_helpers/treasury/outbound_payments` endpoints. These methods can only be called on test mode objects.
123
+ */
124
+ outbound_payment?: Stripe.Treasury.OutboundPayment;
125
+
126
+ /**
127
+ * Use OutboundTransfers to transfer funds from a [FinancialAccount](https://stripe.com/docs/api#financial_accounts) to a PaymentMethod belonging to the same entity. To send funds to a different party, use [OutboundPayments](https://stripe.com/docs/api#outbound_payments) instead. You can send funds over ACH rails or through a domestic wire transfer to a user's own external bank account.
128
+ *
129
+ * Simulate OutboundTransfer state changes with the `/v1/test_helpers/treasury/outbound_transfers` endpoints. These methods can only be called on test mode objects.
130
+ */
131
+ outbound_transfer?: Stripe.Treasury.OutboundTransfer;
132
+
133
+ /**
134
+ * ReceivedCredits represent funds sent to a [FinancialAccount](https://stripe.com/docs/api#financial_accounts) (for example, via ACH or wire). These money movements are not initiated from the FinancialAccount.
135
+ */
136
+ received_credit?: Stripe.Treasury.ReceivedCredit;
137
+
138
+ /**
139
+ * ReceivedDebits represent funds pulled from a [FinancialAccount](https://stripe.com/docs/api#financial_accounts). These are not initiated from the FinancialAccount.
140
+ */
141
+ received_debit?: Stripe.Treasury.ReceivedDebit;
142
+
143
+ /**
144
+ * Type of the flow that created the Transaction. Set to the same value as `flow_type`.
145
+ */
146
+ type: FlowDetails.Type;
147
+ }
148
+
149
+ namespace FlowDetails {
150
+ type Type =
151
+ | 'credit_reversal'
152
+ | 'debit_reversal'
153
+ | 'inbound_transfer'
154
+ | 'issuing_authorization'
155
+ | 'other'
156
+ | 'outbound_payment'
157
+ | 'outbound_transfer'
158
+ | 'received_credit'
159
+ | 'received_debit';
160
+ }
161
+
162
+ type FlowType =
163
+ | 'credit_reversal'
164
+ | 'debit_reversal'
165
+ | 'inbound_transfer'
166
+ | 'issuing_authorization'
167
+ | 'other'
168
+ | 'outbound_payment'
169
+ | 'outbound_transfer'
170
+ | 'received_credit'
171
+ | 'received_debit';
172
+
173
+ type Type =
174
+ | 'credit_reversal'
175
+ | 'credit_reversal_posting'
176
+ | 'debit_reversal'
177
+ | 'inbound_transfer'
178
+ | 'inbound_transfer_return'
179
+ | 'issuing_authorization_hold'
180
+ | 'issuing_authorization_release'
181
+ | 'other'
182
+ | 'outbound_payment'
183
+ | 'outbound_payment_cancellation'
184
+ | 'outbound_payment_failure'
185
+ | 'outbound_payment_posting'
186
+ | 'outbound_payment_return'
187
+ | 'outbound_transfer'
188
+ | 'outbound_transfer_cancellation'
189
+ | 'outbound_transfer_failure'
190
+ | 'outbound_transfer_posting'
191
+ | 'outbound_transfer_return'
192
+ | 'received_credit'
193
+ | 'received_debit';
194
+ }
195
+
196
+ interface TransactionEntryRetrieveParams {
197
+ /**
198
+ * Specifies which fields in the response should be expanded.
199
+ */
200
+ expand?: Array<string>;
201
+ }
202
+
203
+ interface TransactionEntryListParams extends PaginationParams {
204
+ /**
205
+ * Returns objects associated with this FinancialAccount.
206
+ */
207
+ financial_account: string;
208
+
209
+ created?: Stripe.RangeQueryParam | number;
210
+
211
+ effective_at?: Stripe.RangeQueryParam | number;
212
+
213
+ /**
214
+ * Specifies which fields in the response should be expanded.
215
+ */
216
+ expand?: Array<string>;
217
+
218
+ /**
219
+ * The results are in reverse chronological order by `created` or `effective_at`. The default is `created`.
220
+ */
221
+ order_by?: TransactionEntryListParams.OrderBy;
222
+
223
+ /**
224
+ * Only return TransactionEntries associated with this Transaction.
225
+ */
226
+ transaction?: string;
227
+ }
228
+
229
+ namespace TransactionEntryListParams {
230
+ type OrderBy = 'created' | 'effective_at';
231
+ }
232
+
233
+ class TransactionEntriesResource {
234
+ /**
235
+ * Retrieves a TransactionEntry object.
236
+ */
237
+ retrieve(
238
+ id: string,
239
+ params?: TransactionEntryRetrieveParams,
240
+ options?: RequestOptions
241
+ ): Promise<Stripe.Response<Stripe.Treasury.TransactionEntry>>;
242
+ retrieve(
243
+ id: string,
244
+ options?: RequestOptions
245
+ ): Promise<Stripe.Response<Stripe.Treasury.TransactionEntry>>;
246
+
247
+ /**
248
+ * Retrieves a list of TransactionEntry objects.
249
+ */
250
+ list(
251
+ params: TransactionEntryListParams,
252
+ options?: RequestOptions
253
+ ): ApiListPromise<Stripe.Treasury.TransactionEntry>;
254
+ }
255
+ }
256
+ }
257
+ }