stripe 20.1.0-alpha.2 → 20.1.0-alpha.3

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,15 @@
1
1
  # Changelog
2
2
 
3
+ ## 20.1.0-alpha.3 - 2025-11-24
4
+ * [#2512](https://github.com/stripe/stripe-node/pull/2512) Update generated code for private-preview
5
+ * Add support for new resource `ProductCatalog.TrialOffer`
6
+ * Add support for `create` method on resource `ProductCatalog.TrialOffer`
7
+ * Remove support for `amount_subtotal_after_discount` on `DelegatedCheckout.RequestedSession.line_item_details[]` and `DelegatedCheckout.RequestedSession.total_details`
8
+ * Remove support for `amount_total`, `unit_amount_after_discount`, and `unit_discount` on `DelegatedCheckout.RequestedSession.line_item_details[]`
9
+ * Add support for `amount_cart_discount` and `amount_items_discount` on `DelegatedCheckout.RequestedSession.total_details`
10
+ * Remove support for `amount_discount` on `DelegatedCheckout.RequestedSession.total_details`
11
+ * Add support for `payments_orchestration` on `PaymentIntentCreateParams` and `PaymentIntent`
12
+
3
13
  ## 20.1.0-alpha.2 - 2025-11-20
4
14
  This release changes the pinned API version to `2025-11-17.preview`.
5
15
 
package/OPENAPI_VERSION CHANGED
@@ -1 +1 @@
1
- v2128
1
+ v2129
package/VERSION CHANGED
@@ -1 +1 @@
1
- 20.1.0-alpha.2
1
+ 20.1.0-alpha.3
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.TrialOffers = void 0;
5
+ const StripeResource_js_1 = require("../../StripeResource.js");
6
+ const stripeMethod = StripeResource_js_1.StripeResource.method;
7
+ exports.TrialOffers = StripeResource_js_1.StripeResource.extend({
8
+ create: stripeMethod({
9
+ method: 'POST',
10
+ fullPath: '/v1/product_catalog/trial_offers',
11
+ }),
12
+ });
package/cjs/resources.js CHANGED
@@ -2,7 +2,7 @@
2
2
  // File generated from our OpenAPI spec
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.SetupAttempts = exports.Reviews = exports.Refunds = exports.Quotes = exports.PromotionCodes = exports.Products = exports.Prices = exports.Plans = exports.Payouts = exports.PaymentRecords = exports.PaymentMethods = exports.PaymentMethodDomains = exports.PaymentMethodConfigurations = exports.PaymentLinks = exports.PaymentIntents = exports.PaymentAttemptRecords = exports.Orders = exports.OAuth = exports.Margins = exports.Mandates = exports.Invoices = exports.InvoiceRenderingTemplates = exports.InvoicePayments = exports.InvoiceItems = exports.FxQuotes = exports.Files = exports.FileLinks = exports.ExternalAccounts = exports.ExchangeRates = exports.Events = exports.EphemeralKeys = exports.Disputes = exports.Customers = exports.CustomerSessions = exports.CreditNotes = exports.Coupons = exports.CountrySpecs = exports.ConfirmationTokens = exports.Charges = exports.BalanceTransfers = exports.BalanceTransactions = exports.BalanceSettings = exports.Balance = exports.ApplicationFees = exports.ApplePayDomains = exports.Accounts = exports.AccountSessions = exports.AccountNotices = exports.AccountLinks = exports.Account = void 0;
5
- exports.V2 = exports.Treasury = exports.TestHelpers = exports.Terminal = exports.Tax = exports.Sigma = exports.Reporting = exports.Radar = exports.Privacy = exports.Issuing = exports.Identity = exports.Forwarding = exports.FinancialConnections = exports.Entitlements = exports.DelegatedCheckout = exports.Climate = exports.Checkout = exports.Capital = exports.BillingPortal = exports.Billing = exports.Apps = exports.WebhookEndpoints = exports.Transfers = exports.Topups = exports.Tokens = exports.TaxRates = exports.TaxIds = exports.TaxCodes = exports.Subscriptions = exports.SubscriptionSchedules = exports.SubscriptionItems = exports.Sources = exports.ShippingRates = exports.SetupIntents = void 0;
5
+ exports.V2 = exports.Treasury = exports.TestHelpers = exports.Terminal = exports.Tax = exports.Sigma = exports.Reporting = exports.Radar = exports.ProductCatalog = exports.Privacy = exports.Issuing = exports.Identity = exports.Forwarding = exports.FinancialConnections = exports.Entitlements = exports.DelegatedCheckout = exports.Climate = exports.Checkout = exports.Capital = exports.BillingPortal = exports.Billing = exports.Apps = exports.WebhookEndpoints = exports.Transfers = exports.Topups = exports.Tokens = exports.TaxRates = exports.TaxIds = exports.TaxCodes = exports.Subscriptions = exports.SubscriptionSchedules = exports.SubscriptionItems = exports.Sources = exports.ShippingRates = exports.SetupIntents = void 0;
6
6
  const ResourceNamespace_js_1 = require("./ResourceNamespace.js");
7
7
  const AccountEvaluations_js_1 = require("./resources/Radar/AccountEvaluations.js");
8
8
  const AccountLinks_js_1 = require("./resources/V2/Core/AccountLinks.js");
@@ -133,6 +133,7 @@ const Transactions_js_3 = require("./resources/Tax/Transactions.js");
133
133
  const Transactions_js_4 = require("./resources/TestHelpers/Issuing/Transactions.js");
134
134
  const Transactions_js_5 = require("./resources/Treasury/Transactions.js");
135
135
  const Transactions_js_6 = require("./resources/V2/MoneyManagement/Transactions.js");
136
+ const TrialOffers_js_1 = require("./resources/ProductCatalog/TrialOffers.js");
136
137
  const UsBankAccounts_js_1 = require("./resources/V2/Core/Vault/UsBankAccounts.js");
137
138
  const ValueListItems_js_1 = require("./resources/Radar/ValueListItems.js");
138
139
  const ValueLists_js_1 = require("./resources/Radar/ValueLists.js");
@@ -332,6 +333,9 @@ exports.Issuing = (0, ResourceNamespace_js_1.resourceNamespace)('issuing', {
332
333
  exports.Privacy = (0, ResourceNamespace_js_1.resourceNamespace)('privacy', {
333
334
  RedactionJobs: RedactionJobs_js_1.RedactionJobs,
334
335
  });
336
+ exports.ProductCatalog = (0, ResourceNamespace_js_1.resourceNamespace)('productCatalog', {
337
+ TrialOffers: TrialOffers_js_1.TrialOffers,
338
+ });
335
339
  exports.Radar = (0, ResourceNamespace_js_1.resourceNamespace)('radar', {
336
340
  AccountEvaluations: AccountEvaluations_js_1.AccountEvaluations,
337
341
  EarlyFraudWarnings: EarlyFraudWarnings_js_1.EarlyFraudWarnings,
@@ -37,7 +37,7 @@ const ALLOWED_CONFIG_PROPERTIES = [
37
37
  ];
38
38
  const defaultRequestSenderFactory = (stripe) => new RequestSender_js_1.RequestSender(stripe, StripeResource_js_1.StripeResource.MAX_BUFFERED_REQUEST_METRICS);
39
39
  function createStripe(platformFunctions, requestSender = defaultRequestSenderFactory) {
40
- Stripe.PACKAGE_VERSION = '20.1.0-alpha.2';
40
+ Stripe.PACKAGE_VERSION = '20.1.0-alpha.3';
41
41
  Stripe.API_VERSION = apiVersion_js_1.ApiVersion;
42
42
  Stripe.USER_AGENT = Object.assign({ bindings_version: Stripe.PACKAGE_VERSION, lang: 'node', publisher: 'stripe', uname: null, typescript: false }, (0, utils_js_1.determineProcessUserAgentProperties)());
43
43
  Stripe.StripeResource = StripeResource_js_1.StripeResource;
@@ -0,0 +1,9 @@
1
+ // File generated from our OpenAPI spec
2
+ import { StripeResource } from '../../StripeResource.js';
3
+ const stripeMethod = StripeResource.method;
4
+ export const TrialOffers = StripeResource.extend({
5
+ create: stripeMethod({
6
+ method: 'POST',
7
+ fullPath: '/v1/product_catalog/trial_offers',
8
+ }),
9
+ });
package/esm/resources.js CHANGED
@@ -129,6 +129,7 @@ import { Transactions as TaxTransactions } from './resources/Tax/Transactions.js
129
129
  import { Transactions as TestHelpersIssuingTransactions } from './resources/TestHelpers/Issuing/Transactions.js';
130
130
  import { Transactions as TreasuryTransactions } from './resources/Treasury/Transactions.js';
131
131
  import { Transactions as V2MoneyManagementTransactions } from './resources/V2/MoneyManagement/Transactions.js';
132
+ import { TrialOffers as ProductCatalogTrialOffers } from './resources/ProductCatalog/TrialOffers.js';
132
133
  import { UsBankAccounts as V2CoreVaultUsBankAccounts } from './resources/V2/Core/Vault/UsBankAccounts.js';
133
134
  import { ValueListItems as RadarValueListItems } from './resources/Radar/ValueListItems.js';
134
135
  import { ValueLists as RadarValueLists } from './resources/Radar/ValueLists.js';
@@ -265,6 +266,9 @@ export const Issuing = resourceNamespace('issuing', {
265
266
  export const Privacy = resourceNamespace('privacy', {
266
267
  RedactionJobs: PrivacyRedactionJobs,
267
268
  });
269
+ export const ProductCatalog = resourceNamespace('productCatalog', {
270
+ TrialOffers: ProductCatalogTrialOffers,
271
+ });
268
272
  export const Radar = resourceNamespace('radar', {
269
273
  AccountEvaluations: RadarAccountEvaluations,
270
274
  EarlyFraudWarnings: RadarEarlyFraudWarnings,
@@ -34,7 +34,7 @@ const ALLOWED_CONFIG_PROPERTIES = [
34
34
  ];
35
35
  const defaultRequestSenderFactory = (stripe) => new RequestSender(stripe, StripeResource.MAX_BUFFERED_REQUEST_METRICS);
36
36
  export function createStripe(platformFunctions, requestSender = defaultRequestSenderFactory) {
37
- Stripe.PACKAGE_VERSION = '20.1.0-alpha.2';
37
+ Stripe.PACKAGE_VERSION = '20.1.0-alpha.3';
38
38
  Stripe.API_VERSION = ApiVersion;
39
39
  Stripe.USER_AGENT = Object.assign({ bindings_version: Stripe.PACKAGE_VERSION, lang: 'node', publisher: 'stripe', uname: null, typescript: false }, determineProcessUserAgentProperties());
40
40
  Stripe.StripeResource = StripeResource;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stripe",
3
- "version": "20.1.0-alpha.2",
3
+ "version": "20.1.0-alpha.3",
4
4
  "description": "Stripe API wrapper",
5
5
  "keywords": [
6
6
  "stripe",
@@ -272,26 +272,6 @@ declare module 'stripe' {
272
272
  * The total before any discounts or taxes are applied.
273
273
  */
274
274
  amount_subtotal: number;
275
-
276
- /**
277
- * The total after discounts but before taxes are applied.
278
- */
279
- amount_subtotal_after_discount: number;
280
-
281
- /**
282
- * The total after discounts and taxes.
283
- */
284
- amount_total: number;
285
-
286
- /**
287
- * The per-unit amount of the item after discounts but before taxes are applied.
288
- */
289
- unit_amount_after_discount: number;
290
-
291
- /**
292
- * The per-unit discount amount. If no discount were applied, defaults to 0.
293
- */
294
- unit_discount: number;
295
275
  }
296
276
 
297
277
  interface OrderDetails {
@@ -369,11 +349,6 @@ declare module 'stripe' {
369
349
  type Status = 'completed' | 'expired' | 'open';
370
350
 
371
351
  interface TotalDetails {
372
- /**
373
- * The amount discount of the total details.
374
- */
375
- amount_discount: number | null;
376
-
377
352
  /**
378
353
  * The amount fulfillment of the total details.
379
354
  */
@@ -385,9 +360,14 @@ declare module 'stripe' {
385
360
  amount_tax: number | null;
386
361
 
387
362
  /**
388
- * Total of all items after discounts but before taxes are applied.
363
+ * The amount of order-level discounts applied to the cart. The total discount amount for this session can be computed by summing the cart discount and the item discounts.
364
+ */
365
+ amount_cart_discount: number | null;
366
+
367
+ /**
368
+ * The amount of item-level discounts applied to the cart. The total discount amount for this session can be computed by summing the cart discount and the item discounts.
389
369
  */
390
- amount_subtotal_after_discount: number | null;
370
+ amount_items_discount: number | null;
391
371
 
392
372
  /**
393
373
  * The applicable fees of the total details.
@@ -191,6 +191,11 @@ declare module 'stripe' {
191
191
  */
192
192
  payment_method_types: Array<string>;
193
193
 
194
+ /**
195
+ * When you enable this parameter, this PaymentIntent will route your payment to processors that you configure in the dashboard.
196
+ */
197
+ payments_orchestration?: PaymentIntent.PaymentsOrchestration | null;
198
+
194
199
  presentment_details?: PaymentIntent.PresentmentDetails;
195
200
 
196
201
  /**
@@ -3674,6 +3679,13 @@ declare module 'stripe' {
3674
3679
  }
3675
3680
  }
3676
3681
 
3682
+ interface PaymentsOrchestration {
3683
+ /**
3684
+ * Whether this feature is enabled.
3685
+ */
3686
+ enabled: boolean;
3687
+ }
3688
+
3677
3689
  interface PresentmentDetails {
3678
3690
  /**
3679
3691
  * Amount intended to be collected by this payment, denominated in `presentment_currency`.
@@ -166,6 +166,11 @@ declare module 'stripe' {
166
166
  */
167
167
  payment_method_types?: Array<string>;
168
168
 
169
+ /**
170
+ * When you enable this parameter, this PaymentIntent will route your payment to processors that you configure in the dashboard.
171
+ */
172
+ payments_orchestration?: PaymentIntentCreateParams.PaymentsOrchestration;
173
+
169
174
  /**
170
175
  * Options to configure Radar. Learn more about [Radar Sessions](https://stripe.com/docs/radar/radar-session).
171
176
  */
@@ -6984,6 +6989,13 @@ declare module 'stripe' {
6984
6989
  }
6985
6990
  }
6986
6991
 
6992
+ interface PaymentsOrchestration {
6993
+ /**
6994
+ * Whether this feature is enabled.
6995
+ */
6996
+ enabled: boolean;
6997
+ }
6998
+
6987
6999
  interface RadarOptions {
6988
7000
  /**
6989
7001
  * A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments.
@@ -0,0 +1,77 @@
1
+ // File generated from our OpenAPI spec
2
+
3
+ declare module 'stripe' {
4
+ namespace Stripe {
5
+ namespace ProductCatalog {
6
+ /**
7
+ * Resource for the TrialOffer API, used to describe a subscription item's trial period settings.
8
+ * Renders a TrialOffer object that describes the price, duration, end_behavior of a trial offer.
9
+ */
10
+ interface TrialOffer {
11
+ /**
12
+ * Unique identifier for the object.
13
+ */
14
+ id: string;
15
+
16
+ /**
17
+ * String representing the object's type. Objects of the same type share the same value.
18
+ */
19
+ object: 'product_catalog.trial_offer';
20
+
21
+ duration: TrialOffer.Duration;
22
+
23
+ end_behavior: TrialOffer.EndBehavior;
24
+
25
+ /**
26
+ * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
27
+ */
28
+ livemode: boolean;
29
+
30
+ /**
31
+ * The price during the trial offer.
32
+ */
33
+ price: string | Stripe.Price;
34
+ }
35
+
36
+ namespace TrialOffer {
37
+ interface Duration {
38
+ relative: Duration.Relative;
39
+
40
+ /**
41
+ * The type of trial offer duration.
42
+ */
43
+ type: Duration.Type;
44
+ }
45
+
46
+ namespace Duration {
47
+ interface Relative {
48
+ /**
49
+ * The number of iterations of the price's interval for this trial offer.
50
+ */
51
+ iterations: number;
52
+ }
53
+
54
+ type Type = 'relative' | 'timestamp';
55
+ }
56
+
57
+ interface EndBehavior {
58
+ transition: EndBehavior.Transition;
59
+
60
+ /**
61
+ * The type of behavior when the trial offer ends.
62
+ */
63
+ type: 'transition';
64
+ }
65
+
66
+ namespace EndBehavior {
67
+ interface Transition {
68
+ /**
69
+ * The new price to use at the end of the trial offer period.
70
+ */
71
+ price: string;
72
+ }
73
+ }
74
+ }
75
+ }
76
+ }
77
+ }
@@ -0,0 +1,80 @@
1
+ // File generated from our OpenAPI spec
2
+
3
+ declare module 'stripe' {
4
+ namespace Stripe {
5
+ namespace ProductCatalog {
6
+ interface TrialOfferCreateParams {
7
+ /**
8
+ * Duration of one service period of the trial.
9
+ */
10
+ duration: TrialOfferCreateParams.Duration;
11
+
12
+ /**
13
+ * Define behavior that occurs at the end of the trial.
14
+ */
15
+ end_behavior: TrialOfferCreateParams.EndBehavior;
16
+
17
+ /**
18
+ * Price configuration during the trial period (amount, billing scheme, etc).
19
+ */
20
+ price: string;
21
+
22
+ /**
23
+ * Specifies which fields in the response should be expanded.
24
+ */
25
+ expand?: Array<string>;
26
+ }
27
+
28
+ namespace TrialOfferCreateParams {
29
+ interface Duration {
30
+ /**
31
+ * The relative duration of the trial period computed as the number of recurring price intervals.
32
+ */
33
+ relative?: Duration.Relative;
34
+
35
+ /**
36
+ * Specifies how the trial offer duration is determined.
37
+ */
38
+ type: Duration.Type;
39
+ }
40
+
41
+ namespace Duration {
42
+ interface Relative {
43
+ /**
44
+ * The number of recurring price's interval to apply for the trial period.
45
+ */
46
+ iterations: number;
47
+ }
48
+
49
+ type Type = 'relative' | 'timestamp';
50
+ }
51
+
52
+ interface EndBehavior {
53
+ /**
54
+ * The transition to apply when the trial offer ends.
55
+ */
56
+ transition: EndBehavior.Transition;
57
+ }
58
+
59
+ namespace EndBehavior {
60
+ interface Transition {
61
+ /**
62
+ * The price to transition the recurring item to when the trial offer ends.
63
+ */
64
+ price: string;
65
+ }
66
+ }
67
+ }
68
+
69
+ class TrialOffersResource {
70
+ /**
71
+ * Creates a trial offer.
72
+ */
73
+ create(
74
+ params: TrialOfferCreateParams,
75
+ options?: RequestOptions
76
+ ): Promise<Stripe.Response<Stripe.ProductCatalog.TrialOffer>>;
77
+ }
78
+ }
79
+ }
80
+ }
package/types/index.d.ts CHANGED
@@ -94,6 +94,7 @@
94
94
  ///<reference path='./PlansResource.d.ts' />
95
95
  ///<reference path='./PricesResource.d.ts' />
96
96
  ///<reference path='./Privacy/RedactionJobsResource.d.ts' />
97
+ ///<reference path='./ProductCatalog/TrialOffersResource.d.ts' />
97
98
  ///<reference path='./ProductsResource.d.ts' />
98
99
  ///<reference path='./PromotionCodesResource.d.ts' />
99
100
  ///<reference path='./QuotesResource.d.ts' />
@@ -329,6 +330,7 @@
329
330
  ///<reference path='./Prices.d.ts' />
330
331
  ///<reference path='./Privacy/RedactionJobValidationErrors.d.ts' />
331
332
  ///<reference path='./Privacy/RedactionJobs.d.ts' />
333
+ ///<reference path='./ProductCatalog/TrialOffers.d.ts' />
332
334
  ///<reference path='./ProductFeatures.d.ts' />
333
335
  ///<reference path='./Products.d.ts' />
334
336
  ///<reference path='./PromotionCodes.d.ts' />
@@ -601,6 +603,9 @@ declare module 'stripe' {
601
603
  privacy: {
602
604
  redactionJobs: Stripe.Privacy.RedactionJobsResource;
603
605
  };
606
+ productCatalog: {
607
+ trialOffers: Stripe.ProductCatalog.TrialOffersResource;
608
+ };
604
609
  radar: {
605
610
  accountEvaluations: Stripe.Radar.AccountEvaluationsResource;
606
611
  earlyFraudWarnings: Stripe.Radar.EarlyFraudWarningsResource;