Skip to content

Commit

Permalink
Merge branch 'master' into anniel-error-types-minified
Browse files Browse the repository at this point in the history
  • Loading branch information
anniel-stripe authored Mar 21, 2024
2 parents 96b2a5e + 800e45e commit 052871e
Show file tree
Hide file tree
Showing 36 changed files with 967 additions and 15 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Changelog

## 14.21.0 - 2024-03-14
* [#2035](https://github.com/stripe/stripe-node/pull/2035) Update generated code
* Add support for new resources `Issuing.PersonalizationDesign` and `Issuing.PhysicalBundle`
* Add support for `create`, `list`, `retrieve`, and `update` methods on resource `PersonalizationDesign`
* Add support for `list` and `retrieve` methods on resource `PhysicalBundle`
* Add support for `personalization_design` on `Issuing.CardCreateParams`, `Issuing.CardListParams`, `Issuing.CardUpdateParams`, and `Issuing.Card`
* Change type of `SubscriptionCreateParams.application_fee_percent` and `SubscriptionUpdateParams.application_fee_percent` from `number` to `emptyStringable(number)`
* Add support for `sepa_debit` on `Subscription.payment_settings.payment_method_options`, `SubscriptionCreateParams.payment_settings.payment_method_options`, and `SubscriptionUpdateParams.payment_settings.payment_method_options`

## 14.20.0 - 2024-03-07
* [#2033](https://github.com/stripe/stripe-node/pull/2033) Update generated code
* Add support for `documents` on `AccountSession.components` and `AccountSessionCreateParams.components`
* Add support for `request_three_d_secure` on `Checkout.Session.payment_method_options.card` and `Checkout.SessionCreateParams.payment_method_options.card`
* Add support for `created` on `CreditNoteListParams`
* Add support for `sepa_debit` on `Invoice.payment_settings.payment_method_options`, `InvoiceCreateParams.payment_settings.payment_method_options`, and `InvoiceUpdateParams.payment_settings.payment_method_options`

## 14.19.0 - 2024-02-29
* [#2029](https://github.com/stripe/stripe-node/pull/2029) Update generated code
* Change `Identity.VerificationReport.type`, `SubscriptionSchedule.default_settings.invoice_settings.account_tax_ids`, `SubscriptionSchedule.phases[].invoice_settings.account_tax_ids`, and `TaxId.owner` to be required
Expand Down
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v857
v878
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14.19.0
14.21.0
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "stripe",
"version": "14.19.0",
"version": "14.21.0",
"description": "Stripe API wrapper",
"keywords": [
"stripe",
Expand Down
6 changes: 6 additions & 0 deletions src/resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ import {OutboundPayments as TestHelpersTreasuryOutboundPayments} from './resourc
import {OutboundPayments as TreasuryOutboundPayments} from './resources/Treasury/OutboundPayments.js';
import {OutboundTransfers as TestHelpersTreasuryOutboundTransfers} from './resources/TestHelpers/Treasury/OutboundTransfers.js';
import {OutboundTransfers as TreasuryOutboundTransfers} from './resources/Treasury/OutboundTransfers.js';
import {PersonalizationDesigns as TestHelpersIssuingPersonalizationDesigns} from './resources/TestHelpers/Issuing/PersonalizationDesigns.js';
import {PersonalizationDesigns as IssuingPersonalizationDesigns} from './resources/Issuing/PersonalizationDesigns.js';
import {PhysicalBundles as IssuingPhysicalBundles} from './resources/Issuing/PhysicalBundles.js';
import {Products as ClimateProducts} from './resources/Climate/Products.js';
import {Readers as TestHelpersTerminalReaders} from './resources/TestHelpers/Terminal/Readers.js';
import {Readers as TerminalReaders} from './resources/Terminal/Readers.js';
Expand Down Expand Up @@ -133,6 +136,8 @@ export const Issuing = resourceNamespace('issuing', {
Cardholders: IssuingCardholders,
Cards: IssuingCards,
Disputes: IssuingDisputes,
PersonalizationDesigns: IssuingPersonalizationDesigns,
PhysicalBundles: IssuingPhysicalBundles,
Tokens: IssuingTokens,
Transactions: IssuingTransactions,
});
Expand Down Expand Up @@ -167,6 +172,7 @@ export const TestHelpers = resourceNamespace('testHelpers', {
Issuing: resourceNamespace('issuing', {
Authorizations: TestHelpersIssuingAuthorizations,
Cards: TestHelpersIssuingCards,
PersonalizationDesigns: TestHelpersIssuingPersonalizationDesigns,
Transactions: TestHelpersIssuingTransactions,
}),
Terminal: resourceNamespace('terminal', {
Expand Down
23 changes: 23 additions & 0 deletions src/resources/Issuing/PersonalizationDesigns.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// File generated from our OpenAPI spec

import {StripeResource} from '../../StripeResource.js';
const stripeMethod = StripeResource.method;
export const PersonalizationDesigns = StripeResource.extend({
create: stripeMethod({
method: 'POST',
fullPath: '/v1/issuing/personalization_designs',
}),
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/issuing/personalization_designs/{personalization_design}',
}),
update: stripeMethod({
method: 'POST',
fullPath: '/v1/issuing/personalization_designs/{personalization_design}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/issuing/personalization_designs',
methodType: 'list',
}),
});
15 changes: 15 additions & 0 deletions src/resources/Issuing/PhysicalBundles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// File generated from our OpenAPI spec

import {StripeResource} from '../../StripeResource.js';
const stripeMethod = StripeResource.method;
export const PhysicalBundles = StripeResource.extend({
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/issuing/physical_bundles/{physical_bundle}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/issuing/physical_bundles',
methodType: 'list',
}),
});
21 changes: 21 additions & 0 deletions src/resources/TestHelpers/Issuing/PersonalizationDesigns.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// File generated from our OpenAPI spec

import {StripeResource} from '../../../StripeResource.js';
const stripeMethod = StripeResource.method;
export const PersonalizationDesigns = StripeResource.extend({
activate: stripeMethod({
method: 'POST',
fullPath:
'/v1/test_helpers/issuing/personalization_designs/{personalization_design}/activate',
}),
deactivate: stripeMethod({
method: 'POST',
fullPath:
'/v1/test_helpers/issuing/personalization_designs/{personalization_design}/deactivate',
}),
reject: stripeMethod({
method: 'POST',
fullPath:
'/v1/test_helpers/issuing/personalization_designs/{personalization_design}/reject',
}),
});
2 changes: 1 addition & 1 deletion src/stripe.core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export function createStripe(
platformFunctions: PlatformFunctions,
requestSender: RequestSenderFactory = defaultRequestSenderFactory
): typeof Stripe {
Stripe.PACKAGE_VERSION = '14.19.0';
Stripe.PACKAGE_VERSION = '14.21.0';
Stripe.USER_AGENT = {
bindings_version: Stripe.PACKAGE_VERSION,
lang: 'node',
Expand Down
99 changes: 99 additions & 0 deletions test/resources/generated_examples_test.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,16 @@ describe('Generated tests', function() {
expect(cashBalance).not.to.be.null;
});

it('test_customers_cash_balance_transactions_get', async function() {
const customerCashBalanceTransactions = await stripe.customers.listCashBalanceTransactions(
'cus_123',
{
limit: 3,
}
);
expect(customerCashBalanceTransactions).not.to.be.null;
});

it('test_customers_delete', async function() {
const deleted = await stripe.customers.del('cus_xxxxxxxxxxxxx');
expect(deleted).not.to.be.null;
Expand Down Expand Up @@ -1516,6 +1526,46 @@ describe('Generated tests', function() {
expect(dispute).not.to.be.null;
});

it('test_issuing_personalization_designs_get', async function() {
const personalizationDesigns = await stripe.issuing.personalizationDesigns.list();
expect(personalizationDesigns).not.to.be.null;
});

it('test_issuing_personalization_designs_get_2', async function() {
const personalizationDesign = await stripe.issuing.personalizationDesigns.retrieve(
'pd_xyz'
);
expect(personalizationDesign).not.to.be.null;
});

it('test_issuing_personalization_designs_post', async function() {
const personalizationDesign = await stripe.issuing.personalizationDesigns.create(
{
physical_bundle: 'pb_xyz',
}
);
expect(personalizationDesign).not.to.be.null;
});

it('test_issuing_personalization_designs_post_2', async function() {
const personalizationDesign = await stripe.issuing.personalizationDesigns.update(
'pd_xyz'
);
expect(personalizationDesign).not.to.be.null;
});

it('test_issuing_physical_bundles_get', async function() {
const physicalBundles = await stripe.issuing.physicalBundles.list();
expect(physicalBundles).not.to.be.null;
});

it('test_issuing_physical_bundles_get_2', async function() {
const physicalBundle = await stripe.issuing.physicalBundles.retrieve(
'pb_xyz'
);
expect(physicalBundle).not.to.be.null;
});

it('test_issuing_transactions_get', async function() {
const transactions = await stripe.issuing.transactions.list({
limit: 3,
Expand Down Expand Up @@ -2657,6 +2707,29 @@ describe('Generated tests', function() {
expect(taxCode).not.to.be.null;
});

it('test_tax_ids_delete', async function() {
const deleted = await stripe.taxIds.del('taxid_123');
expect(deleted).not.to.be.null;
});

it('test_tax_ids_get', async function() {
const taxIds = await stripe.taxIds.list();
expect(taxIds).not.to.be.null;
});

it('test_tax_ids_get_2', async function() {
const taxId = await stripe.taxIds.retrieve('taxid_123');
expect(taxId).not.to.be.null;
});

it('test_tax_ids_post', async function() {
const taxId = await stripe.taxIds.create({
type: 'eu_vat',
value: '123',
});
expect(taxId).not.to.be.null;
});

it('test_tax_rates_get', async function() {
const taxRates = await stripe.taxRates.list({
limit: 3,
Expand Down Expand Up @@ -3070,6 +3143,32 @@ describe('Generated tests', function() {
expect(card).not.to.be.null;
});

it('test_test_helpers_issuing_personalization_designs_activate_post', async function() {
const personalizationDesign = await stripe.testHelpers.issuing.personalizationDesigns.activate(
'pd_xyz'
);
expect(personalizationDesign).not.to.be.null;
});

it('test_test_helpers_issuing_personalization_designs_deactivate_post', async function() {
const personalizationDesign = await stripe.testHelpers.issuing.personalizationDesigns.deactivate(
'pd_xyz'
);
expect(personalizationDesign).not.to.be.null;
});

it('test_test_helpers_issuing_personalization_designs_reject_post', async function() {
const personalizationDesign = await stripe.testHelpers.issuing.personalizationDesigns.reject(
'pd_xyz',
{
rejection_reasons: {
card_logo: ['geographic_location'],
},
}
);
expect(personalizationDesign).not.to.be.null;
});

it('test_test_helpers_issuing_transactions_create_force_capture_post', async function() {
const transaction = await stripe.testHelpers.issuing.transactions.createForceCapture(
{
Expand Down
15 changes: 15 additions & 0 deletions types/AccountSessions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ declare module 'stripe' {
interface Components {
account_onboarding: Components.AccountOnboarding;

documents: Components.Documents;

payment_details: Components.PaymentDetails;

payments: Components.Payments;
Expand All @@ -69,6 +71,19 @@ declare module 'stripe' {
interface Features {}
}

interface Documents {
/**
* Whether the embedded component is enabled.
*/
enabled: boolean;

features: Documents.Features;
}

namespace Documents {
interface Features {}
}

interface PaymentDetails {
/**
* Whether the embedded component is enabled.
Expand Down
21 changes: 21 additions & 0 deletions types/AccountSessionsResource.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ declare module 'stripe' {
*/
account_onboarding?: Components.AccountOnboarding;

/**
* Configuration for the documents embedded component.
*/
documents?: Components.Documents;

/**
* Configuration for the payment details embedded component.
*/
Expand Down Expand Up @@ -59,6 +64,22 @@ declare module 'stripe' {
interface Features {}
}

interface Documents {
/**
* Whether the embedded component is enabled.
*/
enabled: boolean;

/**
* The list of features enabled in the embedded component.
*/
features?: Documents.Features;
}

namespace Documents {
interface Features {}
}

interface PaymentDetails {
/**
* Whether the embedded component is enabled.
Expand Down
7 changes: 7 additions & 0 deletions types/Checkout/Sessions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1087,6 +1087,11 @@ declare module 'stripe' {
interface Card {
installments?: Card.Installments;

/**
* We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
*/
request_three_d_secure: Card.RequestThreeDSecure;

/**
* Indicates that you intend to make future payments with this PaymentIntent's payment method.
*
Expand Down Expand Up @@ -1115,6 +1120,8 @@ declare module 'stripe' {
enabled?: boolean;
}

type RequestThreeDSecure = 'any' | 'automatic' | 'challenge';

type SetupFutureUsage = 'none' | 'off_session' | 'on_session';
}

Expand Down
7 changes: 7 additions & 0 deletions types/Checkout/SessionsResource.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1267,6 +1267,11 @@ declare module 'stripe' {
*/
installments?: Card.Installments;

/**
* We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
*/
request_three_d_secure?: Card.RequestThreeDSecure;

/**
* Indicates that you intend to make future payments with this PaymentIntent's payment method.
*
Expand Down Expand Up @@ -1296,6 +1301,8 @@ declare module 'stripe' {
enabled?: boolean;
}

type RequestThreeDSecure = 'any' | 'automatic' | 'challenge';

type SetupFutureUsage = 'off_session' | 'on_session';
}

Expand Down
5 changes: 5 additions & 0 deletions types/CreditNotesResource.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,11 @@ declare module 'stripe' {
}

interface CreditNoteListParams extends PaginationParams {
/**
* Only return credit notes that were created during the given date interval.
*/
created?: Stripe.RangeQueryParam | number;

/**
* Only return credit notes for the customer specified by this customer ID.
*/
Expand Down
Loading

0 comments on commit 052871e

Please sign in to comment.