stripe 16.12.0 → 17.0.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 (96) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/README.md +34 -0
  3. package/VERSION +1 -1
  4. package/cjs/Error.js +31 -4
  5. package/cjs/RequestSender.js +164 -63
  6. package/cjs/StripeResource.js +8 -3
  7. package/cjs/apiVersion.js +1 -1
  8. package/cjs/autoPagination.js +51 -7
  9. package/cjs/crypto/CryptoProvider.js +6 -0
  10. package/cjs/crypto/NodeCryptoProvider.js +7 -0
  11. package/cjs/crypto/SubtleCryptoProvider.js +4 -0
  12. package/cjs/multipart.js +1 -1
  13. package/cjs/resources/Billing/CreditBalanceSummary.js +12 -0
  14. package/cjs/resources/Billing/CreditBalanceTransactions.js +17 -0
  15. package/cjs/resources/Billing/CreditGrants.js +30 -0
  16. package/cjs/resources/OAuth.js +1 -1
  17. package/cjs/resources/V2/Billing/MeterEventAdjustments.js +12 -0
  18. package/cjs/resources/V2/Billing/MeterEventSession.js +12 -0
  19. package/cjs/resources/V2/Billing/MeterEventStream.js +13 -0
  20. package/cjs/resources/V2/Billing/MeterEvents.js +9 -0
  21. package/cjs/resources/V2/Billing.js +18 -0
  22. package/cjs/resources/V2/Core/Events.js +14 -0
  23. package/cjs/resources/V2/Core.js +12 -0
  24. package/cjs/resources/V2.js +14 -0
  25. package/cjs/resources.js +9 -1
  26. package/cjs/stripe.core.js +25 -10
  27. package/cjs/utils.js +64 -6
  28. package/esm/Error.js +27 -2
  29. package/esm/RequestSender.js +165 -64
  30. package/esm/StripeResource.js +9 -4
  31. package/esm/apiVersion.js +1 -1
  32. package/esm/autoPagination.js +52 -8
  33. package/esm/crypto/CryptoProvider.js +6 -0
  34. package/esm/crypto/NodeCryptoProvider.js +7 -0
  35. package/esm/crypto/SubtleCryptoProvider.js +4 -0
  36. package/esm/multipart.js +2 -2
  37. package/esm/resources/Billing/CreditBalanceSummary.js +9 -0
  38. package/esm/resources/Billing/CreditBalanceTransactions.js +14 -0
  39. package/esm/resources/Billing/CreditGrants.js +27 -0
  40. package/esm/resources/OAuth.js +2 -2
  41. package/esm/resources/V2/Billing/MeterEventAdjustments.js +9 -0
  42. package/esm/resources/V2/Billing/MeterEventSession.js +9 -0
  43. package/esm/resources/V2/Billing/MeterEventStream.js +10 -0
  44. package/esm/resources/V2/Billing/MeterEvents.js +6 -0
  45. package/esm/resources/V2/Billing.js +15 -0
  46. package/esm/resources/V2/Core/Events.js +11 -0
  47. package/esm/resources/V2/Core.js +9 -0
  48. package/esm/resources/V2.js +11 -0
  49. package/esm/resources.js +7 -0
  50. package/esm/stripe.core.js +26 -11
  51. package/esm/utils.js +59 -4
  52. package/package.json +1 -1
  53. package/types/Billing/Alerts.d.ts +17 -13
  54. package/types/Billing/AlertsResource.d.ts +18 -21
  55. package/types/Billing/CreditBalanceSummary.d.ts +94 -0
  56. package/types/Billing/CreditBalanceSummaryResource.d.ts +64 -0
  57. package/types/Billing/CreditBalanceTransactions.d.ts +159 -0
  58. package/types/Billing/CreditBalanceTransactionsResource.d.ts +54 -0
  59. package/types/Billing/CreditGrants.d.ts +124 -0
  60. package/types/Billing/CreditGrantsResource.d.ts +219 -0
  61. package/types/BillingPortal/ConfigurationsResource.d.ts +2 -2
  62. package/types/Capabilities.d.ts +1 -1
  63. package/types/Checkout/SessionsResource.d.ts +1 -1
  64. package/types/CreditNoteLineItems.d.ts +30 -0
  65. package/types/CreditNotes.d.ts +30 -0
  66. package/types/Customers.d.ts +2 -3
  67. package/types/Errors.d.ts +32 -2
  68. package/types/EventTypes.d.ts +2 -0
  69. package/types/InvoiceLineItems.d.ts +36 -0
  70. package/types/Invoices.d.ts +38 -0
  71. package/types/Margins.d.ts +56 -0
  72. package/types/ProductsResource.d.ts +28 -1
  73. package/types/PromotionCodes.d.ts +1 -1
  74. package/types/PromotionCodesResource.d.ts +3 -1
  75. package/types/SubscriptionsResource.d.ts +3 -3
  76. package/types/Tax/Settings.d.ts +1 -1
  77. package/types/Terminal/ReadersResource.d.ts +13 -4
  78. package/types/ThinEvent.d.ts +36 -0
  79. package/types/Treasury/ReceivedCredits.d.ts +5 -1
  80. package/types/V2/Billing/MeterEventAdjustments.d.ts +65 -0
  81. package/types/V2/Billing/MeterEventAdjustmentsResource.d.ts +47 -0
  82. package/types/V2/Billing/MeterEventSessionResource.d.ts +26 -0
  83. package/types/V2/Billing/MeterEventSessions.d.ts +45 -0
  84. package/types/V2/Billing/MeterEventStreamResource.d.ts +62 -0
  85. package/types/V2/Billing/MeterEvents.d.ts +54 -0
  86. package/types/V2/Billing/MeterEventsResource.d.ts +52 -0
  87. package/types/V2/BillingResource.d.ts +14 -0
  88. package/types/V2/Core/EventsResource.d.ts +57 -0
  89. package/types/V2/CoreResource.d.ts +11 -0
  90. package/types/V2/EventTypes.d.ts +214 -0
  91. package/types/V2/Events.d.ts +75 -0
  92. package/types/V2Resource.d.ts +10 -0
  93. package/types/WebhookEndpointsResource.d.ts +2 -1
  94. package/types/index.d.ts +87 -0
  95. package/types/lib.d.ts +8 -1
  96. package/types/test/typescriptTest.ts +3 -3
package/types/Errors.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  declare module 'stripe' {
2
2
  namespace Stripe {
3
+ // rawErrorTypeEnum: The beginning of the section generated from our OpenAPI spec
3
4
  export type RawErrorType =
4
5
  | 'card_error'
5
6
  | 'invalid_request_error'
@@ -7,10 +8,13 @@ declare module 'stripe' {
7
8
  | 'idempotency_error'
8
9
  | 'rate_limit_error'
9
10
  | 'authentication_error'
10
- | 'invalid_grant';
11
+ | 'invalid_grant'
12
+ | 'temporary_session_expired';
13
+ // rawErrorTypeEnum: The end of the section generated from our OpenAPI spec
11
14
 
12
15
  export type StripeRawError = {
13
16
  message?: string;
17
+ userMessage?: string;
14
18
 
15
19
  type: RawErrorType;
16
20
 
@@ -32,27 +36,35 @@ declare module 'stripe' {
32
36
  };
33
37
 
34
38
  namespace errors {
39
+ /** @deprecated Not for external use. */
35
40
  function generate(
36
41
  rawError: StripeRawError & {type: 'card_error'}
37
42
  ): StripeCardError;
43
+ /** @deprecated Not for external use. */
38
44
  function generate(
39
45
  rawError: StripeRawError & {type: 'invalid_request_error'}
40
46
  ): StripeInvalidRequestError;
47
+ /** @deprecated Not for external use. */
41
48
  function generate(
42
49
  rawError: StripeRawError & {type: 'api_error'}
43
50
  ): StripeAPIError;
51
+ /** @deprecated Not for external use. */
44
52
  function generate(
45
53
  rawError: StripeRawError & {type: 'authentication_error'}
46
54
  ): StripeAuthenticationError;
55
+ /** @deprecated Not for external use. */
47
56
  function generate(
48
57
  rawError: StripeRawError & {type: 'rate_limit_error'}
49
58
  ): StripeRateLimitError;
59
+ /** @deprecated Not for external use. */
50
60
  function generate(
51
61
  rawError: StripeRawError & {type: 'idempotency_error'}
52
62
  ): StripeIdempotencyError;
63
+ /** @deprecated Not for external use. */
53
64
  function generate(
54
65
  rawError: StripeRawError & {type: 'invalid_grant'}
55
66
  ): StripeInvalidGrantError;
67
+ /** @deprecated Not for external use. */
56
68
  function generate(
57
69
  rawError: StripeRawError & {type: RawErrorType}
58
70
  ): StripeError;
@@ -60,27 +72,35 @@ declare module 'stripe' {
60
72
  class StripeError extends Error {
61
73
  constructor(rawError: StripeRawError);
62
74
 
75
+ /** @deprecated Not for external use. */
63
76
  static generate(
64
77
  rawError: StripeRawError & {type: 'card_error'}
65
78
  ): StripeCardError;
79
+ /** @deprecated Not for external use. */
66
80
  static generate(
67
81
  rawError: StripeRawError & {type: 'invalid_request_error'}
68
82
  ): StripeInvalidRequestError;
83
+ /** @deprecated Not for external use. */
69
84
  static generate(
70
85
  rawError: StripeRawError & {type: 'api_error'}
71
86
  ): StripeAPIError;
87
+ /** @deprecated Not for external use. */
72
88
  static generate(
73
89
  rawError: StripeRawError & {type: 'authentication_error'}
74
90
  ): StripeAuthenticationError;
91
+ /** @deprecated Not for external use. */
75
92
  static generate(
76
93
  rawError: StripeRawError & {type: 'rate_limit_error'}
77
94
  ): StripeRateLimitError;
95
+ /** @deprecated Not for external use. */
78
96
  static generate(
79
97
  rawError: StripeRawError & {type: 'idempotency_error'}
80
98
  ): StripeIdempotencyError;
99
+ /** @deprecated Not for external use. */
81
100
  static generate(
82
101
  rawError: StripeRawError & {type: 'invalid_grant'}
83
102
  ): StripeInvalidGrantError;
103
+ /** @deprecated Not for external use. */
84
104
  static generate(
85
105
  rawError: StripeRawError & {type: RawErrorType}
86
106
  ): StripeError;
@@ -91,6 +111,7 @@ declare module 'stripe' {
91
111
  */
92
112
  readonly message: string;
93
113
 
114
+ // errorClassNameEnum: The beginning of the section generated from our OpenAPI spec
94
115
  readonly type:
95
116
  | 'StripeError'
96
117
  | 'StripeCardError'
@@ -102,7 +123,9 @@ declare module 'stripe' {
102
123
  | 'StripeConnectionError'
103
124
  | 'StripeSignatureVerificationError'
104
125
  | 'StripeIdempotencyError'
105
- | 'StripeInvalidGrantError';
126
+ | 'StripeInvalidGrantError'
127
+ | 'TemporarySessionExpiredError';
128
+ // errorClassNameEnum: The end of the section generated from our OpenAPI spec
106
129
 
107
130
  /**
108
131
  * See the "error types" section at https://stripe.com/docs/api/errors
@@ -245,6 +268,13 @@ declare module 'stripe' {
245
268
  readonly type: 'StripeInvalidGrantError';
246
269
  readonly rawType: 'invalid_grant';
247
270
  }
271
+
272
+ // errorClassDefinitions: The beginning of the section generated from our OpenAPI spec
273
+ export class TemporarySessionExpiredError extends StripeError {
274
+ readonly type: 'TemporarySessionExpiredError';
275
+ readonly rawType: 'temporary_session_expired';
276
+ }
277
+ // errorClassDefinitions: The end of the section generated from our OpenAPI spec
248
278
  }
249
279
  }
250
280
  }
@@ -240,7 +240,9 @@ declare module 'stripe' {
240
240
  | TreasuryReceivedCreditFailedEvent
241
241
  | TreasuryReceivedCreditSucceededEvent
242
242
  | TreasuryReceivedDebitCreatedEvent;
243
+ }
243
244
 
245
+ namespace Stripe {
244
246
  /**
245
247
  * Occurs whenever a user authorizes an application. Sent to the related application only.
246
248
  */
@@ -80,6 +80,8 @@ declare module 'stripe' {
80
80
  */
81
81
  plan: Stripe.Plan | null;
82
82
 
83
+ pretax_credit_amounts?: Array<InvoiceLineItem.PretaxCreditAmount> | null;
84
+
83
85
  /**
84
86
  * The price of the line item.
85
87
  */
@@ -156,6 +158,40 @@ declare module 'stripe' {
156
158
  start: number;
157
159
  }
158
160
 
161
+ interface PretaxCreditAmount {
162
+ /**
163
+ * The amount, in cents (or local equivalent), of the pretax credit amount.
164
+ */
165
+ amount: number;
166
+
167
+ /**
168
+ * The credit balance transaction that was applied to get this pretax credit amount.
169
+ */
170
+ credit_balance_transaction?:
171
+ | string
172
+ | Stripe.Billing.CreditBalanceTransaction
173
+ | null;
174
+
175
+ /**
176
+ * The discount that was applied to get this pretax credit amount.
177
+ */
178
+ discount?: string | Stripe.Discount | Stripe.DeletedDiscount;
179
+
180
+ /**
181
+ * The margin that was applied to get this pretax credit amount.
182
+ */
183
+ margin?: string | Stripe.Margin;
184
+
185
+ /**
186
+ * Type of the pretax credit amount referenced.
187
+ */
188
+ type: PretaxCreditAmount.Type;
189
+ }
190
+
191
+ namespace PretaxCreditAmount {
192
+ type Type = 'credit_balance_transaction' | 'discount';
193
+ }
194
+
159
195
  interface ProrationDetails {
160
196
  /**
161
197
  * For a credit proration `line_item`, the original debit line_items to which the credit proration applies.
@@ -461,6 +461,10 @@ declare module 'stripe' {
461
461
  */
462
462
  total_excluding_tax: number | null;
463
463
 
464
+ total_pretax_credit_amounts?: Array<
465
+ Invoice.TotalPretaxCreditAmount
466
+ > | null;
467
+
464
468
  /**
465
469
  * The aggregate amounts calculated per tax rate for all line items.
466
470
  */
@@ -1396,6 +1400,40 @@ declare module 'stripe' {
1396
1400
  discount: string | Stripe.Discount | Stripe.DeletedDiscount;
1397
1401
  }
1398
1402
 
1403
+ interface TotalPretaxCreditAmount {
1404
+ /**
1405
+ * The amount, in cents (or local equivalent), of the pretax credit amount.
1406
+ */
1407
+ amount: number;
1408
+
1409
+ /**
1410
+ * The credit balance transaction that was applied to get this pretax credit amount.
1411
+ */
1412
+ credit_balance_transaction?:
1413
+ | string
1414
+ | Stripe.Billing.CreditBalanceTransaction
1415
+ | null;
1416
+
1417
+ /**
1418
+ * The discount that was applied to get this pretax credit amount.
1419
+ */
1420
+ discount?: string | Stripe.Discount | Stripe.DeletedDiscount;
1421
+
1422
+ /**
1423
+ * The margin that was applied to get this pretax credit amount.
1424
+ */
1425
+ margin?: string | Stripe.Margin;
1426
+
1427
+ /**
1428
+ * Type of the pretax credit amount referenced.
1429
+ */
1430
+ type: TotalPretaxCreditAmount.Type;
1431
+ }
1432
+
1433
+ namespace TotalPretaxCreditAmount {
1434
+ type Type = 'credit_balance_transaction' | 'discount';
1435
+ }
1436
+
1399
1437
  interface TotalTaxAmount {
1400
1438
  /**
1401
1439
  * The amount, in cents (or local equivalent), of the tax.
@@ -0,0 +1,56 @@
1
+ // File generated from our OpenAPI spec
2
+
3
+ declare module 'stripe' {
4
+ namespace Stripe {
5
+ /**
6
+ * A (partner) margin represents a specific discount distributed in partner reseller programs to business partners who
7
+ * resell products and services and earn a discount (margin) for doing so.
8
+ */
9
+ interface Margin {
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: 'margin';
19
+
20
+ /**
21
+ * Whether the margin can be applied to invoices, invoice items, or invoice line items. Defaults to `true`.
22
+ */
23
+ active: boolean;
24
+
25
+ /**
26
+ * Time at which the object was created. Measured in seconds since the Unix epoch.
27
+ */
28
+ created: number;
29
+
30
+ /**
31
+ * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
32
+ */
33
+ livemode: boolean;
34
+
35
+ /**
36
+ * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
37
+ */
38
+ metadata: Stripe.Metadata | null;
39
+
40
+ /**
41
+ * Name of the margin that's displayed on, for example, invoices.
42
+ */
43
+ name: string | null;
44
+
45
+ /**
46
+ * Percent that will be taken off the subtotal before tax (after all other discounts and promotions) of any invoice to which the margin is applied.
47
+ */
48
+ percent_off: number;
49
+
50
+ /**
51
+ * Time at which the object was last updated. Measured in seconds since the Unix epoch.
52
+ */
53
+ updated: number;
54
+ }
55
+ }
56
+ }
@@ -101,6 +101,11 @@ declare module 'stripe' {
101
101
  [key: string]: DefaultPriceData.CurrencyOptions;
102
102
  };
103
103
 
104
+ /**
105
+ * When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links.
106
+ */
107
+ custom_unit_amount?: DefaultPriceData.CustomUnitAmount;
108
+
104
109
  /**
105
110
  * The recurring components of a price such as `interval` and `interval_count`.
106
111
  */
@@ -112,7 +117,7 @@ declare module 'stripe' {
112
117
  tax_behavior?: DefaultPriceData.TaxBehavior;
113
118
 
114
119
  /**
115
- * A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required.
120
+ * A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. One of `unit_amount`, `unit_amount_decimal`, or `custom_unit_amount` is required.
116
121
  */
117
122
  unit_amount?: number;
118
123
 
@@ -203,6 +208,28 @@ declare module 'stripe' {
203
208
  }
204
209
  }
205
210
 
211
+ interface CustomUnitAmount {
212
+ /**
213
+ * Pass in `true` to enable `custom_unit_amount`, otherwise omit `custom_unit_amount`.
214
+ */
215
+ enabled: boolean;
216
+
217
+ /**
218
+ * The maximum unit amount the customer can specify for this item.
219
+ */
220
+ maximum?: number;
221
+
222
+ /**
223
+ * The minimum unit amount the customer can specify for this item. Must be at least the minimum charge amount.
224
+ */
225
+ minimum?: number;
226
+
227
+ /**
228
+ * The starting unit amount which can be updated by the customer.
229
+ */
230
+ preset?: number;
231
+ }
232
+
206
233
  interface Recurring {
207
234
  /**
208
235
  * Specifies billing frequency. Either `day`, `week`, `month` or `year`.
@@ -23,7 +23,7 @@ declare module 'stripe' {
23
23
  active: boolean;
24
24
 
25
25
  /**
26
- * The customer-facing code. Regardless of case, this code must be unique across all active promotion codes for each customer.
26
+ * The customer-facing code. Regardless of case, this code must be unique across all active promotion codes for each customer. Valid characters are lower case letters (a-z), upper case letters (A-Z), and digits (0-9).
27
27
  */
28
28
  code: string;
29
29
 
@@ -14,7 +14,9 @@ declare module 'stripe' {
14
14
  active?: boolean;
15
15
 
16
16
  /**
17
- * The customer-facing code. Regardless of case, this code must be unique across all active promotion codes for a specific customer. If left blank, we will generate one automatically.
17
+ * The customer-facing code. Regardless of case, this code must be unique across all active promotion codes for a specific customer. Valid characters are lower case letters (a-z), upper case letters (A-Z), and digits (0-9).
18
+ *
19
+ * If left blank, we will generate one automatically.
18
20
  */
19
21
  code?: string;
20
22
 
@@ -1972,11 +1972,11 @@ declare module 'stripe' {
1972
1972
  list(options?: RequestOptions): ApiListPromise<Stripe.Subscription>;
1973
1973
 
1974
1974
  /**
1975
- * Cancels a customer's subscription immediately. The customer will not be charged again for the subscription.
1975
+ * Cancels a customer's subscription immediately. The customer won't be charged again for the subscription. After it's canceled, you can no longer update the subscription or its [metadata](https://stripe.com/metadata).
1976
1976
  *
1977
- * Note, however, that any pending invoice items that you've created will still be charged for at the end of the period, unless manually [deleted](https://stripe.com/docs/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed.
1977
+ * Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://stripe.com/docs/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations are also left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations are removed.
1978
1978
  *
1979
- * By default, upon subscription cancellation, Stripe will stop automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all.
1979
+ * By default, upon subscription cancellation, Stripe stops automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all.
1980
1980
  */
1981
1981
  cancel(
1982
1982
  id: string,
@@ -27,7 +27,7 @@ declare module 'stripe' {
27
27
  livemode: boolean;
28
28
 
29
29
  /**
30
- * The `active` status indicates you have all required settings to calculate tax. A status can transition out of `active` when new required settings are introduced.
30
+ * The status of the Tax `Settings`.
31
31
  */
32
32
  status: Settings.Status;
33
33
 
@@ -123,6 +123,11 @@ declare module 'stripe' {
123
123
 
124
124
  namespace ReaderProcessPaymentIntentParams {
125
125
  interface ProcessConfig {
126
+ /**
127
+ * This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow.
128
+ */
129
+ allow_redisplay?: ProcessConfig.AllowRedisplay;
130
+
126
131
  /**
127
132
  * Enables cancel button on transaction screens.
128
133
  */
@@ -140,6 +145,8 @@ declare module 'stripe' {
140
145
  }
141
146
 
142
147
  namespace ProcessConfig {
148
+ type AllowRedisplay = 'always' | 'limited' | 'unspecified';
149
+
143
150
  interface Tipping {
144
151
  /**
145
152
  * Amount used to calculate tip suggestions on tipping selection screen for this transaction. Must be a positive integer in the smallest currency unit (e.g., 100 cents to represent $1.00 or 100 to represent ¥100, a zero-decimal currency).
@@ -151,14 +158,14 @@ declare module 'stripe' {
151
158
 
152
159
  interface ReaderProcessSetupIntentParams {
153
160
  /**
154
- * SetupIntent ID
161
+ * This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow.
155
162
  */
156
- setup_intent: string;
163
+ allow_redisplay: ReaderProcessSetupIntentParams.AllowRedisplay;
157
164
 
158
165
  /**
159
- * Customer Consent Collected
166
+ * SetupIntent ID
160
167
  */
161
- customer_consent_collected?: boolean;
168
+ setup_intent: string;
162
169
 
163
170
  /**
164
171
  * Specifies which fields in the response should be expanded.
@@ -172,6 +179,8 @@ declare module 'stripe' {
172
179
  }
173
180
 
174
181
  namespace ReaderProcessSetupIntentParams {
182
+ type AllowRedisplay = 'always' | 'limited' | 'unspecified';
183
+
175
184
  interface ProcessConfig {
176
185
  /**
177
186
  * Enables cancel button on transaction screens.
@@ -0,0 +1,36 @@
1
+ // This is a manually maintained file
2
+
3
+ declare module 'stripe' {
4
+ namespace Stripe {
5
+ namespace Event {
6
+ /**
7
+ * Object containing the reference to API resource relevant to the event.
8
+ */
9
+ interface RelatedObject {
10
+ /**
11
+ * Unique identifier for the object relevant to the event.
12
+ */
13
+ id: string;
14
+
15
+ /**
16
+ * Type of the object relevant to the event.
17
+ */
18
+ type: string;
19
+
20
+ /**
21
+ * URL to retrieve the resource.
22
+ */
23
+ url: string;
24
+ }
25
+ }
26
+ /**
27
+ * The Event object as recieved from StripeClient.parseThinEvent.
28
+ */
29
+ interface ThinEvent extends V2.EventBase {
30
+ /**
31
+ * Object containing the reference to API resource relevant to the event.
32
+ */
33
+ related_object: Event.RelatedObject | null;
34
+ }
35
+ }
36
+ }
@@ -83,7 +83,11 @@ declare module 'stripe' {
83
83
  }
84
84
 
85
85
  namespace ReceivedCredit {
86
- type FailureCode = 'account_closed' | 'account_frozen' | 'other';
86
+ type FailureCode =
87
+ | 'account_closed'
88
+ | 'account_frozen'
89
+ | 'international_transaction'
90
+ | 'other';
87
91
 
88
92
  interface InitiatingPaymentMethodDetails {
89
93
  /**
@@ -0,0 +1,65 @@
1
+ // File generated from our OpenAPI spec
2
+
3
+ declare module 'stripe' {
4
+ namespace Stripe {
5
+ namespace V2 {
6
+ namespace Billing {
7
+ /**
8
+ * The MeterEventAdjustment object.
9
+ */
10
+ interface MeterEventAdjustment {
11
+ /**
12
+ * The unique id of this meter event adjustment.
13
+ */
14
+ id: string;
15
+
16
+ /**
17
+ * String representing the object's type. Objects of the same type share the same value of the object field.
18
+ */
19
+ object: 'billing.meter_event_adjustment';
20
+
21
+ /**
22
+ * Specifies which event to cancel.
23
+ */
24
+ cancel: MeterEventAdjustment.Cancel;
25
+
26
+ /**
27
+ * The time the adjustment was created.
28
+ */
29
+ created: string;
30
+
31
+ /**
32
+ * The name of the meter event. Corresponds with the `event_name` field on a meter.
33
+ */
34
+ event_name: string;
35
+
36
+ /**
37
+ * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
38
+ */
39
+ livemode: boolean;
40
+
41
+ /**
42
+ * Open Enum. The meter event adjustment's status.
43
+ */
44
+ status: MeterEventAdjustment.Status;
45
+
46
+ /**
47
+ * Open Enum. Specifies whether to cancel a single event or a range of events for a time period. Time period cancellation is not supported yet.
48
+ */
49
+ type: 'cancel';
50
+ }
51
+
52
+ namespace MeterEventAdjustment {
53
+ interface Cancel {
54
+ /**
55
+ * Unique identifier for the event. You can only cancel events within 24 hours of Stripe receiving them.
56
+ */
57
+ identifier: string;
58
+ }
59
+
60
+ type Status = 'complete' | 'pending';
61
+ }
62
+ }
63
+ }
64
+ }
65
+ }
@@ -0,0 +1,47 @@
1
+ // File generated from our OpenAPI spec
2
+
3
+ declare module 'stripe' {
4
+ namespace Stripe {
5
+ namespace V2 {
6
+ namespace Billing {
7
+ interface MeterEventAdjustmentCreateParams {
8
+ /**
9
+ * Specifies which event to cancel.
10
+ */
11
+ cancel: MeterEventAdjustmentCreateParams.Cancel;
12
+
13
+ /**
14
+ * The name of the meter event. Corresponds with the `event_name` field on a meter.
15
+ */
16
+ event_name: string;
17
+
18
+ /**
19
+ * Specifies whether to cancel a single event or a range of events for a time period. Time period cancellation is not supported yet.
20
+ */
21
+ type: 'cancel';
22
+ }
23
+
24
+ namespace MeterEventAdjustmentCreateParams {
25
+ interface Cancel {
26
+ /**
27
+ * Unique identifier for the event. You can only cancel events within 24 hours of Stripe receiving them.
28
+ */
29
+ identifier: string;
30
+ }
31
+ }
32
+ }
33
+
34
+ namespace Billing {
35
+ class MeterEventAdjustmentsResource {
36
+ /**
37
+ * Creates a meter event adjustment to cancel a previously sent meter event.
38
+ */
39
+ create(
40
+ params: MeterEventAdjustmentCreateParams,
41
+ options?: RequestOptions
42
+ ): Promise<Stripe.Response<Stripe.V2.Billing.MeterEventAdjustment>>;
43
+ }
44
+ }
45
+ }
46
+ }
47
+ }
@@ -0,0 +1,26 @@
1
+ // File generated from our OpenAPI spec
2
+
3
+ declare module 'stripe' {
4
+ namespace Stripe {
5
+ namespace V2 {
6
+ namespace Billing {
7
+ interface MeterEventSessionCreateParams {}
8
+ }
9
+
10
+ namespace Billing {
11
+ class MeterEventSessionResource {
12
+ /**
13
+ * Creates a meter event session to send usage on the high-throughput meter event stream. Authentication tokens are only valid for 15 minutes, so you will need to create a new meter event session when your token expires.
14
+ */
15
+ create(
16
+ params?: MeterEventSessionCreateParams,
17
+ options?: RequestOptions
18
+ ): Promise<Stripe.Response<Stripe.V2.Billing.MeterEventSession>>;
19
+ create(
20
+ options?: RequestOptions
21
+ ): Promise<Stripe.Response<Stripe.V2.Billing.MeterEventSession>>;
22
+ }
23
+ }
24
+ }
25
+ }
26
+ }
@@ -0,0 +1,45 @@
1
+ // File generated from our OpenAPI spec
2
+
3
+ declare module 'stripe' {
4
+ namespace Stripe {
5
+ namespace V2 {
6
+ namespace Billing {
7
+ /**
8
+ * The MeterEventSession object.
9
+ */
10
+ interface MeterEventSession {
11
+ /**
12
+ * The unique id of this auth session.
13
+ */
14
+ id: string;
15
+
16
+ /**
17
+ * String representing the object's type. Objects of the same type share the same value of the object field.
18
+ */
19
+ object: 'billing.meter_event_session';
20
+
21
+ /**
22
+ * The authentication token for this session. Use this token when calling the
23
+ * high-throughput meter event API.
24
+ */
25
+ authentication_token: string;
26
+
27
+ /**
28
+ * The creation time of this session.
29
+ */
30
+ created: string;
31
+
32
+ /**
33
+ * The time at which this session will expire.
34
+ */
35
+ expires_at: string;
36
+
37
+ /**
38
+ * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
39
+ */
40
+ livemode: boolean;
41
+ }
42
+ }
43
+ }
44
+ }
45
+ }