stripe 15.2.0 → 15.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.
package/CHANGELOG.md CHANGED
@@ -1,17 +1,28 @@
1
1
  # Changelog
2
2
 
3
+ ## 15.3.0 - 2024-04-18
4
+ * [#2069](https://github.com/stripe/stripe-node/pull/2069) Update generated code
5
+ * Add support for `create_preview` method on resource `Invoice`
6
+ * Add support for `payment_method_data` on `Checkout.SessionCreateParams`
7
+ * Add support for `saved_payment_method_options` on `Checkout.SessionCreateParams` and `Checkout.Session`
8
+ * Add support for `mobilepay` on `Checkout.Session.payment_method_options` and `Checkout.SessionCreateParams.payment_method_options`
9
+ * Add support for new value `mobilepay` on enum `Checkout.SessionCreateParams.payment_method_types[]`
10
+ * Add support for `allow_redisplay` on `ConfirmationTokenCreateParams.testHelpers.payment_method_data`, `CustomerListPaymentMethodsParams`, `PaymentIntentConfirmParams.payment_method_data`, `PaymentIntentCreateParams.payment_method_data`, `PaymentIntentUpdateParams.payment_method_data`, `PaymentMethodCreateParams`, `PaymentMethodUpdateParams`, `SetupIntentConfirmParams.payment_method_data`, `SetupIntentCreateParams.payment_method_data`, and `SetupIntentUpdateParams.payment_method_data`
11
+ * Add support for `schedule_details` and `subscription_details` on `InvoiceUpcomingLinesParams` and `InvoiceUpcomingParams`
12
+ * Add support for new value `other` on enums `Issuing.AuthorizationCaptureParams.testHelpers.purchase_details.fuel.unit`, `Issuing.TransactionCreateForceCaptureParams.testHelpers.purchase_details.fuel.unit`, and `Issuing.TransactionCreateUnlinkedRefundParams.testHelpers.purchase_details.fuel.unit`
13
+
3
14
  ## 15.2.0 - 2024-04-16
4
15
  * [#2064](https://github.com/stripe/stripe-node/pull/2064) Update generated code
5
- * Add support for new resource `Entitlements.ActiveEntitlementSummary`
6
- * Add support for `balances` and `payouts_list` on `AccountSession.components` and `AccountSessionCreateParams.components`
7
- * Change `AccountSession.components.payment_details.features.destination_on_behalf_of_charge_management` and `AccountSession.components.payments.features.destination_on_behalf_of_charge_management` to be required
8
- * Change `Billing.MeterEventCreateParams.timestamp` and `Dispute.payment_method_details.card` to be optional
9
- * Change type of `Dispute.payment_method_details.card` from `DisputePaymentMethodDetailsCard | null` to `DisputePaymentMethodDetailsCard`
10
- * Add support for new value `entitlements.active_entitlement_summary.updated` on enum `Event.type`
11
- * Remove support for `config` on `Forwarding.RequestCreateParams` and `Forwarding.Request`. This field is no longer used by the Forwarding Request API.
12
- * Add support for `capture_method` on `PaymentIntent.payment_method_options.revolut_pay`, `PaymentIntentConfirmParams.payment_method_options.revolut_pay`, `PaymentIntentCreateParams.payment_method_options.revolut_pay`, and `PaymentIntentUpdateParams.payment_method_options.revolut_pay`
13
- * Add support for `swish` on `PaymentMethodConfigurationCreateParams`, `PaymentMethodConfigurationUpdateParams`, and `PaymentMethodConfiguration`
14
- * Add support for new value `entitlements.active_entitlement_summary.updated` on enums `WebhookEndpointCreateParams.enabled_events[]` and `WebhookEndpointUpdateParams.enabled_events[]`
16
+ * Add support for new resource `Entitlements.ActiveEntitlementSummary`
17
+ * Add support for `balances` and `payouts_list` on `AccountSession.components` and `AccountSessionCreateParams.components`
18
+ * Change `AccountSession.components.payment_details.features.destination_on_behalf_of_charge_management` and `AccountSession.components.payments.features.destination_on_behalf_of_charge_management` to be required
19
+ * Change `Billing.MeterEventCreateParams.timestamp` and `Dispute.payment_method_details.card` to be optional
20
+ * Change type of `Dispute.payment_method_details.card` from `DisputePaymentMethodDetailsCard | null` to `DisputePaymentMethodDetailsCard`
21
+ * Add support for new value `entitlements.active_entitlement_summary.updated` on enum `Event.type`
22
+ * Remove support for `config` on `Forwarding.RequestCreateParams` and `Forwarding.Request`. This field is no longer used by the Forwarding Request API.
23
+ * Add support for `capture_method` on `PaymentIntent.payment_method_options.revolut_pay`, `PaymentIntentConfirmParams.payment_method_options.revolut_pay`, `PaymentIntentCreateParams.payment_method_options.revolut_pay`, and `PaymentIntentUpdateParams.payment_method_options.revolut_pay`
24
+ * Add support for `swish` on `PaymentMethodConfigurationCreateParams`, `PaymentMethodConfigurationUpdateParams`, and `PaymentMethodConfiguration`
25
+ * Add support for new value `entitlements.active_entitlement_summary.updated` on enums `WebhookEndpointCreateParams.enabled_events[]` and `WebhookEndpointUpdateParams.enabled_events[]`
15
26
 
16
27
  ## 15.1.0 - 2024-04-11
17
28
  * [#2062](https://github.com/stripe/stripe-node/pull/2062) Update generated code
package/VERSION CHANGED
@@ -1 +1 @@
1
- 15.2.0
1
+ 15.3.0
@@ -14,6 +14,10 @@ exports.Invoices = StripeResource_js_1.StripeResource.extend({
14
14
  methodType: 'list',
15
15
  }),
16
16
  del: stripeMethod({ method: 'DELETE', fullPath: '/v1/invoices/{invoice}' }),
17
+ createPreview: stripeMethod({
18
+ method: 'POST',
19
+ fullPath: '/v1/invoices/create_preview',
20
+ }),
17
21
  finalizeInvoice: stripeMethod({
18
22
  method: 'POST',
19
23
  fullPath: '/v1/invoices/{invoice}/finalize',
@@ -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 = '15.2.0';
37
+ Stripe.PACKAGE_VERSION = '15.3.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;
@@ -11,6 +11,10 @@ export const Invoices = StripeResource.extend({
11
11
  methodType: 'list',
12
12
  }),
13
13
  del: stripeMethod({ method: 'DELETE', fullPath: '/v1/invoices/{invoice}' }),
14
+ createPreview: stripeMethod({
15
+ method: 'POST',
16
+ fullPath: '/v1/invoices/create_preview',
17
+ }),
14
18
  finalizeInvoice: stripeMethod({
15
19
  method: 'POST',
16
20
  fullPath: '/v1/invoices/{invoice}/finalize',
@@ -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 = '15.2.0';
34
+ Stripe.PACKAGE_VERSION = '15.3.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": "15.2.0",
3
+ "version": "15.3.0",
4
4
  "description": "Stripe API wrapper",
5
5
  "keywords": [
6
6
  "stripe",
@@ -19,12 +19,12 @@ declare module 'stripe' {
19
19
  object: 'billing.meter_event_summary';
20
20
 
21
21
  /**
22
- * Aggregated value of all the events within start_time (inclusive) and end_time (inclusive). The aggregation strategy is defined on meter via `default_aggregation``.
22
+ * Aggregated value of all the events within `start_time` (inclusive) and `end_time` (inclusive). The aggregation strategy is defined on meter via `default_aggregation`.
23
23
  */
24
24
  aggregated_value: number;
25
25
 
26
26
  /**
27
- * End timestamp for this usage summary (inclusive).
27
+ * End timestamp for this event summary (inclusive).
28
28
  */
29
29
  end_time: number;
30
30
 
@@ -34,12 +34,12 @@ declare module 'stripe' {
34
34
  livemode: boolean;
35
35
 
36
36
  /**
37
- * The meter associated with this usage summary.
37
+ * The meter associated with this event summary.
38
38
  */
39
39
  meter: string;
40
40
 
41
41
  /**
42
- * Start timestamp for this usage summary (inclusive).
42
+ * Start timestamp for this event summary (inclusive).
43
43
  */
44
44
  start_time: number;
45
45
  }
@@ -34,7 +34,7 @@ declare module 'stripe' {
34
34
  livemode: boolean;
35
35
 
36
36
  /**
37
- * The payload of the event.
37
+ * The payload of the event. This contains the fields corresponding to a meter's `customer_mapping.event_payload_key` (default is `stripe_customer_id`) and `value_settings.event_payload_key` (default is `value`). Read more about the [payload](https://stripe.com/docs/billing/subscriptions/usage-based/recording-usage#payload-key-overrides).
38
38
  */
39
39
  payload: {
40
40
  [key: string]: string;
@@ -10,7 +10,7 @@ declare module 'stripe' {
10
10
  event_name: string;
11
11
 
12
12
  /**
13
- * The payload of the event. This must contain a field with the event's numerical value and a field to map the event to a customer.
13
+ * The payload of the event. This must contain the fields corresponding to a meter's `customer_mapping.event_payload_key` (default is `stripe_customer_id`) and `value_settings.event_payload_key` (default is `value`). Read more about the [payload](https://docs.stripe.com/billing/subscriptions/usage-based/recording-usage#payload-key-overrides).
14
14
  */
15
15
  payload: {
16
16
  [key: string]: string;
@@ -27,7 +27,7 @@ declare module 'stripe' {
27
27
  identifier?: string;
28
28
 
29
29
  /**
30
- * The time of the event. Measured in seconds since the Unix epoch. Defaults to current timestamp if not specified.
30
+ * The time of the event. Measured in seconds since the Unix epoch. Must be within the past 35 calendar days or up to 5 minutes in the future. Defaults to current timestamp if not specified.
31
31
  */
32
32
  timestamp?: number;
33
33
  }
@@ -32,12 +32,12 @@ declare module 'stripe' {
32
32
  display_name: string;
33
33
 
34
34
  /**
35
- * The name of the usage event to record usage for. Corresponds with the `event_name` field on usage events.
35
+ * The name of the meter event to record usage for. Corresponds with the `event_name` field on meter events.
36
36
  */
37
37
  event_name: string;
38
38
 
39
39
  /**
40
- * The time window to pre-aggregate usage events for, if any.
40
+ * The time window to pre-aggregate meter events for, if any.
41
41
  */
42
42
  event_time_window: Meter.EventTimeWindow | null;
43
43
 
@@ -64,7 +64,7 @@ declare module 'stripe' {
64
64
  namespace Meter {
65
65
  interface CustomerMapping {
66
66
  /**
67
- * The key in the usage event payload to use for mapping the event to a customer.
67
+ * The key in the meter event payload to use for mapping the event to a customer.
68
68
  */
69
69
  event_payload_key: string;
70
70
 
@@ -98,7 +98,7 @@ declare module 'stripe' {
98
98
 
99
99
  interface ValueSettings {
100
100
  /**
101
- * The key in the usage event payload to use as the value for this meter.
101
+ * The key in the meter event payload to use as the value for this meter.
102
102
  */
103
103
  event_payload_key: string;
104
104
  }
@@ -15,7 +15,7 @@ declare module 'stripe' {
15
15
  display_name: string;
16
16
 
17
17
  /**
18
- * The name of the usage event to record usage for. Corresponds with the `event_name` field on usage events.
18
+ * The name of the meter event to record usage for. Corresponds with the `event_name` field on meter events.
19
19
  */
20
20
  event_name: string;
21
21
 
@@ -25,7 +25,7 @@ declare module 'stripe' {
25
25
  customer_mapping?: MeterCreateParams.CustomerMapping;
26
26
 
27
27
  /**
28
- * The time window to pre-aggregate usage events for, if any.
28
+ * The time window to pre-aggregate meter events for, if any.
29
29
  */
30
30
  event_time_window?: MeterCreateParams.EventTimeWindow;
31
31
 
@@ -35,7 +35,7 @@ declare module 'stripe' {
35
35
  expand?: Array<string>;
36
36
 
37
37
  /**
38
- * Fields that specify how to calculate a usage event's value.
38
+ * Fields that specify how to calculate a meter event's value.
39
39
  */
40
40
  value_settings?: MeterCreateParams.ValueSettings;
41
41
  }
@@ -55,7 +55,7 @@ declare module 'stripe' {
55
55
 
56
56
  interface DefaultAggregation {
57
57
  /**
58
- * Specifies how events are aggregated. Allowed values are `count` to count the number of events, `sum` to sum each event's value, or `last` to use the last event's value.
58
+ * Specifies how events are aggregated. Allowed values are `count` to count the number of events and `sum` to sum each event's value.
59
59
  */
60
60
  formula: DefaultAggregation.Formula;
61
61
  }
@@ -123,12 +123,12 @@ declare module 'stripe' {
123
123
  customer: string;
124
124
 
125
125
  /**
126
- * The timestamp from when to stop aggregating usage events (exclusive).
126
+ * The timestamp from when to stop aggregating meter events (exclusive).
127
127
  */
128
128
  end_time: number;
129
129
 
130
130
  /**
131
- * The timestamp from when to start aggregating usage events (inclusive).
131
+ * The timestamp from when to start aggregating meter events (inclusive).
132
132
  */
133
133
  start_time: number;
134
134
 
@@ -228,6 +228,11 @@ declare module 'stripe' {
228
228
  */
229
229
  return_url?: string;
230
230
 
231
+ /**
232
+ * Controls saved payment method settings for the session. Only available in `payment` and `subscription` mode.
233
+ */
234
+ saved_payment_method_options: Session.SavedPaymentMethodOptions | null;
235
+
231
236
  /**
232
237
  * The ID of the SetupIntent for Checkout Sessions in `setup` mode.
233
238
  */
@@ -912,6 +917,8 @@ declare module 'stripe' {
912
917
 
913
918
  link?: PaymentMethodOptions.Link;
914
919
 
920
+ mobilepay?: PaymentMethodOptions.Mobilepay;
921
+
915
922
  oxxo?: PaymentMethodOptions.Oxxo;
916
923
 
917
924
  p24?: PaymentMethodOptions.P24;
@@ -1312,6 +1319,17 @@ declare module 'stripe' {
1312
1319
  type SetupFutureUsage = 'none' | 'off_session';
1313
1320
  }
1314
1321
 
1322
+ interface Mobilepay {
1323
+ /**
1324
+ * Indicates that you intend to make future payments with this PaymentIntent's payment method.
1325
+ *
1326
+ * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.
1327
+ *
1328
+ * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).
1329
+ */
1330
+ setup_future_usage?: 'none';
1331
+ }
1332
+
1315
1333
  interface Oxxo {
1316
1334
  /**
1317
1335
  * The number of calendar days before an OXXO invoice expires. For example, if you create an OXXO invoice on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time.
@@ -1485,6 +1503,26 @@ declare module 'stripe' {
1485
1503
 
1486
1504
  type RedirectOnCompletion = 'always' | 'if_required' | 'never';
1487
1505
 
1506
+ interface SavedPaymentMethodOptions {
1507
+ /**
1508
+ * Controls which payment methods are eligible to be redisplayed to returning customers. Corresponds to `allow_redisplay` on the payment method.
1509
+ */
1510
+ allow_redisplay_filters: Array<
1511
+ SavedPaymentMethodOptions.AllowRedisplayFilter
1512
+ > | null;
1513
+
1514
+ /**
1515
+ * Enable customers to choose if they wish to save their payment method for future use.
1516
+ */
1517
+ payment_method_save: SavedPaymentMethodOptions.PaymentMethodSave | null;
1518
+ }
1519
+
1520
+ namespace SavedPaymentMethodOptions {
1521
+ type AllowRedisplayFilter = 'always' | 'limited' | 'unspecified';
1522
+
1523
+ type PaymentMethodSave = 'disabled' | 'enabled';
1524
+ }
1525
+
1488
1526
  interface ShippingAddressCollection {
1489
1527
  /**
1490
1528
  * An array of two-letter ISO country codes representing which countries Checkout should provide as options for
@@ -162,6 +162,11 @@ declare module 'stripe' {
162
162
  */
163
163
  payment_method_configuration?: string;
164
164
 
165
+ /**
166
+ * This parameter allows you to set some attributes on the payment method created during a Checkout session.
167
+ */
168
+ payment_method_data?: SessionCreateParams.PaymentMethodData;
169
+
165
170
  /**
166
171
  * Payment-method-specific configuration.
167
172
  */
@@ -202,6 +207,11 @@ declare module 'stripe' {
202
207
  */
203
208
  return_url?: string;
204
209
 
210
+ /**
211
+ * Controls saved payment method settings for the session. Only available in `payment` and `subscription` mode.
212
+ */
213
+ saved_payment_method_options?: SessionCreateParams.SavedPaymentMethodOptions;
214
+
205
215
  /**
206
216
  * A subset of parameters to be passed to SetupIntent creation for Checkout Sessions in `setup` mode.
207
217
  */
@@ -947,6 +957,17 @@ declare module 'stripe' {
947
957
 
948
958
  type PaymentMethodCollection = 'always' | 'if_required';
949
959
 
960
+ interface PaymentMethodData {
961
+ /**
962
+ * Allow redisplay will be set on the payment method on confirmation and indicates whether this payment method can be shown again to the customer in a checkout flow. Only set this field if you wish to override the allow_redisplay value determined by Checkout.
963
+ */
964
+ allow_redisplay?: PaymentMethodData.AllowRedisplay;
965
+ }
966
+
967
+ namespace PaymentMethodData {
968
+ type AllowRedisplay = 'always' | 'limited' | 'unspecified';
969
+ }
970
+
950
971
  interface PaymentMethodOptions {
951
972
  /**
952
973
  * contains details about the ACSS Debit payment method options.
@@ -1048,6 +1069,11 @@ declare module 'stripe' {
1048
1069
  */
1049
1070
  link?: PaymentMethodOptions.Link;
1050
1071
 
1072
+ /**
1073
+ * contains details about the Mobilepay payment method options.
1074
+ */
1075
+ mobilepay?: PaymentMethodOptions.Mobilepay;
1076
+
1051
1077
  /**
1052
1078
  * contains details about the OXXO payment method options.
1053
1079
  */
@@ -1507,6 +1533,17 @@ declare module 'stripe' {
1507
1533
  type SetupFutureUsage = 'none' | 'off_session';
1508
1534
  }
1509
1535
 
1536
+ interface Mobilepay {
1537
+ /**
1538
+ * Indicates that you intend to make future payments with this PaymentIntent's payment method.
1539
+ *
1540
+ * Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.
1541
+ *
1542
+ * When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).
1543
+ */
1544
+ setup_future_usage?: 'none';
1545
+ }
1546
+
1510
1547
  interface Oxxo {
1511
1548
  /**
1512
1549
  * The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time.
@@ -1762,6 +1799,7 @@ declare module 'stripe' {
1762
1799
  | 'klarna'
1763
1800
  | 'konbini'
1764
1801
  | 'link'
1802
+ | 'mobilepay'
1765
1803
  | 'oxxo'
1766
1804
  | 'p24'
1767
1805
  | 'paynow'
@@ -1785,6 +1823,26 @@ declare module 'stripe' {
1785
1823
 
1786
1824
  type RedirectOnCompletion = 'always' | 'if_required' | 'never';
1787
1825
 
1826
+ interface SavedPaymentMethodOptions {
1827
+ /**
1828
+ * Controls which payment methods are eligible to be redisplayed to returning customers. Corresponds to `allow_redisplay` on the payment method.
1829
+ */
1830
+ allow_redisplay_filters?: Array<
1831
+ SavedPaymentMethodOptions.AllowRedisplayFilter
1832
+ >;
1833
+
1834
+ /**
1835
+ * Enable customers to choose if they wish to save their payment method for future use.
1836
+ */
1837
+ payment_method_save?: SavedPaymentMethodOptions.PaymentMethodSave;
1838
+ }
1839
+
1840
+ namespace SavedPaymentMethodOptions {
1841
+ type AllowRedisplayFilter = 'always' | 'limited' | 'unspecified';
1842
+
1843
+ type PaymentMethodSave = 'disabled' | 'enabled';
1844
+ }
1845
+
1788
1846
  interface SetupIntentData {
1789
1847
  /**
1790
1848
  * An arbitrary string attached to the object. Often useful for displaying to users.
@@ -767,6 +767,11 @@ declare module 'stripe' {
767
767
  }
768
768
 
769
769
  interface CustomerListPaymentMethodsParams extends PaginationParams {
770
+ /**
771
+ * 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. The field defaults to `unspecified`.
772
+ */
773
+ allow_redisplay?: CustomerListPaymentMethodsParams.AllowRedisplay;
774
+
770
775
  /**
771
776
  * Specifies which fields in the response should be expanded.
772
777
  */
@@ -779,6 +784,8 @@ declare module 'stripe' {
779
784
  }
780
785
 
781
786
  namespace CustomerListPaymentMethodsParams {
787
+ type AllowRedisplay = 'always' | 'limited' | 'unspecified';
788
+
782
789
  type Type =
783
790
  | 'acss_debit'
784
791
  | 'affirm'