stripe 12.12.0 → 12.13.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,16 @@
1
1
  # Changelog
2
2
 
3
+ ## 12.13.0 - 2023-07-13
4
+ * [#1838](https://github.com/stripe/stripe-node/pull/1838) Update generated code
5
+ * Add support for new resource `Tax.Settings`
6
+ * Add support for `retrieve` and `update` methods on resource `Settings`
7
+ * Add support for new value `invalid_tax_location` on enums `Invoice.last_finalization_error.code`, `PaymentIntent.last_payment_error.code`, `SetupAttempt.setup_error.code`, `SetupIntent.last_setup_error.code`, and `StripeError.code`
8
+ * Add support for `order_id` on `Charge.payment_method_details.afterpay_clearpay`
9
+ * Add support for `allow_redirects` on `PaymentIntent.automatic_payment_methods`, `PaymentIntentCreateParams.automatic_payment_methods`, `SetupIntent.automatic_payment_methods`, and `SetupIntentCreateParams.automatic_payment_methods`
10
+ * Add support for new values `amusement_tax` and `communications_tax` on enums `Tax.Calculation.shipping_cost.tax_breakdown[].tax_rate_details.tax_type`, `Tax.Calculation.tax_breakdown[].tax_rate_details.tax_type`, `Tax.CalculationLineItem.tax_breakdown[].tax_rate_details.tax_type`, and `Tax.Transaction.shipping_cost.tax_breakdown[].tax_rate_details.tax_type`
11
+ * Add support for `product` on `Tax.TransactionLineItem`
12
+ * Add support for new value `tax.settings.updated` on enums `WebhookEndpointCreateParams.enabled_events[]` and `WebhookEndpointUpdateParams.enabled_events[]`
13
+
3
14
  ## 12.12.0 - 2023-07-06
4
15
  * [#1831](https://github.com/stripe/stripe-node/pull/1831) Update generated code
5
16
  * Add support for `numeric` and `text` on `PaymentLink.custom_fields[]`
package/VERSION CHANGED
@@ -1 +1 @@
1
- 12.12.0
1
+ 12.13.0
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Settings = void 0;
5
+ const StripeResource_js_1 = require("../../StripeResource.js");
6
+ const stripeMethod = StripeResource_js_1.StripeResource.method;
7
+ exports.Settings = StripeResource_js_1.StripeResource.extend({
8
+ retrieve: stripeMethod({ method: 'GET', fullPath: '/v1/tax/settings' }),
9
+ update: stripeMethod({ method: 'POST', fullPath: '/v1/tax/settings' }),
10
+ });
package/cjs/resources.js CHANGED
@@ -40,6 +40,7 @@ const Secrets_js_1 = require("./resources/Apps/Secrets.js");
40
40
  const Sessions_js_1 = require("./resources/BillingPortal/Sessions.js");
41
41
  const Sessions_js_2 = require("./resources/Checkout/Sessions.js");
42
42
  const Sessions_js_3 = require("./resources/FinancialConnections/Sessions.js");
43
+ const Settings_js_1 = require("./resources/Tax/Settings.js");
43
44
  const TestClocks_js_1 = require("./resources/TestHelpers/TestClocks.js");
44
45
  const TransactionEntries_js_1 = require("./resources/Treasury/TransactionEntries.js");
45
46
  const Transactions_js_1 = require("./resources/Issuing/Transactions.js");
@@ -178,6 +179,7 @@ exports.Sigma = (0, ResourceNamespace_js_1.resourceNamespace)('sigma', {
178
179
  });
179
180
  exports.Tax = (0, ResourceNamespace_js_1.resourceNamespace)('tax', {
180
181
  Calculations: Calculations_js_1.Calculations,
182
+ Settings: Settings_js_1.Settings,
181
183
  Transactions: Transactions_js_2.Transactions,
182
184
  });
183
185
  exports.Terminal = (0, ResourceNamespace_js_1.resourceNamespace)('terminal', {
@@ -34,7 +34,7 @@ const ALLOWED_CONFIG_PROPERTIES = [
34
34
  ];
35
35
  const defaultRequestSenderFactory = (stripe) => new RequestSender_js_1.RequestSender(stripe, StripeResource_js_1.StripeResource.MAX_BUFFERED_REQUEST_METRICS);
36
36
  function createStripe(platformFunctions, requestSender = defaultRequestSenderFactory) {
37
- Stripe.PACKAGE_VERSION = '12.12.0';
37
+ Stripe.PACKAGE_VERSION = '12.13.0';
38
38
  Stripe.USER_AGENT = Object.assign({ bindings_version: Stripe.PACKAGE_VERSION, lang: 'node', publisher: 'stripe', uname: null, typescript: false }, (0, utils_js_1.determineProcessUserAgentProperties)());
39
39
  Stripe.StripeResource = StripeResource_js_1.StripeResource;
40
40
  Stripe.resources = resources;
@@ -0,0 +1,7 @@
1
+ // File generated from our OpenAPI spec
2
+ import { StripeResource } from '../../StripeResource.js';
3
+ const stripeMethod = StripeResource.method;
4
+ export const Settings = StripeResource.extend({
5
+ retrieve: stripeMethod({ method: 'GET', fullPath: '/v1/tax/settings' }),
6
+ update: stripeMethod({ method: 'POST', fullPath: '/v1/tax/settings' }),
7
+ });
package/esm/resources.js CHANGED
@@ -36,6 +36,7 @@ import { Secrets as AppsSecrets } from './resources/Apps/Secrets.js';
36
36
  import { Sessions as BillingPortalSessions } from './resources/BillingPortal/Sessions.js';
37
37
  import { Sessions as CheckoutSessions } from './resources/Checkout/Sessions.js';
38
38
  import { Sessions as FinancialConnectionsSessions } from './resources/FinancialConnections/Sessions.js';
39
+ import { Settings as TaxSettings } from './resources/Tax/Settings.js';
39
40
  import { TestClocks as TestHelpersTestClocks } from './resources/TestHelpers/TestClocks.js';
40
41
  import { TransactionEntries as TreasuryTransactionEntries } from './resources/Treasury/TransactionEntries.js';
41
42
  import { Transactions as IssuingTransactions } from './resources/Issuing/Transactions.js';
@@ -128,6 +129,7 @@ export const Sigma = resourceNamespace('sigma', {
128
129
  });
129
130
  export const Tax = resourceNamespace('tax', {
130
131
  Calculations: TaxCalculations,
132
+ Settings: TaxSettings,
131
133
  Transactions: TaxTransactions,
132
134
  });
133
135
  export const Terminal = resourceNamespace('terminal', {
@@ -31,7 +31,7 @@ const ALLOWED_CONFIG_PROPERTIES = [
31
31
  ];
32
32
  const defaultRequestSenderFactory = (stripe) => new RequestSender(stripe, StripeResource.MAX_BUFFERED_REQUEST_METRICS);
33
33
  export function createStripe(platformFunctions, requestSender = defaultRequestSenderFactory) {
34
- Stripe.PACKAGE_VERSION = '12.12.0';
34
+ Stripe.PACKAGE_VERSION = '12.13.0';
35
35
  Stripe.USER_AGENT = Object.assign({ bindings_version: Stripe.PACKAGE_VERSION, lang: 'node', publisher: 'stripe', uname: null, typescript: false }, determineProcessUserAgentProperties());
36
36
  Stripe.StripeResource = StripeResource;
37
37
  Stripe.resources = resources;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stripe",
3
- "version": "12.12.0",
3
+ "version": "12.13.0",
4
4
  "description": "Stripe API wrapper",
5
5
  "keywords": [
6
6
  "stripe",
@@ -570,6 +570,11 @@ declare module 'stripe' {
570
570
  interface Affirm {}
571
571
 
572
572
  interface AfterpayClearpay {
573
+ /**
574
+ * The Afterpay order ID associated with this payment intent.
575
+ */
576
+ order_id: string | null;
577
+
573
578
  /**
574
579
  * Order identifier shown to the merchant in Afterpay's online portal.
575
580
  */
@@ -763,6 +763,7 @@ declare module 'stripe' {
763
763
  | 'invalid_expiry_year'
764
764
  | 'invalid_number'
765
765
  | 'invalid_source_usage'
766
+ | 'invalid_tax_location'
766
767
  | 'invoice_no_customer_line_items'
767
768
  | 'invoice_no_payment_method_types'
768
769
  | 'invoice_no_subscription_line_items'
@@ -238,12 +238,23 @@ declare module 'stripe' {
238
238
  }
239
239
 
240
240
  interface AutomaticPaymentMethods {
241
+ /**
242
+ * Controls whether this PaymentIntent will accept redirect-based payment methods.
243
+ *
244
+ * Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps. To [confirm](https://stripe.com/docs/api/payment_intents/confirm) this PaymentIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the payment.
245
+ */
246
+ allow_redirects?: AutomaticPaymentMethods.AllowRedirects;
247
+
241
248
  /**
242
249
  * Automatically calculates compatible payment methods
243
250
  */
244
251
  enabled: boolean;
245
252
  }
246
253
 
254
+ namespace AutomaticPaymentMethods {
255
+ type AllowRedirects = 'always' | 'never';
256
+ }
257
+
247
258
  type CancellationReason =
248
259
  | 'abandoned'
249
260
  | 'automatic'
@@ -422,6 +433,7 @@ declare module 'stripe' {
422
433
  | 'invalid_expiry_year'
423
434
  | 'invalid_number'
424
435
  | 'invalid_source_usage'
436
+ | 'invalid_tax_location'
425
437
  | 'invoice_no_customer_line_items'
426
438
  | 'invoice_no_payment_method_types'
427
439
  | 'invoice_no_subscription_line_items'
@@ -166,12 +166,23 @@ declare module 'stripe' {
166
166
 
167
167
  namespace PaymentIntentCreateParams {
168
168
  interface AutomaticPaymentMethods {
169
+ /**
170
+ * Controls whether this PaymentIntent will accept redirect-based payment methods.
171
+ *
172
+ * Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps. To [confirm](https://stripe.com/docs/api/payment_intents/confirm) this PaymentIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the payment.
173
+ */
174
+ allow_redirects?: AutomaticPaymentMethods.AllowRedirects;
175
+
169
176
  /**
170
177
  * Whether this feature is enabled.
171
178
  */
172
179
  enabled: boolean;
173
180
  }
174
181
 
182
+ namespace AutomaticPaymentMethods {
183
+ type AllowRedirects = 'always' | 'never';
184
+ }
185
+
175
186
  type CaptureMethod = 'automatic' | 'automatic_async' | 'manual';
176
187
 
177
188
  type ConfirmationMethod = 'automatic' | 'manual';
@@ -647,6 +647,7 @@ declare module 'stripe' {
647
647
  | 'invalid_expiry_year'
648
648
  | 'invalid_number'
649
649
  | 'invalid_source_usage'
650
+ | 'invalid_tax_location'
650
651
  | 'invoice_no_customer_line_items'
651
652
  | 'invoice_no_payment_method_types'
652
653
  | 'invoice_no_subscription_line_items'
@@ -160,12 +160,23 @@ declare module 'stripe' {
160
160
 
161
161
  namespace SetupIntent {
162
162
  interface AutomaticPaymentMethods {
163
+ /**
164
+ * Controls whether this SetupIntent will accept redirect-based payment methods.
165
+ *
166
+ * Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps. To [confirm](https://stripe.com/docs/api/setup_intents/confirm) this SetupIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the setup.
167
+ */
168
+ allow_redirects?: AutomaticPaymentMethods.AllowRedirects;
169
+
163
170
  /**
164
171
  * Automatically calculates compatible payment methods
165
172
  */
166
173
  enabled: boolean | null;
167
174
  }
168
175
 
176
+ namespace AutomaticPaymentMethods {
177
+ type AllowRedirects = 'always' | 'never';
178
+ }
179
+
169
180
  type CancellationReason =
170
181
  | 'abandoned'
171
182
  | 'duplicate'
@@ -338,6 +349,7 @@ declare module 'stripe' {
338
349
  | 'invalid_expiry_year'
339
350
  | 'invalid_number'
340
351
  | 'invalid_source_usage'
352
+ | 'invalid_tax_location'
341
353
  | 'invoice_no_customer_line_items'
342
354
  | 'invoice_no_payment_method_types'
343
355
  | 'invoice_no_subscription_line_items'
@@ -98,12 +98,23 @@ declare module 'stripe' {
98
98
 
99
99
  namespace SetupIntentCreateParams {
100
100
  interface AutomaticPaymentMethods {
101
+ /**
102
+ * Controls whether this SetupIntent will accept redirect-based payment methods.
103
+ *
104
+ * Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps. To [confirm](https://stripe.com/docs/api/setup_intents/confirm) this SetupIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the setup.
105
+ */
106
+ allow_redirects?: AutomaticPaymentMethods.AllowRedirects;
107
+
101
108
  /**
102
109
  * Whether this feature is enabled.
103
110
  */
104
111
  enabled: boolean;
105
112
  }
106
113
 
114
+ namespace AutomaticPaymentMethods {
115
+ type AllowRedirects = 'always' | 'never';
116
+ }
117
+
107
118
  type FlowDirection = 'inbound' | 'outbound';
108
119
 
109
120
  interface MandateData {
@@ -33,7 +33,7 @@ declare module 'stripe' {
33
33
  livemode: boolean;
34
34
 
35
35
  /**
36
- * A Product ID.
36
+ * The ID of an existing [Product](https://stripe.com/docs/api/products/object).
37
37
  */
38
38
  product: string | null;
39
39
 
@@ -160,6 +160,8 @@ declare module 'stripe' {
160
160
 
161
161
  namespace TaxRateDetails {
162
162
  type TaxType =
163
+ | 'amusement_tax'
164
+ | 'communications_tax'
163
165
  | 'gst'
164
166
  | 'hst'
165
167
  | 'igst'
@@ -208,7 +208,7 @@ declare module 'stripe' {
208
208
  amount_tax: number;
209
209
 
210
210
  /**
211
- * The ID of an existing [ShippingRate](https://stripe.com/docs/api/shipping_rates/object)
211
+ * The ID of an existing [ShippingRate](https://stripe.com/docs/api/shipping_rates/object).
212
212
  */
213
213
  shipping_rate?: string;
214
214
 
@@ -325,6 +325,8 @@ declare module 'stripe' {
325
325
 
326
326
  namespace TaxRateDetails {
327
327
  type TaxType =
328
+ | 'amusement_tax'
329
+ | 'communications_tax'
328
330
  | 'gst'
329
331
  | 'hst'
330
332
  | 'igst'
@@ -405,6 +407,8 @@ declare module 'stripe' {
405
407
 
406
408
  namespace TaxRateDetails {
407
409
  type TaxType =
410
+ | 'amusement_tax'
411
+ | 'communications_tax'
408
412
  | 'gst'
409
413
  | 'hst'
410
414
  | 'igst'
@@ -0,0 +1,79 @@
1
+ // File generated from our OpenAPI spec
2
+
3
+ declare module 'stripe' {
4
+ namespace Stripe {
5
+ namespace Tax {
6
+ /**
7
+ * You can use Tax `Settings` to manage configurations used by Stripe Tax calculations.
8
+ *
9
+ * Related guide: [Using the Settings API](https://stripe.com/docs/tax/settings-api)
10
+ */
11
+ interface Settings {
12
+ /**
13
+ * String representing the object's type. Objects of the same type share the same value.
14
+ */
15
+ object: 'tax.settings';
16
+
17
+ defaults: Settings.Defaults;
18
+
19
+ /**
20
+ * The place where your business is located.
21
+ */
22
+ head_office: Settings.HeadOffice | null;
23
+
24
+ /**
25
+ * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
26
+ */
27
+ livemode: boolean;
28
+
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.
31
+ */
32
+ status: Settings.Status;
33
+
34
+ status_details: Settings.StatusDetails;
35
+ }
36
+
37
+ namespace Settings {
38
+ interface Defaults {
39
+ /**
40
+ * Default [tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#tax-behavior) used to specify whether the price is considered inclusive of taxes or exclusive of taxes. If the item's price has a tax behavior set, it will take precedence over the default tax behavior.
41
+ */
42
+ tax_behavior: Defaults.TaxBehavior | null;
43
+
44
+ /**
45
+ * Default [tax code](https://stripe.com/docs/tax/tax-categories) used to classify your products and prices.
46
+ */
47
+ tax_code: string | null;
48
+ }
49
+
50
+ namespace Defaults {
51
+ type TaxBehavior = 'exclusive' | 'inclusive' | 'inferred_by_currency';
52
+ }
53
+
54
+ interface HeadOffice {
55
+ address: Stripe.Address;
56
+ }
57
+
58
+ type Status = 'active' | 'pending';
59
+
60
+ interface StatusDetails {
61
+ active?: StatusDetails.Active;
62
+
63
+ pending?: StatusDetails.Pending;
64
+ }
65
+
66
+ namespace StatusDetails {
67
+ interface Active {}
68
+
69
+ interface Pending {
70
+ /**
71
+ * The list of missing fields that are required to perform calculations. It includes the entry `head_office` when the status is `pending`. It is recommended to set the optional values even if they aren't listed as required for calculating taxes. Calculations can fail if missing fields aren't explicitly provided on every call.
72
+ */
73
+ missing_fields: Array<string> | null;
74
+ }
75
+ }
76
+ }
77
+ }
78
+ }
79
+ }
@@ -0,0 +1,77 @@
1
+ // File generated from our OpenAPI spec
2
+
3
+ declare module 'stripe' {
4
+ namespace Stripe {
5
+ namespace Tax {
6
+ interface SettingsRetrieveParams {
7
+ /**
8
+ * Specifies which fields in the response should be expanded.
9
+ */
10
+ expand?: Array<string>;
11
+ }
12
+
13
+ interface SettingsUpdateParams {
14
+ /**
15
+ * Default configuration to be used on Stripe Tax calculations.
16
+ */
17
+ defaults?: SettingsUpdateParams.Defaults;
18
+
19
+ /**
20
+ * Specifies which fields in the response should be expanded.
21
+ */
22
+ expand?: Array<string>;
23
+
24
+ /**
25
+ * The place where your business is located.
26
+ */
27
+ head_office?: SettingsUpdateParams.HeadOffice;
28
+ }
29
+
30
+ namespace SettingsUpdateParams {
31
+ interface Defaults {
32
+ /**
33
+ * Specifies the default [tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#tax-behavior) to be used when the item's price has unspecified tax behavior. One of inclusive, exclusive, or inferred_by_currency. Once specified, it cannot be changed back to null.
34
+ */
35
+ tax_behavior?: Defaults.TaxBehavior;
36
+
37
+ /**
38
+ * A [tax code](https://stripe.com/docs/tax/tax-categories) ID.
39
+ */
40
+ tax_code?: string;
41
+ }
42
+
43
+ namespace Defaults {
44
+ type TaxBehavior = 'exclusive' | 'inclusive' | 'inferred_by_currency';
45
+ }
46
+
47
+ interface HeadOffice {
48
+ /**
49
+ * The location of the business for tax purposes.
50
+ */
51
+ address: Stripe.AddressParam;
52
+ }
53
+ }
54
+
55
+ class SettingsResource {
56
+ /**
57
+ * Retrieves Tax Settings for a merchant.
58
+ */
59
+ retrieve(
60
+ params?: SettingsRetrieveParams,
61
+ options?: RequestOptions
62
+ ): Promise<Stripe.Response<Stripe.Tax.Settings>>;
63
+ retrieve(
64
+ options?: RequestOptions
65
+ ): Promise<Stripe.Response<Stripe.Tax.Settings>>;
66
+
67
+ /**
68
+ * Updates Tax Settings parameters used in tax calculations. All parameters are editable but none can be removed once set.
69
+ */
70
+ update(
71
+ params?: SettingsUpdateParams,
72
+ options?: RequestOptions
73
+ ): Promise<Stripe.Response<Stripe.Tax.Settings>>;
74
+ }
75
+ }
76
+ }
77
+ }
@@ -37,6 +37,11 @@ declare module 'stripe' {
37
37
  */
38
38
  metadata: Stripe.Metadata | null;
39
39
 
40
+ /**
41
+ * The ID of an existing [Product](https://stripe.com/docs/api/products/object).
42
+ */
43
+ product: string | null;
44
+
40
45
  /**
41
46
  * The number of units of the item being purchased. For reversals, this is the quantity reversed.
42
47
  */
@@ -215,7 +215,7 @@ declare module 'stripe' {
215
215
  amount_tax: number;
216
216
 
217
217
  /**
218
- * The ID of an existing [ShippingRate](https://stripe.com/docs/api/shipping_rates/object). (It is not populated for the transaction resource object and will be removed in the next API version.)
218
+ * The ID of an existing [ShippingRate](https://stripe.com/docs/api/shipping_rates/object).
219
219
  */
220
220
  shipping_rate?: string;
221
221
 
@@ -332,6 +332,8 @@ declare module 'stripe' {
332
332
 
333
333
  namespace TaxRateDetails {
334
334
  type TaxType =
335
+ | 'amusement_tax'
336
+ | 'communications_tax'
335
337
  | 'gst'
336
338
  | 'hst'
337
339
  | 'igst'
@@ -319,6 +319,7 @@ declare module 'stripe' {
319
319
  | 'subscription_schedule.expiring'
320
320
  | 'subscription_schedule.released'
321
321
  | 'subscription_schedule.updated'
322
+ | 'tax.settings.updated'
322
323
  | 'tax_rate.created'
323
324
  | 'tax_rate.updated'
324
325
  | 'terminal.reader.action_failed'
@@ -585,6 +586,7 @@ declare module 'stripe' {
585
586
  | 'subscription_schedule.expiring'
586
587
  | 'subscription_schedule.released'
587
588
  | 'subscription_schedule.updated'
589
+ | 'tax.settings.updated'
588
590
  | 'tax_rate.created'
589
591
  | 'tax_rate.updated'
590
592
  | 'terminal.reader.action_failed'
package/types/index.d.ts CHANGED
@@ -65,6 +65,7 @@
65
65
  ///<reference path='./SubscriptionSchedulesResource.d.ts' />
66
66
  ///<reference path='./SubscriptionsResource.d.ts' />
67
67
  ///<reference path='./Tax/CalculationsResource.d.ts' />
68
+ ///<reference path='./Tax/SettingsResource.d.ts' />
68
69
  ///<reference path='./Tax/TransactionsResource.d.ts' />
69
70
  ///<reference path='./TaxCodesResource.d.ts' />
70
71
  ///<reference path='./TaxRatesResource.d.ts' />
@@ -177,6 +178,7 @@
177
178
  ///<reference path='./Subscriptions.d.ts' />
178
179
  ///<reference path='./Tax/CalculationLineItems.d.ts' />
179
180
  ///<reference path='./Tax/Calculations.d.ts' />
181
+ ///<reference path='./Tax/Settings.d.ts' />
180
182
  ///<reference path='./Tax/TransactionLineItems.d.ts' />
181
183
  ///<reference path='./Tax/Transactions.d.ts' />
182
184
  ///<reference path='./TaxCodes.d.ts' />
@@ -303,6 +305,7 @@ declare module 'stripe' {
303
305
  };
304
306
  tax: {
305
307
  calculations: Stripe.Tax.CalculationsResource;
308
+ settings: Stripe.Tax.SettingsResource;
306
309
  transactions: Stripe.Tax.TransactionsResource;
307
310
  };
308
311
  terminal: {