Skip to content

Commit 169f809

Browse files
Merge pull request #2552 from stripe/latest-codegen-beta
Update generated code for beta
2 parents 5474772 + 428e872 commit 169f809

File tree

88 files changed

+3613
-682
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+3613
-682
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
# Changelog
22

3+
## 20.2.0 - 2026-01-16
4+
* [#2551](https://github.com/stripe/stripe-node/pull/2551) Update generated code
5+
* Add support for event notifications `V2CoreAccountClosedEvent`, `V2CoreAccountCreatedEvent`, `V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEvent`, `V2CoreAccountIncludingConfigurationCustomerUpdatedEvent`, `V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEvent`, `V2CoreAccountIncludingConfigurationMerchantUpdatedEvent`, `V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEvent`, `V2CoreAccountIncludingConfigurationRecipientUpdatedEvent`, `V2CoreAccountIncludingDefaultsUpdatedEvent`, `V2CoreAccountIncludingFutureRequirementsUpdatedEvent`, `V2CoreAccountIncludingIdentityUpdatedEvent`, `V2CoreAccountIncludingRequirementsUpdatedEvent`, and `V2CoreAccountUpdatedEvent` with related object `V2.Core.Account`
6+
* Add support for event notification `V2CoreAccountLinkReturnedEvent`
7+
* Add support for event notifications `V2CoreAccountPersonCreatedEvent`, `V2CoreAccountPersonDeletedEvent`, and `V2CoreAccountPersonUpdatedEvent` with related object `V2.Core.AccountPerson`
8+
39
## 20.2.0-beta.2 - 2026-01-08
410

5-
This release is purely for pulling in fixes from the releases 20.1.1 and 20.1.2 into the public preview release.
11+
This release is purely for pulling in fixes from the releases 20.1.1 and 20.1.2 into the public preview release.
612

713
## 20.2.0-beta.1 - 2025-12-16
814
This release changes the pinned API version to `2025-12-15.preview`.

CODEGEN_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
32e3565a276ee2b159a3bb1eb3ea0a7e4fdc4977
1+
529796460735eb8ef64a29787291f1b4d4b29f1c

OPENAPI_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v2150
1+
v2160

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,11 @@ const event = stripe.webhooks.constructEvent(payloadString, header, secret);
414414
// Do something with mocked signed event
415415
expect(event.id).to.equal(payload.id);
416416
```
417+
### How to use undocumented parameters and properties
418+
419+
In some cases, you might encounter parameters on an API request or fields on an API response that aren’t available in the SDKs.
420+
This might happen when they’re undocumented or when they’re in preview and you aren’t using a preview SDK.
421+
See [undocumented params and properties](https://docs.stripe.com/sdks/server-side?lang=node#undocumented-params-and-fields) to send those parameters or access those fields.
417422

418423
### Writing a Plugin
419424

@@ -533,7 +538,7 @@ We would love for you to try these as we incrementally release new features and
533538
The easiest way to install a public-preview release is to use the dedicated npm tag:
534539

535540
```
536-
npm install stripe@public-preview --save
541+
npm install stripe@public-preview --save-exact
537542
```
538543

539544
Or, to install a specific version from the [releases page](https://github.com/stripe/stripe-node/releases/), you can specify that version explicitly:
@@ -545,7 +550,7 @@ npm install stripe@<some-version>
545550
```
546551

547552
> **Note**
548-
> There can be breaking changes between two versions of the public preview SDKs without a bump in the major version. Therefore we recommend pinning the package version to a specific version in your package.json file. This way you can install the same version each time without breaking changes unless you are intentionally looking for the latest public preview SDK.
553+
> There can be breaking changes between two versions of the public preview SDKs without a bump in the major version. Therefore we recommend pinning the package version to a specific version (i.e. using --save-exact) in your package.json file. This way you can install the same version each time without breaking changes unless you are intentionally looking for the latest public preview SDK.
549554
550555
Some preview features require a name and version to be set in the `Stripe-Version` header like `feature_beta=v3`. If your preview feature has this requirement, use the `apiVersion` property of `config` object to set it:
551556

@@ -560,7 +565,7 @@ const stripe = new Stripe('sk_test_...', {
560565
Stripe has features in the [private preview phase](https://docs.stripe.com/release-phases) that can be accessed via versions of this package that have the `-alpha.X` suffix like `18.6.0-alpha.1`. These are invite-only features. Once invited, you can install the private preview SDKs by following the same instructions as for the [public preview SDKs](https://github.com/stripe/stripe-node?tab=readme-ov-file#public-preview-sdks) above and replacing the term `public-preview` with `private-preview`:
561566

562567
```
563-
npm install stripe@private-preview --save
568+
npm install stripe@private-preview --save-exact
564569
```
565570

566571
### Custom requests

package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
"@types/chai": "^4.3.4",
3131
"@types/chai-as-promised": "^7.1.5",
3232
"@types/mocha": "^10.0.1",
33-
"@types/qs": "^6.9.7",
3433
"@types/node": "~22",
3534
"@typescript-eslint/eslint-plugin": "^4.33.0",
3635
"@typescript-eslint/parser": "^4.33.0",
@@ -55,9 +54,7 @@
5554
"minimist": "1.2.6",
5655
"nanoid": "^3.2.0"
5756
},
58-
"dependencies": {
59-
"qs": "^6.14.1"
60-
},
57+
"dependencies": {},
6158
"peerDependencies": {
6259
"@types/node": ">=16"
6360
},

src/Error.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ export const generateV2Error = (
5959
return new NotCancelableError(rawStripeError);
6060
case 'quota_exceeded':
6161
return new QuotaExceededError(rawStripeError);
62+
case 'rate_limit':
63+
return new RateLimitError(rawStripeError);
6264
case 'recipient_not_notifiable':
6365
return new RecipientNotNotifiableError(rawStripeError);
6466
case 'temporary_session_expired':
@@ -328,6 +330,11 @@ export class QuotaExceededError extends StripeError {
328330
super(rawStripeError, 'QuotaExceededError');
329331
}
330332
}
333+
export class RateLimitError extends StripeError {
334+
constructor(rawStripeError: StripeRawError = {}) {
335+
super(rawStripeError, 'RateLimitError');
336+
}
337+
}
331338
export class RecipientNotNotifiableError extends StripeError {
332339
constructor(rawStripeError: StripeRawError = {}) {
333340
super(rawStripeError, 'RecipientNotNotifiableError');

src/RequestSender.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,7 @@ export class RequestSender {
767767
if (apiMode == 'v2') {
768768
stringifiedData = data ? jsonStringifyRequestData(data) : '';
769769
} else {
770-
stringifiedData = queryStringifyRequestData(data || {}, apiMode);
770+
stringifiedData = queryStringifyRequestData(data || {});
771771
}
772772

773773
prepareAndMakeRequest(null, stringifiedData);

src/StripeEventNotificationHandler.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const KNOWN_EVENT_TYPES = new Set([
2121
'v2.core.account[configuration.storer].capability_status_updated',
2222
'v2.core.account[configuration.storer].updated',
2323
'v2.core.account[defaults].updated',
24+
'v2.core.account[future_requirements].updated',
2425
'v2.core.account[identity].updated',
2526
'v2.core.account[requirements].updated',
2627
'v2.core.account_link.returned',

src/StripeResource.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import {
44
makeURLInterpolator,
55
protoExtend,
66
queryStringifyRequestData,
7-
getAPIMode,
87
} from './utils.js';
98
import {stripeMethod} from './StripeMethod.js';
109
import {
@@ -229,7 +228,7 @@ StripeResource.prototype = {
229228
const path = [
230229
opts.requestPath,
231230
emptyQuery ? '' : '?',
232-
queryStringifyRequestData(opts.queryData, getAPIMode(opts.requestPath)),
231+
queryStringifyRequestData(opts.queryData),
233232
].join('');
234233

235234
const {headers, settings} = opts;

src/Types.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export type RawErrorType =
5353
| 'non_zero_balance'
5454
| 'not_cancelable'
5555
| 'quota_exceeded'
56+
| 'rate_limit'
5657
| 'recipient_not_notifiable'
5758
| 'temporary_session_expired';
5859
// rawErrorTypeEnum: The end of the section generated from our OpenAPI spec

0 commit comments

Comments
 (0)