Skip to content

Commit c64b4e2

Browse files
Merge pull request #2501 from stripe/latest-codegen-private-preview
Update generated code for private-preview
2 parents fca03e9 + b56e1b4 commit c64b4e2

20 files changed

Lines changed: 910 additions & 4 deletions

API_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
441c0fcde75bcbf836f1a1810d5b9cfe8e8a7da4
1+
f7784849b5189b7bdf4d850b41365cec53d174b2

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
* Add support for `allocated_funds` on `Charge`, `PaymentIntentConfirmParams`, `PaymentIntentCreateParams`, and `PaymentIntentUpdateParams`
1010
* Add support for thin events `V2ReportingReportRunCreatedEvent`, `V2ReportingReportRunFailedEvent`, `V2ReportingReportRunSucceededEvent`, and `V2ReportingReportRunUpdatedEvent` with related object `V2.Reporting.ReportRun`
1111

12+
## 19.3.1 - 2025-11-12
13+
* [#2500](https://github.com/stripe/stripe-node/pull/2500) Use `TextEncoder` instead of `Buffer` to ensure support in other JS environments
14+
* Fixes issues like [#2499](https://github.com/stripe/stripe-node/issues/2499) and [#2493](https://github.com/stripe/stripe-node/issues/2493) where use of `Buffer.byteLength` was causing errors in some runtime environments.
15+
1216
## 19.3.0 - 2025-11-05
1317
* [#2488](https://github.com/stripe/stripe-node/pull/2488) Update generated code
1418
* Add support for `capture_method` on `PaymentIntent.payment_method_options.card_present`, `PaymentIntentConfirmParams.payment_method_options.card_present`, `PaymentIntentCreateParams.payment_method_options.card_present`, and `PaymentIntentUpdateParams.payment_method_options.card_present`

OPENAPI_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v2116
1+
v2120

src/RequestSender.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@ export class RequestSender {
722722
apiMode == 'v2'
723723
? 'application/json'
724724
: 'application/x-www-form-urlencoded',
725-
contentLength: Buffer.byteLength(requestData, 'utf8'), // if we calculate this wrong, the server treats it as invalid json
725+
contentLength: new TextEncoder().encode(requestData).length, // if we calculate this wrong, the server treats it as invalid json
726726
apiVersion: apiVersion,
727727
clientUserAgent,
728728
method,

src/resources.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ import {PricingPlanSubscriptions as V2BillingPricingPlanSubscriptions} from './r
8787
import {PricingPlans as V2BillingPricingPlans} from './resources/V2/Billing/PricingPlans.js';
8888
import {Products as ClimateProducts} from './resources/Climate/Products.js';
8989
import {Profiles as V2BillingProfiles} from './resources/V2/Billing/Profiles.js';
90+
import {Programs as IssuingPrograms} from './resources/Issuing/Programs.js';
9091
import {RateCardSubscriptions as V2BillingRateCardSubscriptions} from './resources/V2/Billing/RateCardSubscriptions.js';
9192
import {RateCards as V2BillingRateCards} from './resources/V2/Billing/RateCards.js';
9293
import {ReaderCollectedData as TerminalReaderCollectedData} from './resources/Terminal/ReaderCollectedData.js';
@@ -254,6 +255,7 @@ export const Issuing = resourceNamespace('issuing', {
254255
FraudLiabilityDebits: IssuingFraudLiabilityDebits,
255256
PersonalizationDesigns: IssuingPersonalizationDesigns,
256257
PhysicalBundles: IssuingPhysicalBundles,
258+
Programs: IssuingPrograms,
257259
Tokens: IssuingTokens,
258260
Transactions: IssuingTransactions,
259261
});

src/resources/Issuing/Programs.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// File generated from our OpenAPI spec
2+
3+
import {StripeResource} from '../../StripeResource.js';
4+
const stripeMethod = StripeResource.method;
5+
export const Programs = StripeResource.extend({
6+
create: stripeMethod({method: 'POST', fullPath: '/v1/issuing/programs'}),
7+
retrieve: stripeMethod({
8+
method: 'GET',
9+
fullPath: '/v1/issuing/programs/{program}',
10+
}),
11+
update: stripeMethod({
12+
method: 'POST',
13+
fullPath: '/v1/issuing/programs/{program}',
14+
}),
15+
list: stripeMethod({
16+
method: 'GET',
17+
fullPath: '/v1/issuing/programs',
18+
methodType: 'list',
19+
}),
20+
});

test/resources/generated_examples_test.spec.js

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

types/DelegatedCheckout/RequestedSessions.d.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,30 @@ declare module 'stripe' {
353353
* The amount tax of the total details.
354354
*/
355355
amount_tax: number | null;
356+
357+
/**
358+
* The applicable fees of the total details.
359+
*/
360+
applicable_fees: Array<TotalDetails.ApplicableFee> | null;
361+
}
362+
363+
namespace TotalDetails {
364+
interface ApplicableFee {
365+
/**
366+
* The amount of the applicable fee.
367+
*/
368+
amount: number;
369+
370+
/**
371+
* The description of the applicable fee.
372+
*/
373+
description: string | null;
374+
375+
/**
376+
* The display name of the applicable fee.
377+
*/
378+
display_name: string;
379+
}
356380
}
357381
}
358382
}

types/Discounts.d.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ declare module 'stripe' {
5151
*/
5252
promotion_code: string | Stripe.PromotionCode | null;
5353

54+
/**
55+
* The subscription schedule that this coupon is applied to, if it is applied to a particular subscription schedule.
56+
*/
57+
schedule?: string | null;
58+
5459
source: DeletedDiscount.Source;
5560

5661
/**
@@ -140,6 +145,11 @@ declare module 'stripe' {
140145
*/
141146
promotion_code: string | Stripe.PromotionCode | null;
142147

148+
/**
149+
* The subscription schedule that this coupon is applied to, if it is applied to a particular subscription schedule.
150+
*/
151+
schedule?: string | null;
152+
143153
source: Discount.Source;
144154

145155
/**

types/InvoiceItems.d.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,11 @@ declare module 'stripe' {
169169
* The type of parent that generated this invoice item
170170
*/
171171
type: Parent.Type;
172+
173+
/**
174+
* Details about the subscription schedule that generated this invoice item
175+
*/
176+
schedule_details?: Parent.ScheduleDetails | null;
172177
}
173178

174179
namespace Parent {
@@ -216,6 +221,13 @@ declare module 'stripe' {
216221
rate_card_version: string;
217222
}
218223

224+
interface ScheduleDetails {
225+
/**
226+
* The subscription schedule that generated this invoice item
227+
*/
228+
schedule: string;
229+
}
230+
219231
interface SubscriptionDetails {
220232
/**
221233
* The subscription that generated this invoice item
@@ -231,6 +243,7 @@ declare module 'stripe' {
231243
type Type =
232244
| 'license_fee_subscription_details'
233245
| 'rate_card_subscription_details'
246+
| 'schedule_details'
234247
| 'subscription_details';
235248
}
236249

0 commit comments

Comments
 (0)