diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index bf46acad45..2babab019f 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -66,7 +66,7 @@ body: attributes: label: API version description: See [Versioning](https://stripe.com/docs/api/versioning) in the API Reference to find which version you're using - placeholder: "2020-08-27" + placeholder: "2022-08-01" validations: required: true - type: textarea diff --git a/API_VERSION b/API_VERSION index 085b23efda..0366ceb901 100644 --- a/API_VERSION +++ b/API_VERSION @@ -1 +1 @@ -2020-08-27 +2022-08-01 diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 426d5c5a1e..714ead9782 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v173 \ No newline at end of file +v174 \ No newline at end of file diff --git a/README.md b/README.md index 2ed0f8dd89..662651eb72 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,7 @@ and instantiate it as `new Stripe()` with the latest API version. ```ts import Stripe from 'stripe'; const stripe = new Stripe('sk_test_...', { - apiVersion: '2020-08-27', + apiVersion: '2022-08-01', }); const createCustomer = async () => { diff --git a/examples/webhook-signing/typescript-node-express/express-ts.ts b/examples/webhook-signing/typescript-node-express/express-ts.ts index 87b11a7cdb..c0a4c1d4b7 100644 --- a/examples/webhook-signing/typescript-node-express/express-ts.ts +++ b/examples/webhook-signing/typescript-node-express/express-ts.ts @@ -5,7 +5,7 @@ import env from 'dotenv'; env.config(); const stripe = new Stripe(process.env.STRIPE_SECRET_KEY, { - apiVersion: '2020-08-27', + apiVersion: '2022-08-01', }); const webhookSecret: string = process.env.STRIPE_WEBHOOK_SECRET; diff --git a/lib/apiVersion.js b/lib/apiVersion.js index e8515c3cd4..704a3619eb 100644 --- a/lib/apiVersion.js +++ b/lib/apiVersion.js @@ -1,3 +1,3 @@ // File generated from our OpenAPI spec -module.exports = {ApiVersion: '2020-08-27'}; +module.exports = {ApiVersion: '2022-08-01'}; diff --git a/package.json b/package.json index fea8f9e863..cdd6813e7a 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "node": "^8.1 || >=10.*" }, "main": "lib/stripe.js", - "types": "types/2020-08-27/index.d.ts", + "types": "types/2022-08-01/index.d.ts", "devDependencies": { "@typescript-eslint/eslint-plugin": "^2.13.0", "@typescript-eslint/parser": "^2.13.0", diff --git a/types/2020-08-27/AccountLinks.d.ts b/types/2022-08-01/AccountLinks.d.ts similarity index 100% rename from types/2020-08-27/AccountLinks.d.ts rename to types/2022-08-01/AccountLinks.d.ts diff --git a/types/2020-08-27/Accounts.d.ts b/types/2022-08-01/Accounts.d.ts similarity index 99% rename from types/2020-08-27/Accounts.d.ts rename to types/2022-08-01/Accounts.d.ts index 9eae1b9e9a..b3e52d3427 100644 --- a/types/2020-08-27/Accounts.d.ts +++ b/types/2022-08-01/Accounts.d.ts @@ -704,6 +704,7 @@ declare module 'stripe' { type Code = | 'invalid_address_city_state_postal_code' | 'invalid_street_address' + | 'invalid_tos_acceptance' | 'invalid_value_other' | 'verification_document_address_mismatch' | 'verification_document_address_missing' @@ -826,6 +827,7 @@ declare module 'stripe' { type Code = | 'invalid_address_city_state_postal_code' | 'invalid_street_address' + | 'invalid_tos_acceptance' | 'invalid_value_other' | 'verification_document_address_mismatch' | 'verification_document_address_missing' diff --git a/types/2020-08-27/ApplePayDomains.d.ts b/types/2022-08-01/ApplePayDomains.d.ts similarity index 100% rename from types/2020-08-27/ApplePayDomains.d.ts rename to types/2022-08-01/ApplePayDomains.d.ts diff --git a/types/2020-08-27/ApplicationFees.d.ts b/types/2022-08-01/ApplicationFees.d.ts similarity index 100% rename from types/2020-08-27/ApplicationFees.d.ts rename to types/2022-08-01/ApplicationFees.d.ts diff --git a/types/2020-08-27/Applications.d.ts b/types/2022-08-01/Applications.d.ts similarity index 100% rename from types/2020-08-27/Applications.d.ts rename to types/2022-08-01/Applications.d.ts diff --git a/types/2020-08-27/Apps/Secrets.d.ts b/types/2022-08-01/Apps/Secrets.d.ts similarity index 100% rename from types/2020-08-27/Apps/Secrets.d.ts rename to types/2022-08-01/Apps/Secrets.d.ts diff --git a/types/2020-08-27/Balance.d.ts b/types/2022-08-01/Balance.d.ts similarity index 100% rename from types/2020-08-27/Balance.d.ts rename to types/2022-08-01/Balance.d.ts diff --git a/types/2020-08-27/BalanceTransactions.d.ts b/types/2022-08-01/BalanceTransactions.d.ts similarity index 100% rename from types/2020-08-27/BalanceTransactions.d.ts rename to types/2022-08-01/BalanceTransactions.d.ts diff --git a/types/2020-08-27/BankAccounts.d.ts b/types/2022-08-01/BankAccounts.d.ts similarity index 100% rename from types/2020-08-27/BankAccounts.d.ts rename to types/2022-08-01/BankAccounts.d.ts diff --git a/types/2020-08-27/BillingPortal/Configurations.d.ts b/types/2022-08-01/BillingPortal/Configurations.d.ts similarity index 100% rename from types/2020-08-27/BillingPortal/Configurations.d.ts rename to types/2022-08-01/BillingPortal/Configurations.d.ts diff --git a/types/2020-08-27/BillingPortal/Sessions.d.ts b/types/2022-08-01/BillingPortal/Sessions.d.ts similarity index 100% rename from types/2020-08-27/BillingPortal/Sessions.d.ts rename to types/2022-08-01/BillingPortal/Sessions.d.ts diff --git a/types/2020-08-27/Capabilities.d.ts b/types/2022-08-01/Capabilities.d.ts similarity index 99% rename from types/2020-08-27/Capabilities.d.ts rename to types/2022-08-01/Capabilities.d.ts index 897a782160..3026232541 100644 --- a/types/2020-08-27/Capabilities.d.ts +++ b/types/2022-08-01/Capabilities.d.ts @@ -118,6 +118,7 @@ declare module 'stripe' { type Code = | 'invalid_address_city_state_postal_code' | 'invalid_street_address' + | 'invalid_tos_acceptance' | 'invalid_value_other' | 'verification_document_address_mismatch' | 'verification_document_address_missing' @@ -246,6 +247,7 @@ declare module 'stripe' { type Code = | 'invalid_address_city_state_postal_code' | 'invalid_street_address' + | 'invalid_tos_acceptance' | 'invalid_value_other' | 'verification_document_address_mismatch' | 'verification_document_address_missing' diff --git a/types/2020-08-27/Cards.d.ts b/types/2022-08-01/Cards.d.ts similarity index 100% rename from types/2020-08-27/Cards.d.ts rename to types/2022-08-01/Cards.d.ts diff --git a/types/2020-08-27/CashBalances.d.ts b/types/2022-08-01/CashBalances.d.ts similarity index 100% rename from types/2020-08-27/CashBalances.d.ts rename to types/2022-08-01/CashBalances.d.ts diff --git a/types/2020-08-27/Charges.d.ts b/types/2022-08-01/Charges.d.ts similarity index 100% rename from types/2020-08-27/Charges.d.ts rename to types/2022-08-01/Charges.d.ts diff --git a/types/2020-08-27/Checkout/Sessions.d.ts b/types/2022-08-01/Checkout/Sessions.d.ts similarity index 98% rename from types/2020-08-27/Checkout/Sessions.d.ts rename to types/2022-08-01/Checkout/Sessions.d.ts index 47f5080537..180a348fae 100644 --- a/types/2020-08-27/Checkout/Sessions.d.ts +++ b/types/2022-08-01/Checkout/Sessions.d.ts @@ -170,24 +170,24 @@ declare module 'stripe' { setup_intent: string | Stripe.SetupIntent | null; /** - * Shipping information for this Checkout Session. + * When set, provides configuration for Checkout to collect a shipping address from a customer. */ - shipping: Session.Shipping | null; + shipping_address_collection: Session.ShippingAddressCollection | null; /** - * When set, provides configuration for Checkout to collect a shipping address from a customer. + * The details of the customer cost of shipping, including the customer chosen ShippingRate. */ - shipping_address_collection: Session.ShippingAddressCollection | null; + shipping_cost: Session.ShippingCost | null; /** - * The shipping rate options applied to this Session. + * Shipping information for this Checkout Session. */ - shipping_options: Array; + shipping_details: Session.ShippingDetails | null; /** - * The ID of the ShippingRate for Checkout Sessions in `payment` mode. + * The shipping rate options applied to this Session. */ - shipping_rate: string | Stripe.ShippingRate | null; + shipping_options: Array; /** * The status of the Checkout Session, one of `open`, `complete`, or `expired`. @@ -957,30 +957,6 @@ declare module 'stripe' { enabled: boolean; } - interface Shipping { - address?: Stripe.Address; - - /** - * The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. - */ - carrier?: string | null; - - /** - * Recipient name. - */ - name?: string; - - /** - * Recipient phone (including extension). - */ - phone?: string | null; - - /** - * The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. - */ - tracking_number?: string | null; - } - interface ShippingAddressCollection { /** * An array of two-letter ISO country codes representing which countries Checkout should provide as options for @@ -1230,6 +1206,73 @@ declare module 'stripe' { | 'ZZ'; } + interface ShippingCost { + /** + * Total shipping cost before any discounts or taxes are applied. + */ + amount_subtotal: number; + + /** + * Total tax amount applied due to shipping costs. If no tax was applied, defaults to 0. + */ + amount_tax: number; + + /** + * Total shipping cost after discounts and taxes are applied. + */ + amount_total: number; + + /** + * The ID of the ShippingRate for this order. + */ + shipping_rate: string | Stripe.ShippingRate | null; + + /** + * The taxes applied to the shipping rate. + */ + taxes?: Array; + } + + namespace ShippingCost { + interface Tax { + /** + * Amount of tax applied for this rate. + */ + amount: number; + + /** + * Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. + * + * Related guide: [Tax Rates](https://stripe.com/docs/billing/taxes/tax-rates). + */ + rate: Stripe.TaxRate; + } + } + + interface ShippingDetails { + address?: Stripe.Address; + + /** + * The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + */ + carrier?: string | null; + + /** + * Recipient name. + */ + name?: string; + + /** + * Recipient phone (including extension). + */ + phone?: string | null; + + /** + * The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. + */ + tracking_number?: string | null; + } + interface ShippingOption { /** * A non-negative integer in cents representing how much to charge. @@ -2320,6 +2363,9 @@ declare module 'stripe' { namespace CustomerBalance { interface BankTransfer { + /** + * Configuration for eu_bank_transfer funding type. + */ eu_bank_transfer?: BankTransfer.EuBankTransfer; /** diff --git a/types/2020-08-27/ConnectCollectionTransfers.d.ts b/types/2022-08-01/ConnectCollectionTransfers.d.ts similarity index 100% rename from types/2020-08-27/ConnectCollectionTransfers.d.ts rename to types/2022-08-01/ConnectCollectionTransfers.d.ts diff --git a/types/2020-08-27/CountrySpecs.d.ts b/types/2022-08-01/CountrySpecs.d.ts similarity index 100% rename from types/2020-08-27/CountrySpecs.d.ts rename to types/2022-08-01/CountrySpecs.d.ts diff --git a/types/2020-08-27/Coupons.d.ts b/types/2022-08-01/Coupons.d.ts similarity index 100% rename from types/2020-08-27/Coupons.d.ts rename to types/2022-08-01/Coupons.d.ts diff --git a/types/2020-08-27/CreditNoteLineItems.d.ts b/types/2022-08-01/CreditNoteLineItems.d.ts similarity index 100% rename from types/2020-08-27/CreditNoteLineItems.d.ts rename to types/2022-08-01/CreditNoteLineItems.d.ts diff --git a/types/2020-08-27/CreditNotes.d.ts b/types/2022-08-01/CreditNotes.d.ts similarity index 100% rename from types/2020-08-27/CreditNotes.d.ts rename to types/2022-08-01/CreditNotes.d.ts diff --git a/types/2020-08-27/CustomerBalanceTransactions.d.ts b/types/2022-08-01/CustomerBalanceTransactions.d.ts similarity index 100% rename from types/2020-08-27/CustomerBalanceTransactions.d.ts rename to types/2022-08-01/CustomerBalanceTransactions.d.ts diff --git a/types/2020-08-27/CustomerSources.d.ts b/types/2022-08-01/CustomerSources.d.ts similarity index 100% rename from types/2020-08-27/CustomerSources.d.ts rename to types/2022-08-01/CustomerSources.d.ts diff --git a/types/2020-08-27/Customers.d.ts b/types/2022-08-01/Customers.d.ts similarity index 99% rename from types/2020-08-27/Customers.d.ts rename to types/2022-08-01/Customers.d.ts index 1d8fd0e4a1..f2b39884c8 100644 --- a/types/2020-08-27/Customers.d.ts +++ b/types/2022-08-01/Customers.d.ts @@ -41,11 +41,6 @@ declare module 'stripe' { */ currency?: string | null; - /** - * The default three-letter [ISO code for the currency](https://stripe.com/docs/currencies) that the customer will be charged in for billing purposes. - */ - default_currency?: string | null; - /** * ID of the default payment source for the customer. * diff --git a/types/2020-08-27/Discounts.d.ts b/types/2022-08-01/Discounts.d.ts similarity index 100% rename from types/2020-08-27/Discounts.d.ts rename to types/2022-08-01/Discounts.d.ts diff --git a/types/2020-08-27/Disputes.d.ts b/types/2022-08-01/Disputes.d.ts similarity index 100% rename from types/2020-08-27/Disputes.d.ts rename to types/2022-08-01/Disputes.d.ts diff --git a/types/2020-08-27/EphemeralKeys.d.ts b/types/2022-08-01/EphemeralKeys.d.ts similarity index 100% rename from types/2020-08-27/EphemeralKeys.d.ts rename to types/2022-08-01/EphemeralKeys.d.ts diff --git a/types/2020-08-27/Events.d.ts b/types/2022-08-01/Events.d.ts similarity index 100% rename from types/2020-08-27/Events.d.ts rename to types/2022-08-01/Events.d.ts diff --git a/types/2020-08-27/ExchangeRates.d.ts b/types/2022-08-01/ExchangeRates.d.ts similarity index 100% rename from types/2020-08-27/ExchangeRates.d.ts rename to types/2022-08-01/ExchangeRates.d.ts diff --git a/types/2020-08-27/ExternalAccounts.d.ts b/types/2022-08-01/ExternalAccounts.d.ts similarity index 100% rename from types/2020-08-27/ExternalAccounts.d.ts rename to types/2022-08-01/ExternalAccounts.d.ts diff --git a/types/2020-08-27/FeeRefunds.d.ts b/types/2022-08-01/FeeRefunds.d.ts similarity index 100% rename from types/2020-08-27/FeeRefunds.d.ts rename to types/2022-08-01/FeeRefunds.d.ts diff --git a/types/2020-08-27/FileLinks.d.ts b/types/2022-08-01/FileLinks.d.ts similarity index 100% rename from types/2020-08-27/FileLinks.d.ts rename to types/2022-08-01/FileLinks.d.ts diff --git a/types/2020-08-27/Files.d.ts b/types/2022-08-01/Files.d.ts similarity index 100% rename from types/2020-08-27/Files.d.ts rename to types/2022-08-01/Files.d.ts diff --git a/types/2020-08-27/FinancialConnections/AccountOwners.d.ts b/types/2022-08-01/FinancialConnections/AccountOwners.d.ts similarity index 100% rename from types/2020-08-27/FinancialConnections/AccountOwners.d.ts rename to types/2022-08-01/FinancialConnections/AccountOwners.d.ts diff --git a/types/2020-08-27/FinancialConnections/AccountOwnerships.d.ts b/types/2022-08-01/FinancialConnections/AccountOwnerships.d.ts similarity index 100% rename from types/2020-08-27/FinancialConnections/AccountOwnerships.d.ts rename to types/2022-08-01/FinancialConnections/AccountOwnerships.d.ts diff --git a/types/2020-08-27/FinancialConnections/Accounts.d.ts b/types/2022-08-01/FinancialConnections/Accounts.d.ts similarity index 100% rename from types/2020-08-27/FinancialConnections/Accounts.d.ts rename to types/2022-08-01/FinancialConnections/Accounts.d.ts diff --git a/types/2020-08-27/FinancialConnections/Sessions.d.ts b/types/2022-08-01/FinancialConnections/Sessions.d.ts similarity index 100% rename from types/2020-08-27/FinancialConnections/Sessions.d.ts rename to types/2022-08-01/FinancialConnections/Sessions.d.ts diff --git a/types/2020-08-27/FundingInstructions.d.ts b/types/2022-08-01/FundingInstructions.d.ts similarity index 100% rename from types/2020-08-27/FundingInstructions.d.ts rename to types/2022-08-01/FundingInstructions.d.ts diff --git a/types/2020-08-27/Identity/VerificationReports.d.ts b/types/2022-08-01/Identity/VerificationReports.d.ts similarity index 100% rename from types/2020-08-27/Identity/VerificationReports.d.ts rename to types/2022-08-01/Identity/VerificationReports.d.ts diff --git a/types/2020-08-27/Identity/VerificationSessions.d.ts b/types/2022-08-01/Identity/VerificationSessions.d.ts similarity index 100% rename from types/2020-08-27/Identity/VerificationSessions.d.ts rename to types/2022-08-01/Identity/VerificationSessions.d.ts diff --git a/types/2020-08-27/InvoiceItems.d.ts b/types/2022-08-01/InvoiceItems.d.ts similarity index 100% rename from types/2020-08-27/InvoiceItems.d.ts rename to types/2022-08-01/InvoiceItems.d.ts diff --git a/types/2020-08-27/InvoiceLineItems.d.ts b/types/2022-08-01/InvoiceLineItems.d.ts similarity index 100% rename from types/2020-08-27/InvoiceLineItems.d.ts rename to types/2022-08-01/InvoiceLineItems.d.ts diff --git a/types/2020-08-27/Invoices.d.ts b/types/2022-08-01/Invoices.d.ts similarity index 99% rename from types/2020-08-27/Invoices.d.ts rename to types/2022-08-01/Invoices.d.ts index 9f7ac5866a..5403d1874a 100644 --- a/types/2020-08-27/Invoices.d.ts +++ b/types/2022-08-01/Invoices.d.ts @@ -1026,7 +1026,7 @@ declare module 'stripe' { payment_settings?: InvoiceCreateParams.PaymentSettings; /** - * How to handle pending invoice items on invoice creation. One of `include`, `exclude`, or `include_and_require`. `include` will include any pending invoice items, and will create an empty draft invoice if no pending invoice items exist. `include_and_require` will include any pending invoice items, if no pending invoice items exist then the request will fail. `exclude` will always create an empty invoice draft regardless if there are pending invoice items or not. Defaults to `include_and_require` if the parameter is omitted. + * How to handle pending invoice items on invoice creation. One of `include` or `exclude`. `include` will include any pending invoice items, and will create an empty draft invoice if no pending invoice items exist. `exclude` will always create an empty invoice draft regardless if there are pending invoice items or not. Defaults to `exclude` if the parameter is omitted. */ pending_invoice_items_behavior?: InvoiceCreateParams.PendingInvoiceItemsBehavior; @@ -1043,7 +1043,7 @@ declare module 'stripe' { statement_descriptor?: string; /** - * The ID of the subscription to invoice, if any. If not set, the created invoice will include all pending invoice items for the customer. If set, the created invoice will only include pending invoice items for that subscription and pending invoice items not associated with any subscription. The subscription's billing cycle and regular subscription events won't be affected. + * The ID of the subscription to invoice, if any. If set, the created invoice will only include pending invoice items for that subscription and pending invoice items not associated with any subscription if `pending_invoice_items_behavior` is `include`. The subscription's billing cycle and regular subscription events won't be affected. */ subscription?: string; diff --git a/types/2020-08-27/Issuing/Authorizations.d.ts b/types/2022-08-01/Issuing/Authorizations.d.ts similarity index 100% rename from types/2020-08-27/Issuing/Authorizations.d.ts rename to types/2022-08-01/Issuing/Authorizations.d.ts diff --git a/types/2020-08-27/Issuing/Cardholders.d.ts b/types/2022-08-01/Issuing/Cardholders.d.ts similarity index 99% rename from types/2020-08-27/Issuing/Cardholders.d.ts rename to types/2022-08-01/Issuing/Cardholders.d.ts index 944d2a43bb..b4efe63687 100644 --- a/types/2020-08-27/Issuing/Cardholders.d.ts +++ b/types/2022-08-01/Issuing/Cardholders.d.ts @@ -1109,7 +1109,7 @@ declare module 'stripe' { billing: CardholderCreateParams.Billing; /** - * The cardholder's name. This will be printed on cards issued to them. The maximum length of this field is 24 characters. + * The cardholder's name. This will be printed on cards issued to them. The maximum length of this field is 24 characters. This field cannot contain any special characters or numbers. */ name: string; @@ -1215,12 +1215,12 @@ declare module 'stripe' { dob?: Individual.Dob; /** - * The first name of this cardholder. + * The first name of this cardholder. This field cannot contain any special characters or numbers. */ first_name: string; /** - * The last name of this cardholder. + * The last name of this cardholder. This field cannot contain any special characters or numbers. */ last_name: string; @@ -2306,12 +2306,12 @@ declare module 'stripe' { dob?: Individual.Dob; /** - * The first name of this cardholder. + * The first name of this cardholder. This field cannot contain any special characters or numbers. */ first_name: string; /** - * The last name of this cardholder. + * The last name of this cardholder. This field cannot contain any special characters or numbers. */ last_name: string; diff --git a/types/2020-08-27/Issuing/Cards.d.ts b/types/2022-08-01/Issuing/Cards.d.ts similarity index 99% rename from types/2020-08-27/Issuing/Cards.d.ts rename to types/2022-08-01/Issuing/Cards.d.ts index 0e36ad035e..725785198a 100644 --- a/types/2020-08-27/Issuing/Cards.d.ts +++ b/types/2022-08-01/Issuing/Cards.d.ts @@ -123,7 +123,7 @@ declare module 'stripe' { } namespace Card { - type CancellationReason = 'lost' | 'stolen'; + type CancellationReason = 'design_rejected' | 'lost' | 'stolen'; type ReplacementReason = 'damaged' | 'expired' | 'lost' | 'stolen'; diff --git a/types/2020-08-27/Issuing/Disputes.d.ts b/types/2022-08-01/Issuing/Disputes.d.ts similarity index 100% rename from types/2020-08-27/Issuing/Disputes.d.ts rename to types/2022-08-01/Issuing/Disputes.d.ts diff --git a/types/2020-08-27/Issuing/Transactions.d.ts b/types/2022-08-01/Issuing/Transactions.d.ts similarity index 100% rename from types/2020-08-27/Issuing/Transactions.d.ts rename to types/2022-08-01/Issuing/Transactions.d.ts diff --git a/types/2020-08-27/LineItems.d.ts b/types/2022-08-01/LineItems.d.ts similarity index 100% rename from types/2020-08-27/LineItems.d.ts rename to types/2022-08-01/LineItems.d.ts diff --git a/types/2020-08-27/LoginLinks.d.ts b/types/2022-08-01/LoginLinks.d.ts similarity index 100% rename from types/2020-08-27/LoginLinks.d.ts rename to types/2022-08-01/LoginLinks.d.ts diff --git a/types/2020-08-27/Mandates.d.ts b/types/2022-08-01/Mandates.d.ts similarity index 100% rename from types/2020-08-27/Mandates.d.ts rename to types/2022-08-01/Mandates.d.ts diff --git a/types/2020-08-27/Orders.d.ts b/types/2022-08-01/Orders.d.ts similarity index 100% rename from types/2020-08-27/Orders.d.ts rename to types/2022-08-01/Orders.d.ts diff --git a/types/2020-08-27/PaymentIntents.d.ts b/types/2022-08-01/PaymentIntents.d.ts similarity index 100% rename from types/2020-08-27/PaymentIntents.d.ts rename to types/2022-08-01/PaymentIntents.d.ts diff --git a/types/2020-08-27/PaymentLinks.d.ts b/types/2022-08-01/PaymentLinks.d.ts similarity index 100% rename from types/2020-08-27/PaymentLinks.d.ts rename to types/2022-08-01/PaymentLinks.d.ts diff --git a/types/2020-08-27/PaymentMethods.d.ts b/types/2022-08-01/PaymentMethods.d.ts similarity index 99% rename from types/2020-08-27/PaymentMethods.d.ts rename to types/2022-08-01/PaymentMethods.d.ts index e917965d53..03832d780a 100644 --- a/types/2020-08-27/PaymentMethods.d.ts +++ b/types/2022-08-01/PaymentMethods.d.ts @@ -1591,9 +1591,11 @@ declare module 'stripe' { * * To attach a new PaymentMethod to a customer for future payments, we recommend you use a [SetupIntent](https://stripe.com/docs/api/setup_intents) * or a PaymentIntent with [setup_future_usage](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-setup_future_usage). - * These approaches will perform any necessary steps to ensure that the PaymentMethod can be used in a future payment. Using the - * /v1/payment_methods/:id/attach endpoint does not ensure that future payments can be made with the attached PaymentMethod. - * See [Optimizing cards for future payments](https://stripe.com/docs/payments/payment-intents#future-usage) for more information about setting up future payments. + * These approaches will perform any necessary steps to set up the PaymentMethod for future payments. Using the /v1/payment_methods/:id/attach + * endpoint without first using a SetupIntent or PaymentIntent with setup_future_usage does not optimize the PaymentMethod for + * future use, which makes later declines and payment friction more likely. + * See [Optimizing cards for future payments](https://stripe.com/docs/payments/payment-intents#future-usage) for more information about setting up + * future payments. * * To use this PaymentMethod as the default for invoice or subscription payments, * set [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method), diff --git a/types/2020-08-27/Payouts.d.ts b/types/2022-08-01/Payouts.d.ts similarity index 100% rename from types/2020-08-27/Payouts.d.ts rename to types/2022-08-01/Payouts.d.ts diff --git a/types/2020-08-27/Persons.d.ts b/types/2022-08-01/Persons.d.ts similarity index 99% rename from types/2020-08-27/Persons.d.ts rename to types/2022-08-01/Persons.d.ts index 6289b55107..6fdaacd200 100644 --- a/types/2020-08-27/Persons.d.ts +++ b/types/2022-08-01/Persons.d.ts @@ -302,6 +302,7 @@ declare module 'stripe' { type Code = | 'invalid_address_city_state_postal_code' | 'invalid_street_address' + | 'invalid_tos_acceptance' | 'invalid_value_other' | 'verification_document_address_mismatch' | 'verification_document_address_missing' @@ -448,6 +449,7 @@ declare module 'stripe' { type Code = | 'invalid_address_city_state_postal_code' | 'invalid_street_address' + | 'invalid_tos_acceptance' | 'invalid_value_other' | 'verification_document_address_mismatch' | 'verification_document_address_missing' diff --git a/types/2020-08-27/Plans.d.ts b/types/2022-08-01/Plans.d.ts similarity index 100% rename from types/2020-08-27/Plans.d.ts rename to types/2022-08-01/Plans.d.ts diff --git a/types/2020-08-27/PlatformTaxFees.d.ts b/types/2022-08-01/PlatformTaxFees.d.ts similarity index 100% rename from types/2020-08-27/PlatformTaxFees.d.ts rename to types/2022-08-01/PlatformTaxFees.d.ts diff --git a/types/2020-08-27/Prices.d.ts b/types/2022-08-01/Prices.d.ts similarity index 100% rename from types/2020-08-27/Prices.d.ts rename to types/2022-08-01/Prices.d.ts diff --git a/types/2020-08-27/Products.d.ts b/types/2022-08-01/Products.d.ts similarity index 100% rename from types/2020-08-27/Products.d.ts rename to types/2022-08-01/Products.d.ts diff --git a/types/2020-08-27/PromotionCodes.d.ts b/types/2022-08-01/PromotionCodes.d.ts similarity index 100% rename from types/2020-08-27/PromotionCodes.d.ts rename to types/2022-08-01/PromotionCodes.d.ts diff --git a/types/2020-08-27/Quotes.d.ts b/types/2022-08-01/Quotes.d.ts similarity index 100% rename from types/2020-08-27/Quotes.d.ts rename to types/2022-08-01/Quotes.d.ts diff --git a/types/2020-08-27/Radar/EarlyFraudWarnings.d.ts b/types/2022-08-01/Radar/EarlyFraudWarnings.d.ts similarity index 100% rename from types/2020-08-27/Radar/EarlyFraudWarnings.d.ts rename to types/2022-08-01/Radar/EarlyFraudWarnings.d.ts diff --git a/types/2020-08-27/Radar/ValueListItems.d.ts b/types/2022-08-01/Radar/ValueListItems.d.ts similarity index 100% rename from types/2020-08-27/Radar/ValueListItems.d.ts rename to types/2022-08-01/Radar/ValueListItems.d.ts diff --git a/types/2020-08-27/Radar/ValueLists.d.ts b/types/2022-08-01/Radar/ValueLists.d.ts similarity index 100% rename from types/2020-08-27/Radar/ValueLists.d.ts rename to types/2022-08-01/Radar/ValueLists.d.ts diff --git a/types/2020-08-27/Refunds.d.ts b/types/2022-08-01/Refunds.d.ts similarity index 100% rename from types/2020-08-27/Refunds.d.ts rename to types/2022-08-01/Refunds.d.ts diff --git a/types/2020-08-27/Reporting/ReportRuns.d.ts b/types/2022-08-01/Reporting/ReportRuns.d.ts similarity index 100% rename from types/2020-08-27/Reporting/ReportRuns.d.ts rename to types/2022-08-01/Reporting/ReportRuns.d.ts diff --git a/types/2020-08-27/Reporting/ReportTypes.d.ts b/types/2022-08-01/Reporting/ReportTypes.d.ts similarity index 100% rename from types/2020-08-27/Reporting/ReportTypes.d.ts rename to types/2022-08-01/Reporting/ReportTypes.d.ts diff --git a/types/2020-08-27/ReserveTransactions.d.ts b/types/2022-08-01/ReserveTransactions.d.ts similarity index 100% rename from types/2020-08-27/ReserveTransactions.d.ts rename to types/2022-08-01/ReserveTransactions.d.ts diff --git a/types/2020-08-27/Reviews.d.ts b/types/2022-08-01/Reviews.d.ts similarity index 100% rename from types/2020-08-27/Reviews.d.ts rename to types/2022-08-01/Reviews.d.ts diff --git a/types/2020-08-27/SKUs.d.ts b/types/2022-08-01/SKUs.d.ts similarity index 100% rename from types/2020-08-27/SKUs.d.ts rename to types/2022-08-01/SKUs.d.ts diff --git a/types/2020-08-27/SetupAttempts.d.ts b/types/2022-08-01/SetupAttempts.d.ts similarity index 100% rename from types/2020-08-27/SetupAttempts.d.ts rename to types/2022-08-01/SetupAttempts.d.ts diff --git a/types/2020-08-27/SetupIntents.d.ts b/types/2022-08-01/SetupIntents.d.ts similarity index 100% rename from types/2020-08-27/SetupIntents.d.ts rename to types/2022-08-01/SetupIntents.d.ts diff --git a/types/2020-08-27/ShippingRates.d.ts b/types/2022-08-01/ShippingRates.d.ts similarity index 100% rename from types/2020-08-27/ShippingRates.d.ts rename to types/2022-08-01/ShippingRates.d.ts diff --git a/types/2020-08-27/Sigma/ScheduledQueryRuns.d.ts b/types/2022-08-01/Sigma/ScheduledQueryRuns.d.ts similarity index 100% rename from types/2020-08-27/Sigma/ScheduledQueryRuns.d.ts rename to types/2022-08-01/Sigma/ScheduledQueryRuns.d.ts diff --git a/types/2020-08-27/SourceMandateNotifications.d.ts b/types/2022-08-01/SourceMandateNotifications.d.ts similarity index 100% rename from types/2020-08-27/SourceMandateNotifications.d.ts rename to types/2022-08-01/SourceMandateNotifications.d.ts diff --git a/types/2020-08-27/SourceTransactions.d.ts b/types/2022-08-01/SourceTransactions.d.ts similarity index 100% rename from types/2020-08-27/SourceTransactions.d.ts rename to types/2022-08-01/SourceTransactions.d.ts diff --git a/types/2020-08-27/Sources.d.ts b/types/2022-08-01/Sources.d.ts similarity index 100% rename from types/2020-08-27/Sources.d.ts rename to types/2022-08-01/Sources.d.ts diff --git a/types/2020-08-27/SubscriptionItems.d.ts b/types/2022-08-01/SubscriptionItems.d.ts similarity index 100% rename from types/2020-08-27/SubscriptionItems.d.ts rename to types/2022-08-01/SubscriptionItems.d.ts diff --git a/types/2020-08-27/SubscriptionSchedules.d.ts b/types/2022-08-01/SubscriptionSchedules.d.ts similarity index 100% rename from types/2020-08-27/SubscriptionSchedules.d.ts rename to types/2022-08-01/SubscriptionSchedules.d.ts diff --git a/types/2020-08-27/Subscriptions.d.ts b/types/2022-08-01/Subscriptions.d.ts similarity index 100% rename from types/2020-08-27/Subscriptions.d.ts rename to types/2022-08-01/Subscriptions.d.ts diff --git a/types/2020-08-27/TaxCodes.d.ts b/types/2022-08-01/TaxCodes.d.ts similarity index 100% rename from types/2020-08-27/TaxCodes.d.ts rename to types/2022-08-01/TaxCodes.d.ts diff --git a/types/2020-08-27/TaxDeductedAtSources.d.ts b/types/2022-08-01/TaxDeductedAtSources.d.ts similarity index 100% rename from types/2020-08-27/TaxDeductedAtSources.d.ts rename to types/2022-08-01/TaxDeductedAtSources.d.ts diff --git a/types/2020-08-27/TaxIds.d.ts b/types/2022-08-01/TaxIds.d.ts similarity index 100% rename from types/2020-08-27/TaxIds.d.ts rename to types/2022-08-01/TaxIds.d.ts diff --git a/types/2020-08-27/TaxRates.d.ts b/types/2022-08-01/TaxRates.d.ts similarity index 100% rename from types/2020-08-27/TaxRates.d.ts rename to types/2022-08-01/TaxRates.d.ts diff --git a/types/2020-08-27/Terminal/Configurations.d.ts b/types/2022-08-01/Terminal/Configurations.d.ts similarity index 100% rename from types/2020-08-27/Terminal/Configurations.d.ts rename to types/2022-08-01/Terminal/Configurations.d.ts diff --git a/types/2020-08-27/Terminal/ConnectionTokens.d.ts b/types/2022-08-01/Terminal/ConnectionTokens.d.ts similarity index 100% rename from types/2020-08-27/Terminal/ConnectionTokens.d.ts rename to types/2022-08-01/Terminal/ConnectionTokens.d.ts diff --git a/types/2020-08-27/Terminal/Locations.d.ts b/types/2022-08-01/Terminal/Locations.d.ts similarity index 100% rename from types/2020-08-27/Terminal/Locations.d.ts rename to types/2022-08-01/Terminal/Locations.d.ts diff --git a/types/2020-08-27/Terminal/Readers.d.ts b/types/2022-08-01/Terminal/Readers.d.ts similarity index 100% rename from types/2020-08-27/Terminal/Readers.d.ts rename to types/2022-08-01/Terminal/Readers.d.ts diff --git a/types/2020-08-27/TestHelpers/Customers.d.ts b/types/2022-08-01/TestHelpers/Customers.d.ts similarity index 100% rename from types/2020-08-27/TestHelpers/Customers.d.ts rename to types/2022-08-01/TestHelpers/Customers.d.ts diff --git a/types/2020-08-27/TestHelpers/Issuing/Cards.d.ts b/types/2022-08-01/TestHelpers/Issuing/Cards.d.ts similarity index 100% rename from types/2020-08-27/TestHelpers/Issuing/Cards.d.ts rename to types/2022-08-01/TestHelpers/Issuing/Cards.d.ts diff --git a/types/2020-08-27/TestHelpers/Refunds.d.ts b/types/2022-08-01/TestHelpers/Refunds.d.ts similarity index 100% rename from types/2020-08-27/TestHelpers/Refunds.d.ts rename to types/2022-08-01/TestHelpers/Refunds.d.ts diff --git a/types/2020-08-27/TestHelpers/Terminal/Readers.d.ts b/types/2022-08-01/TestHelpers/Terminal/Readers.d.ts similarity index 100% rename from types/2020-08-27/TestHelpers/Terminal/Readers.d.ts rename to types/2022-08-01/TestHelpers/Terminal/Readers.d.ts diff --git a/types/2020-08-27/TestHelpers/TestClocks.d.ts b/types/2022-08-01/TestHelpers/TestClocks.d.ts similarity index 100% rename from types/2020-08-27/TestHelpers/TestClocks.d.ts rename to types/2022-08-01/TestHelpers/TestClocks.d.ts diff --git a/types/2020-08-27/TestHelpers/Treasury/InboundTransfers.d.ts b/types/2022-08-01/TestHelpers/Treasury/InboundTransfers.d.ts similarity index 100% rename from types/2020-08-27/TestHelpers/Treasury/InboundTransfers.d.ts rename to types/2022-08-01/TestHelpers/Treasury/InboundTransfers.d.ts diff --git a/types/2020-08-27/TestHelpers/Treasury/OutboundPayments.d.ts b/types/2022-08-01/TestHelpers/Treasury/OutboundPayments.d.ts similarity index 100% rename from types/2020-08-27/TestHelpers/Treasury/OutboundPayments.d.ts rename to types/2022-08-01/TestHelpers/Treasury/OutboundPayments.d.ts diff --git a/types/2020-08-27/TestHelpers/Treasury/OutboundTransfers.d.ts b/types/2022-08-01/TestHelpers/Treasury/OutboundTransfers.d.ts similarity index 100% rename from types/2020-08-27/TestHelpers/Treasury/OutboundTransfers.d.ts rename to types/2022-08-01/TestHelpers/Treasury/OutboundTransfers.d.ts diff --git a/types/2020-08-27/TestHelpers/Treasury/ReceivedCredits.d.ts b/types/2022-08-01/TestHelpers/Treasury/ReceivedCredits.d.ts similarity index 100% rename from types/2020-08-27/TestHelpers/Treasury/ReceivedCredits.d.ts rename to types/2022-08-01/TestHelpers/Treasury/ReceivedCredits.d.ts diff --git a/types/2020-08-27/TestHelpers/Treasury/ReceivedDebits.d.ts b/types/2022-08-01/TestHelpers/Treasury/ReceivedDebits.d.ts similarity index 100% rename from types/2020-08-27/TestHelpers/Treasury/ReceivedDebits.d.ts rename to types/2022-08-01/TestHelpers/Treasury/ReceivedDebits.d.ts diff --git a/types/2020-08-27/Tokens.d.ts b/types/2022-08-01/Tokens.d.ts similarity index 100% rename from types/2020-08-27/Tokens.d.ts rename to types/2022-08-01/Tokens.d.ts diff --git a/types/2020-08-27/Topups.d.ts b/types/2022-08-01/Topups.d.ts similarity index 100% rename from types/2020-08-27/Topups.d.ts rename to types/2022-08-01/Topups.d.ts diff --git a/types/2020-08-27/TransferReversals.d.ts b/types/2022-08-01/TransferReversals.d.ts similarity index 100% rename from types/2020-08-27/TransferReversals.d.ts rename to types/2022-08-01/TransferReversals.d.ts diff --git a/types/2020-08-27/Transfers.d.ts b/types/2022-08-01/Transfers.d.ts similarity index 100% rename from types/2020-08-27/Transfers.d.ts rename to types/2022-08-01/Transfers.d.ts diff --git a/types/2020-08-27/Treasury/CreditReversals.d.ts b/types/2022-08-01/Treasury/CreditReversals.d.ts similarity index 100% rename from types/2020-08-27/Treasury/CreditReversals.d.ts rename to types/2022-08-01/Treasury/CreditReversals.d.ts diff --git a/types/2020-08-27/Treasury/DebitReversals.d.ts b/types/2022-08-01/Treasury/DebitReversals.d.ts similarity index 100% rename from types/2020-08-27/Treasury/DebitReversals.d.ts rename to types/2022-08-01/Treasury/DebitReversals.d.ts diff --git a/types/2020-08-27/Treasury/FinancialAccountFeatures.d.ts b/types/2022-08-01/Treasury/FinancialAccountFeatures.d.ts similarity index 100% rename from types/2020-08-27/Treasury/FinancialAccountFeatures.d.ts rename to types/2022-08-01/Treasury/FinancialAccountFeatures.d.ts diff --git a/types/2020-08-27/Treasury/FinancialAccounts.d.ts b/types/2022-08-01/Treasury/FinancialAccounts.d.ts similarity index 100% rename from types/2020-08-27/Treasury/FinancialAccounts.d.ts rename to types/2022-08-01/Treasury/FinancialAccounts.d.ts diff --git a/types/2020-08-27/Treasury/InboundTransfers.d.ts b/types/2022-08-01/Treasury/InboundTransfers.d.ts similarity index 100% rename from types/2020-08-27/Treasury/InboundTransfers.d.ts rename to types/2022-08-01/Treasury/InboundTransfers.d.ts diff --git a/types/2020-08-27/Treasury/OutboundPayments.d.ts b/types/2022-08-01/Treasury/OutboundPayments.d.ts similarity index 100% rename from types/2020-08-27/Treasury/OutboundPayments.d.ts rename to types/2022-08-01/Treasury/OutboundPayments.d.ts diff --git a/types/2020-08-27/Treasury/OutboundTransfers.d.ts b/types/2022-08-01/Treasury/OutboundTransfers.d.ts similarity index 100% rename from types/2020-08-27/Treasury/OutboundTransfers.d.ts rename to types/2022-08-01/Treasury/OutboundTransfers.d.ts diff --git a/types/2020-08-27/Treasury/ReceivedCredits.d.ts b/types/2022-08-01/Treasury/ReceivedCredits.d.ts similarity index 100% rename from types/2020-08-27/Treasury/ReceivedCredits.d.ts rename to types/2022-08-01/Treasury/ReceivedCredits.d.ts diff --git a/types/2020-08-27/Treasury/ReceivedDebits.d.ts b/types/2022-08-01/Treasury/ReceivedDebits.d.ts similarity index 100% rename from types/2020-08-27/Treasury/ReceivedDebits.d.ts rename to types/2022-08-01/Treasury/ReceivedDebits.d.ts diff --git a/types/2020-08-27/Treasury/TransactionEntries.d.ts b/types/2022-08-01/Treasury/TransactionEntries.d.ts similarity index 100% rename from types/2020-08-27/Treasury/TransactionEntries.d.ts rename to types/2022-08-01/Treasury/TransactionEntries.d.ts diff --git a/types/2020-08-27/Treasury/Transactions.d.ts b/types/2022-08-01/Treasury/Transactions.d.ts similarity index 100% rename from types/2020-08-27/Treasury/Transactions.d.ts rename to types/2022-08-01/Treasury/Transactions.d.ts diff --git a/types/2020-08-27/UsageRecordSummaries.d.ts b/types/2022-08-01/UsageRecordSummaries.d.ts similarity index 100% rename from types/2020-08-27/UsageRecordSummaries.d.ts rename to types/2022-08-01/UsageRecordSummaries.d.ts diff --git a/types/2020-08-27/UsageRecords.d.ts b/types/2022-08-01/UsageRecords.d.ts similarity index 100% rename from types/2020-08-27/UsageRecords.d.ts rename to types/2022-08-01/UsageRecords.d.ts diff --git a/types/2020-08-27/WebhookEndpoints.d.ts b/types/2022-08-01/WebhookEndpoints.d.ts similarity index 99% rename from types/2020-08-27/WebhookEndpoints.d.ts rename to types/2022-08-01/WebhookEndpoints.d.ts index f41f82cd0d..50a43b5d22 100644 --- a/types/2020-08-27/WebhookEndpoints.d.ts +++ b/types/2022-08-01/WebhookEndpoints.d.ts @@ -223,7 +223,8 @@ declare module 'stripe' { | '2019-11-05' | '2019-12-03' | '2020-03-02' - | '2020-08-27'; + | '2020-08-27' + | '2022-08-01'; type EnabledEvent = | '*' diff --git a/types/2020-08-27/index.d.ts b/types/2022-08-01/index.d.ts similarity index 100% rename from types/2020-08-27/index.d.ts rename to types/2022-08-01/index.d.ts diff --git a/types/lib.d.ts b/types/lib.d.ts index a0b6f702e4..cf4b19e211 100644 --- a/types/lib.d.ts +++ b/types/lib.d.ts @@ -52,7 +52,7 @@ declare module 'stripe' { }; static MAX_BUFFERED_REQUEST_METRICS: number; } - export type LatestApiVersion = '2020-08-27'; + export type LatestApiVersion = '2022-08-01'; export type HttpAgent = Agent; export type HttpProtocol = 'http' | 'https'; diff --git a/types/test/typescriptTest.ts b/types/test/typescriptTest.ts index 9ed5d59239..ebd0b7da64 100644 --- a/types/test/typescriptTest.ts +++ b/types/test/typescriptTest.ts @@ -5,11 +5,11 @@ * and to perform a basic sanity check that types are exported as intended. */ -/// +/// import Stripe from 'stripe'; let stripe = new Stripe('sk_test_123', { - apiVersion: '2020-08-27', + apiVersion: '2022-08-01', }); // @ts-ignore lazily ignore apiVersion requirement. @@ -27,7 +27,7 @@ stripe = new Stripe('sk_test_123', { // Check config object. stripe = new Stripe('sk_test_123', { - apiVersion: '2020-08-27', + apiVersion: '2022-08-01', typescript: true, maxNetworkRetries: 1, timeout: 1000, @@ -49,7 +49,7 @@ stripe.setHost('host', 'port', 'protocol'); description: 'test', }; const opts: Stripe.RequestOptions = { - apiVersion: '2020-08-27', + apiVersion: '2022-08-01', }; const customer: Stripe.Customer = await stripe.customers.create(params, opts);