stripe 16.3.0-beta.1 → 16.4.0-beta.1

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,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 16.4.0-beta.1 - 2024-07-11
4
+ * [#2128](https://github.com/stripe/stripe-node/pull/2128) Update generated code for beta
5
+ * Change `ConfirmationToken.payment_method_options` and `CustomerSession.components.payment_element` to be required
6
+ * Add support for new value `not_qualified` on enum `Dispute.evidence_details.enhanced_eligibility.visa_compelling_evidence_3.status`
7
+ * [#2134](https://github.com/stripe/stripe-node/pull/2134) Fix merge conflicts
8
+
3
9
  ## 16.3.0-beta.1 - 2024-07-05
4
10
  * [#2126](https://github.com/stripe/stripe-node/pull/2126) Update generated code for beta
5
11
  * ⚠️ Remove support for `payment_method_update` on `CustomerSession.components.payment_element.features` and `CustomerSessionCreateParams.components.payment_element.features`. Users are expected to completely migrate from using `payment_method_update`.
@@ -7,7 +13,13 @@
7
13
  * Add support for `list` and `retrieve` methods on resource `Institution`
8
14
  * Add support for `institution` on `Checkout.Session.payment_method_options.us_bank_account.financial_connections.filters`, `FinancialConnections.Session.filters`, `FinancialConnections.SessionCreateParams.filters`, `Invoice.payment_settings.payment_method_options.us_bank_account.financial_connections.filters`, `InvoiceCreateParams.payment_settings.payment_method_options.us_bank_account.financial_connections.filters`, `InvoiceUpdateParams.payment_settings.payment_method_options.us_bank_account.financial_connections.filters`, `PaymentIntent.payment_method_options.us_bank_account.financial_connections.filters`, `PaymentIntentConfirmParams.payment_method_options.us_bank_account.financial_connections.filters`, `PaymentIntentCreateParams.payment_method_options.us_bank_account.financial_connections.filters`, `PaymentIntentUpdateParams.payment_method_options.us_bank_account.financial_connections.filters`, `SetupIntent.payment_method_options.us_bank_account.financial_connections.filters`, `SetupIntentConfirmParams.payment_method_options.us_bank_account.financial_connections.filters`, `SetupIntentCreateParams.payment_method_options.us_bank_account.financial_connections.filters`, `SetupIntentUpdateParams.payment_method_options.us_bank_account.financial_connections.filters`, `Subscription.payment_settings.payment_method_options.us_bank_account.financial_connections.filters`, `SubscriptionCreateParams.payment_settings.payment_method_options.us_bank_account.financial_connections.filters`, and `SubscriptionUpdateParams.payment_settings.payment_method_options.us_bank_account.financial_connections.filters`
9
15
  * Add support for `payment_method_allow_redisplay_filters`, `payment_method_redisplay_limit`, `payment_method_redisplay`, and `payment_method_save_usage` on `CustomerSession.components.payment_element.features` and `CustomerSessionCreateParams.components.payment_element.features`
10
- * Add support for new value `balance` on enums `FinancialConnections.Account.subscriptions[]`, `FinancialConnections.AccountSubscribeParams.features[]`, and `FinancialConnections.AccountUnsubscribeParams.features[]`
16
+ * Add support for new value `balance` on enums `FinancialConnections.Account.subscriptions[]`, `FinancialConnections.AccountSubscribeParams.features[]`, and `FinancialConnections.AccountUnsubscribeParams.features[]`
17
+
18
+ ## 16.2.0 - 2024-07-05
19
+ * [#2125](https://github.com/stripe/stripe-node/pull/2125) Update generated code
20
+ * Add support for `add_lines`, `remove_lines`, and `update_lines` methods on resource `Invoice`
21
+ * Add support for new value `payment_intent_fx_quote_invalid` on enums `Invoice.last_finalization_error.code`, `PaymentIntent.last_payment_error.code`, `SetupAttempt.setup_error.code`, `SetupIntent.last_setup_error.code`, and `StripeError.code`
22
+ * Add support for `posted_at` on `Tax.TransactionCreateFromCalculationParams` and `Tax.Transaction`
11
23
 
12
24
  ## 16.2.0-beta.1 - 2024-06-27
13
25
  * [#2110](https://github.com/stripe/stripe-node/pull/2110) Update generated code for beta
package/VERSION CHANGED
@@ -1 +1 @@
1
- 16.3.0-beta.1
1
+ 16.4.0-beta.1
@@ -5,6 +5,9 @@ exports.resourceNamespace = void 0;
5
5
  // It also works recursively, so you could do i.e. `stripe.billing.invoicing.pay`.
6
6
  function ResourceNamespace(stripe, resources) {
7
7
  for (const name in resources) {
8
+ if (!Object.prototype.hasOwnProperty.call(resources, name)) {
9
+ continue;
10
+ }
8
11
  const camelCaseName = name[0].toLowerCase() + name.substring(1);
9
12
  const resource = new resources[name](stripe);
10
13
  this[camelCaseName] = resource;
package/cjs/Webhooks.js CHANGED
@@ -43,23 +43,16 @@ function createWebhooks(platformFunctions) {
43
43
  * @property {CryptoProvider} cryptoProvider - Crypto provider to use for computing the signature if none was provided. Defaults to NodeCryptoProvider.
44
44
  */
45
45
  generateTestHeaderString: function (opts) {
46
- if (!opts) {
47
- throw new Error_js_1.StripeError({
48
- message: 'Options are required',
49
- });
50
- }
51
- opts.timestamp =
52
- Math.floor(opts.timestamp) || Math.floor(Date.now() / 1000);
53
- opts.scheme = opts.scheme || signature.EXPECTED_SCHEME;
54
- opts.cryptoProvider = opts.cryptoProvider || getCryptoProvider();
55
- opts.signature =
56
- opts.signature ||
57
- opts.cryptoProvider.computeHMACSignature(opts.timestamp + '.' + opts.payload, opts.secret);
58
- const generatedHeader = [
59
- 't=' + opts.timestamp,
60
- opts.scheme + '=' + opts.signature,
61
- ].join(',');
62
- return generatedHeader;
46
+ const preparedOpts = prepareOptions(opts);
47
+ const signature = preparedOpts.signature ||
48
+ preparedOpts.cryptoProvider.computeHMACSignature(preparedOpts.payloadString, preparedOpts.secret);
49
+ return preparedOpts.generateHeaderString(signature);
50
+ },
51
+ generateTestHeaderStringAsync: async function (opts) {
52
+ const preparedOpts = prepareOptions(opts);
53
+ const signature = preparedOpts.signature ||
54
+ (await preparedOpts.cryptoProvider.computeHMACSignatureAsync(preparedOpts.payloadString, preparedOpts.secret));
55
+ return preparedOpts.generateHeaderString(signature);
63
56
  },
64
57
  };
65
58
  const signature = {
@@ -194,6 +187,25 @@ function createWebhooks(platformFunctions) {
194
187
  }
195
188
  return webhooksCryptoProviderInstance;
196
189
  }
190
+ function prepareOptions(opts) {
191
+ if (!opts) {
192
+ throw new Error_js_1.StripeError({
193
+ message: 'Options are required',
194
+ });
195
+ }
196
+ const timestamp = Math.floor(opts.timestamp) || Math.floor(Date.now() / 1000);
197
+ const scheme = opts.scheme || signature.EXPECTED_SCHEME;
198
+ const cryptoProvider = opts.cryptoProvider || getCryptoProvider();
199
+ const payloadString = `${timestamp}.${opts.payload}`;
200
+ const generateHeaderString = (signature) => {
201
+ return `t=${timestamp},${scheme}=${signature}`;
202
+ };
203
+ return Object.assign(Object.assign({}, opts), { timestamp,
204
+ scheme,
205
+ cryptoProvider,
206
+ payloadString,
207
+ generateHeaderString });
208
+ }
197
209
  Webhook.signature = signature;
198
210
  return Webhook;
199
211
  }
package/cjs/multipart.js CHANGED
@@ -24,6 +24,9 @@ const multipartDataGenerator = (method, data, headers) => {
24
24
  }
25
25
  const flattenedData = (0, utils_js_1.flattenAndStringify)(data);
26
26
  for (const k in flattenedData) {
27
+ if (!Object.prototype.hasOwnProperty.call(flattenedData, k)) {
28
+ continue;
29
+ }
27
30
  const v = flattenedData[k];
28
31
  push(`--${segno}`);
29
32
  if (Object.prototype.hasOwnProperty.call(v, 'data')) {
@@ -2,14 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createStripe = void 0;
4
4
  const _Error = require("./Error.js");
5
- const apiVersion_js_1 = require("./apiVersion.js");
6
- const resources = require("./resources.js");
7
- const HttpClient_js_1 = require("./net/HttpClient.js");
8
- const utils_js_1 = require("./utils.js");
9
- const CryptoProvider_js_1 = require("./crypto/CryptoProvider.js");
10
5
  const RequestSender_js_1 = require("./RequestSender.js");
11
6
  const StripeResource_js_1 = require("./StripeResource.js");
12
7
  const Webhooks_js_1 = require("./Webhooks.js");
8
+ const apiVersion_js_1 = require("./apiVersion.js");
9
+ const CryptoProvider_js_1 = require("./crypto/CryptoProvider.js");
10
+ const HttpClient_js_1 = require("./net/HttpClient.js");
11
+ const resources = require("./resources.js");
12
+ const utils_js_1 = require("./utils.js");
13
13
  const DEFAULT_HOST = 'api.stripe.com';
14
14
  const DEFAULT_PORT = '443';
15
15
  const DEFAULT_BASE_PATH = '/v1/';
@@ -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 = '16.3.0-beta.1';
37
+ Stripe.PACKAGE_VERSION = '16.4.0-beta.1';
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;
@@ -277,6 +277,9 @@ function createStripe(platformFunctions, requestSender = defaultRequestSenderFac
277
277
  var _a;
278
278
  const userAgent = {};
279
279
  for (const field in seed) {
280
+ if (!Object.prototype.hasOwnProperty.call(seed, field)) {
281
+ continue;
282
+ }
280
283
  userAgent[field] = encodeURIComponent((_a = seed[field]) !== null && _a !== void 0 ? _a : 'null');
281
284
  }
282
285
  // URI-encode in case there are unusual characters in the system's uname.
@@ -320,6 +323,9 @@ function createStripe(platformFunctions, requestSender = defaultRequestSenderFac
320
323
  */
321
324
  _prepResources() {
322
325
  for (const name in resources) {
326
+ if (!Object.prototype.hasOwnProperty.call(resources, name)) {
327
+ continue;
328
+ }
323
329
  // @ts-ignore
324
330
  this[(0, utils_js_1.pascalToCamelCase)(name)] = new resources[name](this);
325
331
  }
@@ -2,6 +2,9 @@
2
2
  // It also works recursively, so you could do i.e. `stripe.billing.invoicing.pay`.
3
3
  function ResourceNamespace(stripe, resources) {
4
4
  for (const name in resources) {
5
+ if (!Object.prototype.hasOwnProperty.call(resources, name)) {
6
+ continue;
7
+ }
5
8
  const camelCaseName = name[0].toLowerCase() + name.substring(1);
6
9
  const resource = new resources[name](stripe);
7
10
  this[camelCaseName] = resource;
package/esm/Webhooks.js CHANGED
@@ -40,23 +40,16 @@ export function createWebhooks(platformFunctions) {
40
40
  * @property {CryptoProvider} cryptoProvider - Crypto provider to use for computing the signature if none was provided. Defaults to NodeCryptoProvider.
41
41
  */
42
42
  generateTestHeaderString: function (opts) {
43
- if (!opts) {
44
- throw new StripeError({
45
- message: 'Options are required',
46
- });
47
- }
48
- opts.timestamp =
49
- Math.floor(opts.timestamp) || Math.floor(Date.now() / 1000);
50
- opts.scheme = opts.scheme || signature.EXPECTED_SCHEME;
51
- opts.cryptoProvider = opts.cryptoProvider || getCryptoProvider();
52
- opts.signature =
53
- opts.signature ||
54
- opts.cryptoProvider.computeHMACSignature(opts.timestamp + '.' + opts.payload, opts.secret);
55
- const generatedHeader = [
56
- 't=' + opts.timestamp,
57
- opts.scheme + '=' + opts.signature,
58
- ].join(',');
59
- return generatedHeader;
43
+ const preparedOpts = prepareOptions(opts);
44
+ const signature = preparedOpts.signature ||
45
+ preparedOpts.cryptoProvider.computeHMACSignature(preparedOpts.payloadString, preparedOpts.secret);
46
+ return preparedOpts.generateHeaderString(signature);
47
+ },
48
+ generateTestHeaderStringAsync: async function (opts) {
49
+ const preparedOpts = prepareOptions(opts);
50
+ const signature = preparedOpts.signature ||
51
+ (await preparedOpts.cryptoProvider.computeHMACSignatureAsync(preparedOpts.payloadString, preparedOpts.secret));
52
+ return preparedOpts.generateHeaderString(signature);
60
53
  },
61
54
  };
62
55
  const signature = {
@@ -191,6 +184,25 @@ export function createWebhooks(platformFunctions) {
191
184
  }
192
185
  return webhooksCryptoProviderInstance;
193
186
  }
187
+ function prepareOptions(opts) {
188
+ if (!opts) {
189
+ throw new StripeError({
190
+ message: 'Options are required',
191
+ });
192
+ }
193
+ const timestamp = Math.floor(opts.timestamp) || Math.floor(Date.now() / 1000);
194
+ const scheme = opts.scheme || signature.EXPECTED_SCHEME;
195
+ const cryptoProvider = opts.cryptoProvider || getCryptoProvider();
196
+ const payloadString = `${timestamp}.${opts.payload}`;
197
+ const generateHeaderString = (signature) => {
198
+ return `t=${timestamp},${scheme}=${signature}`;
199
+ };
200
+ return Object.assign(Object.assign({}, opts), { timestamp,
201
+ scheme,
202
+ cryptoProvider,
203
+ payloadString,
204
+ generateHeaderString });
205
+ }
194
206
  Webhook.signature = signature;
195
207
  return Webhook;
196
208
  }
package/esm/multipart.js CHANGED
@@ -21,6 +21,9 @@ const multipartDataGenerator = (method, data, headers) => {
21
21
  }
22
22
  const flattenedData = flattenAndStringify(data);
23
23
  for (const k in flattenedData) {
24
+ if (!Object.prototype.hasOwnProperty.call(flattenedData, k)) {
25
+ continue;
26
+ }
24
27
  const v = flattenedData[k];
25
28
  push(`--${segno}`);
26
29
  if (Object.prototype.hasOwnProperty.call(v, 'data')) {
@@ -1,12 +1,12 @@
1
1
  import * as _Error from './Error.js';
2
- import { ApiVersion } from './apiVersion.js';
3
- import * as resources from './resources.js';
4
- import { HttpClient, HttpClientResponse } from './net/HttpClient.js';
5
- import { determineProcessUserAgentProperties, pascalToCamelCase, validateInteger, } from './utils.js';
6
- import { CryptoProvider } from './crypto/CryptoProvider.js';
7
2
  import { RequestSender } from './RequestSender.js';
8
3
  import { StripeResource } from './StripeResource.js';
9
4
  import { createWebhooks } from './Webhooks.js';
5
+ import { ApiVersion } from './apiVersion.js';
6
+ import { CryptoProvider } from './crypto/CryptoProvider.js';
7
+ import { HttpClient, HttpClientResponse } from './net/HttpClient.js';
8
+ import * as resources from './resources.js';
9
+ import { determineProcessUserAgentProperties, pascalToCamelCase, validateInteger, } from './utils.js';
10
10
  const DEFAULT_HOST = 'api.stripe.com';
11
11
  const DEFAULT_PORT = '443';
12
12
  const DEFAULT_BASE_PATH = '/v1/';
@@ -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 = '16.3.0-beta.1';
34
+ Stripe.PACKAGE_VERSION = '16.4.0-beta.1';
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;
@@ -274,6 +274,9 @@ export function createStripe(platformFunctions, requestSender = defaultRequestSe
274
274
  var _a;
275
275
  const userAgent = {};
276
276
  for (const field in seed) {
277
+ if (!Object.prototype.hasOwnProperty.call(seed, field)) {
278
+ continue;
279
+ }
277
280
  userAgent[field] = encodeURIComponent((_a = seed[field]) !== null && _a !== void 0 ? _a : 'null');
278
281
  }
279
282
  // URI-encode in case there are unusual characters in the system's uname.
@@ -317,6 +320,9 @@ export function createStripe(platformFunctions, requestSender = defaultRequestSe
317
320
  */
318
321
  _prepResources() {
319
322
  for (const name in resources) {
323
+ if (!Object.prototype.hasOwnProperty.call(resources, name)) {
324
+ continue;
325
+ }
320
326
  // @ts-ignore
321
327
  this[pascalToCamelCase(name)] = new resources[name](this);
322
328
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stripe",
3
- "version": "16.3.0-beta.1",
3
+ "version": "16.4.0-beta.1",
4
4
  "description": "Stripe API wrapper",
5
5
  "keywords": [
6
6
  "stripe",
@@ -17,7 +17,7 @@ declare module 'stripe' {
17
17
  * Create sessions on-demand when customers intend to manage their subscriptions
18
18
  * and billing details.
19
19
  *
20
- * Learn more in the [integration guide](https://stripe.com/docs/billing/subscriptions/integrating-customer-portal).
20
+ * Related guide: [Customer management](https://stripe.com/customer-management)
21
21
  */
22
22
  interface Session {
23
23
  /**
@@ -82,7 +82,7 @@ declare module 'stripe' {
82
82
  namespace Details {
83
83
  interface CurrentRepaymentInterval {
84
84
  /**
85
- * The time at which the minimum payment amount will be due. If not met through withholding, the Connected account's linked bank account will be debited.
85
+ * The time at which the minimum payment amount will be due. If not met through withholding, the Connected account's linked bank account or account balance will be debited.
86
86
  * Given in seconds since unix epoch.
87
87
  */
88
88
  due_at: number;
@@ -50,7 +50,7 @@ declare module 'stripe' {
50
50
  /**
51
51
  * Payment-method-specific configuration for this ConfirmationToken.
52
52
  */
53
- payment_method_options?: ConfirmationToken.PaymentMethodOptions | null;
53
+ payment_method_options: ConfirmationToken.PaymentMethodOptions | null;
54
54
 
55
55
  /**
56
56
  * Payment details collected by the Payment Element, used to create a PaymentMethod when a PaymentIntent or SetupIntent is confirmed with this ConfirmationToken.
@@ -55,7 +55,7 @@ declare module 'stripe' {
55
55
  /**
56
56
  * This hash contains whether the Payment Element is enabled and the features it supports.
57
57
  */
58
- payment_element?: Components.PaymentElement;
58
+ payment_element: Components.PaymentElement;
59
59
 
60
60
  /**
61
61
  * This hash contains whether the pricing table is enabled.
@@ -406,6 +406,7 @@ declare module 'stripe' {
406
406
 
407
407
  type Status =
408
408
  | 'accepted'
409
+ | 'not_qualified'
409
410
  | 'partner_rejected'
410
411
  | 'qualified'
411
412
  | 'requires_action'
@@ -4,7 +4,7 @@ declare module 'stripe' {
4
4
  namespace Stripe {
5
5
  namespace FinancialConnections {
6
6
  /**
7
- * An institution represents a banking institution which may be available for an end user to select in the Financial Connections authentication flow.
7
+ * An institution represents a financial institution to which an end user can connect using the Financial Connections authentication flow.
8
8
  */
9
9
  interface Institution {
10
10
  /**
@@ -30,7 +30,7 @@ declare module 'stripe' {
30
30
  name: string;
31
31
 
32
32
  /**
33
- * A list of routing numbers which are known to correspond to this institution.
33
+ * A list of routing numbers which are known to correspond to this institution. Due to the many to many relationship between institutions and routing numbers, this list may not be comprehensive and routing numbers may also be shared between institutions.
34
34
  */
35
35
  routing_numbers: Array<string>;
36
36
 
@@ -40,7 +40,7 @@ declare module 'stripe' {
40
40
  status: Institution.Status;
41
41
 
42
42
  /**
43
- * The URL for this institution's website.
43
+ * A URL corresponding to this institution. This URL is also displayed in the authentication flow to help end users confirm that they are authenticating with the right institution.
44
44
  */
45
45
  url: string | null;
46
46
  }
@@ -868,10 +868,6 @@ declare module 'stripe' {
868
868
  | 'bank_account_unverified'
869
869
  | 'bank_account_verification_failed'
870
870
  | 'billing_invalid_mandate'
871
- | 'billing_policy_remote_function_response_invalid'
872
- | 'billing_policy_remote_function_timeout'
873
- | 'billing_policy_remote_function_unexpected_status_code'
874
- | 'billing_policy_remote_function_unreachable'
875
871
  | 'bitcoin_upgrade_required'
876
872
  | 'capture_charge_authorization_expired'
877
873
  | 'capture_unauthorized_payment'
@@ -949,7 +945,6 @@ declare module 'stripe' {
949
945
  | 'parameters_exclusive'
950
946
  | 'payment_intent_action_required'
951
947
  | 'payment_intent_authentication_failure'
952
- | 'payment_intent_fx_quote_invalid'
953
948
  | 'payment_intent_incompatible_payment_method'
954
949
  | 'payment_intent_invalid_parameter'
955
950
  | 'payment_intent_konbini_rejected_confirmation_number'
@@ -405,10 +405,6 @@ declare module 'stripe' {
405
405
  | 'bank_account_unverified'
406
406
  | 'bank_account_verification_failed'
407
407
  | 'billing_invalid_mandate'
408
- | 'billing_policy_remote_function_response_invalid'
409
- | 'billing_policy_remote_function_timeout'
410
- | 'billing_policy_remote_function_unexpected_status_code'
411
- | 'billing_policy_remote_function_unreachable'
412
408
  | 'bitcoin_upgrade_required'
413
409
  | 'capture_charge_authorization_expired'
414
410
  | 'capture_unauthorized_payment'
@@ -486,7 +482,6 @@ declare module 'stripe' {
486
482
  | 'parameters_exclusive'
487
483
  | 'payment_intent_action_required'
488
484
  | 'payment_intent_authentication_failure'
489
- | 'payment_intent_fx_quote_invalid'
490
485
  | 'payment_intent_incompatible_payment_method'
491
486
  | 'payment_intent_invalid_parameter'
492
487
  | 'payment_intent_konbini_rejected_confirmation_number'
package/types/Plans.d.ts CHANGED
@@ -106,7 +106,7 @@ declare module 'stripe' {
106
106
  /**
107
107
  * The meter tracking the usage of a metered price
108
108
  */
109
- meter?: string | null;
109
+ meter: string | null;
110
110
 
111
111
  /**
112
112
  * A brief description of the plan, hidden from customers.
package/types/Prices.d.ts CHANGED
@@ -280,7 +280,7 @@ declare module 'stripe' {
280
280
  /**
281
281
  * The meter tracking the usage of a metered price
282
282
  */
283
- meter?: string | null;
283
+ meter: string | null;
284
284
 
285
285
  /**
286
286
  * Default number of trial days when subscribing a customer to this price using [`trial_from_plan=true`](https://stripe.com/docs/api#create_subscription-trial_from_plan).
@@ -845,10 +845,6 @@ declare module 'stripe' {
845
845
  | 'bank_account_unverified'
846
846
  | 'bank_account_verification_failed'
847
847
  | 'billing_invalid_mandate'
848
- | 'billing_policy_remote_function_response_invalid'
849
- | 'billing_policy_remote_function_timeout'
850
- | 'billing_policy_remote_function_unexpected_status_code'
851
- | 'billing_policy_remote_function_unreachable'
852
848
  | 'bitcoin_upgrade_required'
853
849
  | 'capture_charge_authorization_expired'
854
850
  | 'capture_unauthorized_payment'
@@ -926,7 +922,6 @@ declare module 'stripe' {
926
922
  | 'parameters_exclusive'
927
923
  | 'payment_intent_action_required'
928
924
  | 'payment_intent_authentication_failure'
929
- | 'payment_intent_fx_quote_invalid'
930
925
  | 'payment_intent_incompatible_payment_method'
931
926
  | 'payment_intent_invalid_parameter'
932
927
  | 'payment_intent_konbini_rejected_confirmation_number'
@@ -645,10 +645,6 @@ declare module 'stripe' {
645
645
  | 'bank_account_unverified'
646
646
  | 'bank_account_verification_failed'
647
647
  | 'billing_invalid_mandate'
648
- | 'billing_policy_remote_function_response_invalid'
649
- | 'billing_policy_remote_function_timeout'
650
- | 'billing_policy_remote_function_unexpected_status_code'
651
- | 'billing_policy_remote_function_unreachable'
652
648
  | 'bitcoin_upgrade_required'
653
649
  | 'capture_charge_authorization_expired'
654
650
  | 'capture_unauthorized_payment'
@@ -726,7 +722,6 @@ declare module 'stripe' {
726
722
  | 'parameters_exclusive'
727
723
  | 'payment_intent_action_required'
728
724
  | 'payment_intent_authentication_failure'
729
- | 'payment_intent_fx_quote_invalid'
730
725
  | 'payment_intent_incompatible_payment_method'
731
726
  | 'payment_intent_invalid_parameter'
732
727
  | 'payment_intent_konbini_rejected_confirmation_number'
@@ -311,10 +311,6 @@ declare module 'stripe' {
311
311
  | 'bank_account_unverified'
312
312
  | 'bank_account_verification_failed'
313
313
  | 'billing_invalid_mandate'
314
- | 'billing_policy_remote_function_response_invalid'
315
- | 'billing_policy_remote_function_timeout'
316
- | 'billing_policy_remote_function_unexpected_status_code'
317
- | 'billing_policy_remote_function_unreachable'
318
314
  | 'bitcoin_upgrade_required'
319
315
  | 'capture_charge_authorization_expired'
320
316
  | 'capture_unauthorized_payment'
@@ -392,7 +388,6 @@ declare module 'stripe' {
392
388
  | 'parameters_exclusive'
393
389
  | 'payment_intent_action_required'
394
390
  | 'payment_intent_authentication_failure'
395
- | 'payment_intent_fx_quote_invalid'
396
391
  | 'payment_intent_incompatible_payment_method'
397
392
  | 'payment_intent_invalid_parameter'
398
393
  | 'payment_intent_konbini_rejected_confirmation_number'
@@ -2271,7 +2271,7 @@ declare module 'stripe' {
2271
2271
  /**
2272
2272
  * Updates an existing subscription to match the specified parameters.
2273
2273
  * When changing prices or quantities, we optionally prorate the price we charge next month to make up for any price changes.
2274
- * To preview how the proration is calculated, use the [upcoming invoice](https://stripe.com/docs/api/invoices/upcoming) endpoint.
2274
+ * To preview how the proration is calculated, use the [create preview](https://stripe.com/docs/api/invoices/create_preview) endpoint.
2275
2275
  *
2276
2276
  * By default, we prorate subscription changes. For example, if a customer signs up on May 1 for a 100 price, they'll be billed 100 immediately. If on May 15 they switch to a 200 price, then on June 1 they'll be billed 250 (200 for a renewal of her subscription, plus a 50 prorating adjustment for half of the previous month's 100 difference). Similarly, a downgrade generates a credit that is applied to the next invoice. We also prorate when you make quantity changes.
2277
2277
  *
@@ -2279,11 +2279,11 @@ declare module 'stripe' {
2279
2279
  *
2280
2280
  *
2281
2281
  * The billing interval is changed (for example, from monthly to yearly).
2282
- * The subscription moves from free to paid, or paid to free.
2282
+ * The subscription moves from free to paid.
2283
2283
  * A trial starts or ends.
2284
2284
  *
2285
2285
  *
2286
- * In these cases, we apply a credit for the unused time on the previous price, immediately charge the customer using the new price, and reset the billing date.
2286
+ * In these cases, we apply a credit for the unused time on the previous price, immediately charge the customer using the new price, and reset the billing date. Learn about how [Stripe immediately attempts payment for subscription changes](https://stripe.com/billing/subscriptions/upgrade-downgrade#immediate-payment).
2287
2287
  *
2288
2288
  * If you want to charge for an upgrade immediately, pass proration_behavior as always_invoice to create prorations, automatically invoice the customer for those proration adjustments, and attempt to collect payment. If you pass create_prorations, the prorations are created but not automatically invoiced. If you want to bill the customer for the prorations before the subscription's renewal date, you need to manually [invoice the customer](https://stripe.com/docs/api/invoices/create).
2289
2289
  *