From 03f30dd3937b95a1de6a94b6dfd4e105877420fa Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Thu, 22 Sep 2022 11:46:45 -0700 Subject: [PATCH] Codegen for openapi v196 --- OPENAPI_VERSION | 2 +- lib/resources.js | 5 + lib/resources/Capital/FinancingOffers.js | 26 ++ lib/resources/Capital/FinancingSummaries.js | 15 + .../Capital/FinancingTransactions.js | 21 ++ types/2022-08-01/AccountSessions.d.ts | 6 +- types/2022-08-01/Capital/FinancingOffers.d.ts | 259 ++++++++++++++++++ .../Capital/FinancingSummaries.d.ts | 27 ++ .../Capital/FinancingTransactions.d.ts | 175 ++++++++++++ types/2022-08-01/Checkout/Sessions.d.ts | 10 + types/2022-08-01/Customers.d.ts | 1 + types/2022-08-01/GiftCards/Cards.d.ts | 2 +- types/2022-08-01/Issuing/Cards.d.ts | 10 + types/2022-08-01/Orders.d.ts | 75 +++++ types/2022-08-01/PaymentIntents.d.ts | 146 ++++++++++ types/2022-08-01/PaymentLinks.d.ts | 3 + types/2022-08-01/PaymentMethods.d.ts | 14 + types/2022-08-01/Quotes.d.ts | 15 + types/2022-08-01/SetupIntents.d.ts | 24 ++ types/2022-08-01/SubscriptionSchedules.d.ts | 34 ++- types/2022-08-01/WebhookEndpoints.d.ts | 2 + types/2022-08-01/index.d.ts | 8 + 22 files changed, 873 insertions(+), 7 deletions(-) create mode 100644 lib/resources/Capital/FinancingOffers.js create mode 100644 lib/resources/Capital/FinancingSummaries.js create mode 100644 lib/resources/Capital/FinancingTransactions.js create mode 100644 types/2022-08-01/Capital/FinancingOffers.d.ts create mode 100644 types/2022-08-01/Capital/FinancingSummaries.d.ts create mode 100644 types/2022-08-01/Capital/FinancingTransactions.d.ts diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 073a3a984e..72833e6d4c 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v185 \ No newline at end of file +v196 \ No newline at end of file diff --git a/lib/resources.js b/lib/resources.js index d56b1e23ee..a17140f114 100644 --- a/lib/resources.js +++ b/lib/resources.js @@ -63,6 +63,11 @@ module.exports = { Configurations: require('./resources/BillingPortal/Configurations'), Sessions: require('./resources/BillingPortal/Sessions'), }), + Capital: resourceNamespace('capital', { + FinancingOffers: require('./resources/Capital/FinancingOffers'), + FinancingSummaries: require('./resources/Capital/FinancingSummaries'), + FinancingTransactions: require('./resources/Capital/FinancingTransactions'), + }), Checkout: resourceNamespace('checkout', { Sessions: require('./resources/Checkout/Sessions'), }), diff --git a/lib/resources/Capital/FinancingOffers.js b/lib/resources/Capital/FinancingOffers.js new file mode 100644 index 0000000000..f14172a563 --- /dev/null +++ b/lib/resources/Capital/FinancingOffers.js @@ -0,0 +1,26 @@ +// File generated from our OpenAPI spec + +'use strict'; + +const StripeResource = require('../../StripeResource'); +const stripeMethod = StripeResource.method; + +module.exports = StripeResource.extend({ + path: 'capital/financing_offers', + + retrieve: stripeMethod({ + method: 'GET', + path: '/{financingOffer}', + }), + + list: stripeMethod({ + method: 'GET', + path: '', + methodType: 'list', + }), + + markDelivered: stripeMethod({ + method: 'POST', + path: '/{financingOffer}/mark_delivered', + }), +}); diff --git a/lib/resources/Capital/FinancingSummaries.js b/lib/resources/Capital/FinancingSummaries.js new file mode 100644 index 0000000000..a3e102f499 --- /dev/null +++ b/lib/resources/Capital/FinancingSummaries.js @@ -0,0 +1,15 @@ +// File generated from our OpenAPI spec + +'use strict'; + +const StripeResource = require('../../StripeResource'); +const stripeMethod = StripeResource.method; + +module.exports = StripeResource.extend({ + path: 'capital/financing_summary', + + retrieve: stripeMethod({ + method: 'GET', + path: '', + }), +}); diff --git a/lib/resources/Capital/FinancingTransactions.js b/lib/resources/Capital/FinancingTransactions.js new file mode 100644 index 0000000000..3e3740a8d1 --- /dev/null +++ b/lib/resources/Capital/FinancingTransactions.js @@ -0,0 +1,21 @@ +// File generated from our OpenAPI spec + +'use strict'; + +const StripeResource = require('../../StripeResource'); +const stripeMethod = StripeResource.method; + +module.exports = StripeResource.extend({ + path: 'capital/financing_transactions', + + retrieve: stripeMethod({ + method: 'GET', + path: '/{financingTransaction}', + }), + + list: stripeMethod({ + method: 'GET', + path: '', + methodType: 'list', + }), +}); diff --git a/types/2022-08-01/AccountSessions.d.ts b/types/2022-08-01/AccountSessions.d.ts index ff5d79cc17..4208733c45 100644 --- a/types/2022-08-01/AccountSessions.d.ts +++ b/types/2022-08-01/AccountSessions.d.ts @@ -3,13 +3,13 @@ declare module 'stripe' { namespace Stripe { /** - * An AccountSession allows a Connect platform to grant access to a connected account in Connect Elements. + * An AccountSession allows a Connect platform to grant access to a connected account in Connect Embedded UIs. * * We recommend that you create an AccountSession each time you need to display an embedded UI * to your user. Do not save AccountSessions to your database as they expire relatively * quickly, and cannot be used more than once. * - * Related guide: [Connect Elements](https://stripe.com/docs/connect/get-started-connect-elements). + * Related guide: [Connect Embedded UIs](https://stripe.com/docs/connect/get-started-connect-elements). */ interface AccountSession { /** @@ -27,7 +27,7 @@ declare module 'stripe' { * * The client secret can be used to provide access to `account` from your frontend. It should not be stored, logged, or exposed to anyone other than the connected account. Make sure that you have TLS enabled on any page that includes the client secret. * - * Refer to our docs to [setup Connect Elements](https://stripe.com/docs/connect/get-started-connect-elements) and learn about how `client_secret` should be handled. + * Refer to our docs to [setup Connect Embedded UIs](https://stripe.com/docs/connect/get-started-connect-elements) and learn about how `client_secret` should be handled. */ client_secret: string; diff --git a/types/2022-08-01/Capital/FinancingOffers.d.ts b/types/2022-08-01/Capital/FinancingOffers.d.ts new file mode 100644 index 0000000000..2d39f82ec0 --- /dev/null +++ b/types/2022-08-01/Capital/FinancingOffers.d.ts @@ -0,0 +1,259 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace Capital { + /** + * This is an object representing an offer of financing from + * Stripe Capital to a Connect subaccount. + */ + interface FinancingOffer { + /** + * A unique identifier for the financing object. + */ + id: string; + + /** + * The object type: financing_offer. + */ + object: 'capital.financing_offer'; + + /** + * This is an object representing the terms of an offer of financing from + * Stripe Capital to a Connected account. This resource represents + * the terms accepted by the Connected account, which may differ from those + * offered. + */ + accepted_terms?: FinancingOffer.AcceptedTerms; + + /** + * The ID of the merchant associated with this financing object. + */ + account: string; + + /** + * Time at which the offer was created. Given in seconds since unix epoch. + */ + created: number; + + /** + * Time at which the offer expires. Given in seconds since unix epoch. + */ + expires_after: number; + + /** + * The type of financing being offered. + */ + financing_type?: FinancingOffer.FinancingType; + + /** + * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + */ + livemode: boolean; + + /** + * Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + */ + metadata?: Stripe.Metadata; + + /** + * This is an object representing the terms of an offer of financing from + * Stripe Capital to a Connected account. This resource represents + * both the terms offered to the Connected account. + */ + offered_terms?: FinancingOffer.OfferedTerms; + + /** + * Financing product identifier. + */ + product_type?: FinancingOffer.ProductType; + + /** + * The current status of the offer. + */ + status: FinancingOffer.Status; + + /** + * See [financing_type](https://stripe.com/docs/api/capital/connect_financing_object#financing_offer_object-financing_type). + */ + type?: FinancingOffer.Type; + } + + namespace FinancingOffer { + interface AcceptedTerms { + /** + * Amount of financing offered, in minor units. + */ + advance_amount: number; + + /** + * Currency that the financing offer is transacted in. For example, `usd`. + */ + currency: string; + + /** + * Fixed fee amount, in minor units. + */ + fee_amount: number; + + /** + * Populated when the `product_type` of the `financingoffer` is `refill`. + * Represents the discount amount on remaining premium for the existing loan at payout time. + */ + previous_financing_fee_discount_amount: number | null; + + /** + * Per-transaction rate at which Stripe will withhold funds to repay the financing. + */ + withhold_rate: number; + } + + type FinancingType = 'cash_advance' | 'flex_loan'; + + interface OfferedTerms { + /** + * Amount of financing offered, in minor units. + */ + advance_amount: number; + + /** + * Describes the type of user the offer is being extended to. + */ + campaign_type: OfferedTerms.CampaignType; + + /** + * Currency that the financing offer is transacted in. For example, `usd`. + */ + currency: string; + + /** + * Fixed fee amount, in minor units. + */ + fee_amount: number; + + /** + * Populated when the `product_type` of the `financingoffer` is `refill`. + * Represents the discount rate percentage on remaining premium on the existing loan. When the `financing_offer` + * is paid out, the `previous_financing_fee_discount_amount` will be computed as the multiple of this rate + * and the remaining premium. + */ + previous_financing_fee_discount_rate: number | null; + + /** + * Per-transaction rate at which Stripe will withhold funds to repay the financing. + */ + withhold_rate: number; + } + + namespace OfferedTerms { + type CampaignType = + | 'newly_eligible_user' + | 'previously_eligible_user' + | 'repeat_user'; + } + + type ProductType = 'refill' | 'standard'; + + type Status = + | 'accepted' + | 'canceled' + | 'completed' + | 'delivered' + | 'expired' + | 'fully_repaid' + | 'paid_out' + | 'rejected' + | 'undelivered'; + + type Type = 'cash_advance' | 'flex_loan'; + } + + interface FinancingOfferRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface FinancingOfferListParams extends PaginationParams { + /** + * limit list to offers belonging to given connected account + */ + connected_account?: string; + + created?: Stripe.RangeQueryParam | number; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * limit list to offers with given status + */ + status?: FinancingOfferListParams.Status; + } + + namespace FinancingOfferListParams { + type Status = + | 'accepted' + | 'canceled' + | 'completed' + | 'delivered' + | 'expired' + | 'fully_repaid' + | 'paid_out' + | 'rejected' + | 'undelivered'; + } + + interface FinancingOfferMarkDeliveredParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + class FinancingOffersResource { + /** + * Get the details of the financing offer + */ + retrieve( + id: string, + params?: FinancingOfferRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Retrieves the financing offers available for Connected accounts that belong to your platform. + */ + list( + params?: FinancingOfferListParams, + options?: RequestOptions + ): ApiListPromise; + list( + options?: RequestOptions + ): ApiListPromise; + + /** + * Acknowledges that platform has received and delivered the financing_offer to + * the intended merchant recipient. This is required to make the application + * accessible. + */ + markDelivered( + id: string, + params?: FinancingOfferMarkDeliveredParams, + options?: RequestOptions + ): Promise>; + markDelivered( + id: string, + options?: RequestOptions + ): Promise>; + } + } + } +} diff --git a/types/2022-08-01/Capital/FinancingSummaries.d.ts b/types/2022-08-01/Capital/FinancingSummaries.d.ts new file mode 100644 index 0000000000..1a49c76267 --- /dev/null +++ b/types/2022-08-01/Capital/FinancingSummaries.d.ts @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace Capital { + interface FinancingSummaryRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + class FinancingSummariesResource { + /** + * Retrieve the financing state for the account that was authenticated in the request. + */ + retrieve( + params?: FinancingSummaryRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + options?: RequestOptions + ): Promise>; + } + } + } +} diff --git a/types/2022-08-01/Capital/FinancingTransactions.d.ts b/types/2022-08-01/Capital/FinancingTransactions.d.ts new file mode 100644 index 0000000000..94ab723cd7 --- /dev/null +++ b/types/2022-08-01/Capital/FinancingTransactions.d.ts @@ -0,0 +1,175 @@ +// File generated from our OpenAPI spec + +declare module 'stripe' { + namespace Stripe { + namespace Capital { + /** + * This is an object representing the details of a transaction on a Capital financing object. + */ + interface FinancingTransaction { + /** + * A unique identifier for the financing transaction object. + */ + id: string; + + /** + * The object type: financing_transaction + */ + object: 'capital.financing_transaction'; + + /** + * The ID of the merchant associated with this financing transaction. + */ + account: string; + + /** + * Time at which the financing transaction was created. Given in seconds since unix epoch. + */ + created_at: number; + + /** + * This is an object representing a transaction on a Capital financing offer. + */ + details: FinancingTransaction.Details; + + /** + * The Capital financing offer for this financing transaction. + */ + financing_offer: string | null; + + /** + * The Capital transaction object that predates the Financing Transactions API and + * corresponds with the balance transaction that was created as a result of this + * financing transaction. + */ + legacy_balance_transaction_source?: string; + + /** + * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + */ + livemode: boolean; + + /** + * The type of the financing transaction. + */ + type: FinancingTransaction.Type; + + /** + * A human-friendly description of the financing transaction. + */ + user_facing_description: string | null; + } + + namespace FinancingTransaction { + interface Details { + /** + * The advance amount being repaid, paid out, or reversed in minor units. + */ + advance_amount: number; + + /** + * The currency of the financing transaction. + */ + currency: string; + + /** + * The fee amount being repaid, paid out, or reversed in minor units. + */ + fee_amount: number; + + /** + * The linked payment for the transaction. This field only applies to + * financing transactions of type `paydown` and reason `automatic_withholding`. + */ + linked_payment?: string; + + /** + * The reason for the financing transaction (if applicable). + */ + reason?: Details.Reason; + + /** + * The reversed transaction. This field only applies to financing + * transactions of type `reversal`. + */ + reversed_transaction?: string; + + /** + * The advance and fee amount being repaid, paid out, or reversed in minor units. + */ + total_amount: number; + } + + namespace Details { + type Reason = + | 'automatic_withholding' + | 'automatic_withholding_refund' + | 'collection' + | 'collection_failure' + | 'financing_cancellation' + | 'refill' + | 'requested_by_user' + | 'user_initiated'; + } + + type Type = 'payment' | 'payout' | 'reversal'; + } + + interface FinancingTransactionRetrieveParams { + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + } + + interface FinancingTransactionListParams extends PaginationParams { + /** + * For transactions of type `paydown` and reason `automatic_withholding` only, only returns transactions that were created as a result of this charge. + */ + charge?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array; + + /** + * Returns transactions that were created that apply to this financing offer ID. + */ + financing_offer?: string; + + /** + * Only returns transactions that are responsible for reversing this financing transaction ID. + */ + reversed_transaction?: string; + } + + class FinancingTransactionsResource { + /** + * Retrieves a financing transaction for a financing offer. + */ + retrieve( + id: string, + params?: FinancingTransactionRetrieveParams, + options?: RequestOptions + ): Promise>; + retrieve( + id: string, + options?: RequestOptions + ): Promise>; + + /** + * Returns a list of financing transactions. The transactions are returned in sorted order, + * with the most recent transactions appearing first. + */ + list( + params?: FinancingTransactionListParams, + options?: RequestOptions + ): ApiListPromise; + list( + options?: RequestOptions + ): ApiListPromise; + } + } + } +} diff --git a/types/2022-08-01/Checkout/Sessions.d.ts b/types/2022-08-01/Checkout/Sessions.d.ts index 52436937c5..209738306c 100644 --- a/types/2022-08-01/Checkout/Sessions.d.ts +++ b/types/2022-08-01/Checkout/Sessions.d.ts @@ -2155,6 +2155,11 @@ declare module 'stripe' { */ paynow?: PaymentMethodOptions.Paynow; + /** + * contains details about the PayPal payment method options. + */ + paypal?: PaymentMethodOptions.Paypal; + /** * contains details about the Pix payment method options. */ @@ -2577,6 +2582,10 @@ declare module 'stripe' { tos_shown_and_accepted?: boolean; } + interface Paypal { + currency: string; + } + interface Pix { /** * The number of seconds (between 10 and 1209600) after which Pix payment will expire. Defaults to 86400 seconds. @@ -2700,6 +2709,7 @@ declare module 'stripe' { | 'oxxo' | 'p24' | 'paynow' + | 'paypal' | 'pix' | 'promptpay' | 'sepa_debit' diff --git a/types/2022-08-01/Customers.d.ts b/types/2022-08-01/Customers.d.ts index 1e2bb4513a..18e3425157 100644 --- a/types/2022-08-01/Customers.d.ts +++ b/types/2022-08-01/Customers.d.ts @@ -884,6 +884,7 @@ declare module 'stripe' { | 'oxxo' | 'p24' | 'paynow' + | 'paypal' | 'pix' | 'promptpay' | 'sepa_debit' diff --git a/types/2022-08-01/GiftCards/Cards.d.ts b/types/2022-08-01/GiftCards/Cards.d.ts index dd11c8a8db..91a9707900 100644 --- a/types/2022-08-01/GiftCards/Cards.d.ts +++ b/types/2022-08-01/GiftCards/Cards.d.ts @@ -214,7 +214,7 @@ declare module 'stripe' { /** * The pin associated with the gift card. Not all gift cards have pins. */ - pin?: string; + giftcard_pin?: string; } class CardsResource { diff --git a/types/2022-08-01/Issuing/Cards.d.ts b/types/2022-08-01/Issuing/Cards.d.ts index e529653a19..866c20f5a9 100644 --- a/types/2022-08-01/Issuing/Cards.d.ts +++ b/types/2022-08-01/Issuing/Cards.d.ts @@ -155,6 +155,11 @@ declare module 'stripe' { */ phone_number: string | null; + /** + * Whether a signature is required for card delivery. This feature is only supported for US users. Standard shipping service does not support signature on delivery. The default value for standard shipping service is false and for express and priority services is true. + */ + require_signature: boolean | null; + /** * Shipment service, such as `standard` or `express`. */ @@ -1259,6 +1264,11 @@ declare module 'stripe' { */ phone_number?: string; + /** + * Whether a signature is required for card delivery. + */ + require_signature?: boolean; + /** * Shipment service. */ diff --git a/types/2022-08-01/Orders.d.ts b/types/2022-08-01/Orders.d.ts index a43d9a3e56..40252e19e3 100644 --- a/types/2022-08-01/Orders.d.ts +++ b/types/2022-08-01/Orders.d.ts @@ -695,6 +695,7 @@ declare module 'stripe' { | 'link' | 'oxxo' | 'p24' + | 'paypal' | 'sepa_debit' | 'sofort' | 'wechat_pay'; @@ -1348,6 +1349,11 @@ declare module 'stripe' { */ p24?: PaymentMethodOptions.P24; + /** + * If paying by `paypal`, this sub-hash contains details about the PayPal payment method options to pass to the order's PaymentIntent. + */ + paypal?: PaymentMethodOptions.Paypal; + /** * If paying by `sepa_debit`, this sub-hash contains details about the SEPA Debit payment method options to pass to the order's PaymentIntent. */ @@ -1746,6 +1752,37 @@ declare module 'stripe' { tos_shown_and_accepted?: boolean; } + interface Paypal { + capture_method?: Stripe.Emptyable<'manual'>; + + preferred_locale?: Paypal.PreferredLocale; + } + + namespace Paypal { + type PreferredLocale = + | 'cs_CZ' + | 'da_DK' + | 'de_AT' + | 'de_DE' + | 'de_LU' + | 'el_GR' + | 'en_GB' + | 'en_US' + | 'es_ES' + | 'fi_FI' + | 'fr_BE' + | 'fr_FR' + | 'fr_LU' + | 'hu_HU' + | 'it_IT' + | 'nl_BE' + | 'nl_NL' + | 'pl_PL' + | 'pt_PT' + | 'sk_SK' + | 'sv_SE'; + } + interface SepaDebit { /** * Additional fields for Mandate creation @@ -1847,6 +1884,7 @@ declare module 'stripe' { | 'link' | 'oxxo' | 'p24' + | 'paypal' | 'sepa_debit' | 'sofort' | 'wechat_pay'; @@ -2527,6 +2565,11 @@ declare module 'stripe' { */ p24?: Stripe.Emptyable; + /** + * If paying by `paypal`, this sub-hash contains details about the PayPal payment method options to pass to the order's PaymentIntent. + */ + paypal?: Stripe.Emptyable; + /** * If paying by `sepa_debit`, this sub-hash contains details about the SEPA Debit payment method options to pass to the order's PaymentIntent. */ @@ -2925,6 +2968,37 @@ declare module 'stripe' { tos_shown_and_accepted?: boolean; } + interface Paypal { + capture_method?: Stripe.Emptyable<'manual'>; + + preferred_locale?: Paypal.PreferredLocale; + } + + namespace Paypal { + type PreferredLocale = + | 'cs_CZ' + | 'da_DK' + | 'de_AT' + | 'de_DE' + | 'de_LU' + | 'el_GR' + | 'en_GB' + | 'en_US' + | 'es_ES' + | 'fi_FI' + | 'fr_BE' + | 'fr_FR' + | 'fr_LU' + | 'hu_HU' + | 'it_IT' + | 'nl_BE' + | 'nl_NL' + | 'pl_PL' + | 'pt_PT' + | 'sk_SK' + | 'sv_SE'; + } + interface SepaDebit { /** * Additional fields for Mandate creation @@ -3026,6 +3100,7 @@ declare module 'stripe' { | 'link' | 'oxxo' | 'p24' + | 'paypal' | 'sepa_debit' | 'sofort' | 'wechat_pay'; diff --git a/types/2022-08-01/PaymentIntents.d.ts b/types/2022-08-01/PaymentIntents.d.ts index 9ff3ec8a55..b4145f0868 100644 --- a/types/2022-08-01/PaymentIntents.d.ts +++ b/types/2022-08-01/PaymentIntents.d.ts @@ -956,6 +956,8 @@ declare module 'stripe' { paynow?: PaymentMethodOptions.Paynow; + paypal?: PaymentMethodOptions.Paypal; + pix?: PaymentMethodOptions.Pix; promptpay?: PaymentMethodOptions.Promptpay; @@ -1573,6 +1575,18 @@ declare module 'stripe' { setup_future_usage?: 'none'; } + interface Paypal { + /** + * Controls when the funds will be captured from the customer's account. + */ + capture_method?: 'manual'; + + /** + * Preferred locale of the PayPal checkout page that the customer is redirected to. + */ + preferred_locale: string | null; + } + interface Pix { /** * The number of seconds (between 10 and 1209600) after which Pix payment will expire. @@ -2146,6 +2160,11 @@ declare module 'stripe' { */ paynow?: PaymentMethodData.Paynow; + /** + * If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. + */ + paypal?: PaymentMethodData.Paypal; + /** * If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. */ @@ -2448,6 +2467,8 @@ declare module 'stripe' { interface Paynow {} + interface Paypal {} + interface Pix {} interface Promptpay {} @@ -2499,6 +2520,7 @@ declare module 'stripe' { | 'oxxo' | 'p24' | 'paynow' + | 'paypal' | 'pix' | 'promptpay' | 'sepa_debit' @@ -2667,6 +2689,11 @@ declare module 'stripe' { */ paynow?: Stripe.Emptyable; + /** + * If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. + */ + paypal?: Stripe.Emptyable; + /** * If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options. */ @@ -3414,6 +3441,37 @@ declare module 'stripe' { setup_future_usage?: 'none'; } + interface Paypal { + capture_method?: Stripe.Emptyable<'manual'>; + + preferred_locale?: Paypal.PreferredLocale; + } + + namespace Paypal { + type PreferredLocale = + | 'cs_CZ' + | 'da_DK' + | 'de_AT' + | 'de_DE' + | 'de_LU' + | 'el_GR' + | 'en_GB' + | 'en_US' + | 'es_ES' + | 'fi_FI' + | 'fr_BE' + | 'fr_FR' + | 'fr_LU' + | 'hu_HU' + | 'it_IT' + | 'nl_BE' + | 'nl_NL' + | 'pl_PL' + | 'pt_PT' + | 'sk_SK' + | 'sv_SE'; + } + interface Pix { /** * The number of seconds (between 10 and 1209600) after which Pix payment will expire. Defaults to 86400 seconds. @@ -3934,6 +3992,11 @@ declare module 'stripe' { */ paynow?: PaymentMethodData.Paynow; + /** + * If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. + */ + paypal?: PaymentMethodData.Paypal; + /** * If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. */ @@ -4236,6 +4299,8 @@ declare module 'stripe' { interface Paynow {} + interface Paypal {} + interface Pix {} interface Promptpay {} @@ -4287,6 +4352,7 @@ declare module 'stripe' { | 'oxxo' | 'p24' | 'paynow' + | 'paypal' | 'pix' | 'promptpay' | 'sepa_debit' @@ -4455,6 +4521,11 @@ declare module 'stripe' { */ paynow?: Stripe.Emptyable; + /** + * If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. + */ + paypal?: Stripe.Emptyable; + /** * If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options. */ @@ -5202,6 +5273,37 @@ declare module 'stripe' { setup_future_usage?: 'none'; } + interface Paypal { + capture_method?: Stripe.Emptyable<'manual'>; + + preferred_locale?: Paypal.PreferredLocale; + } + + namespace Paypal { + type PreferredLocale = + | 'cs_CZ' + | 'da_DK' + | 'de_AT' + | 'de_DE' + | 'de_LU' + | 'el_GR' + | 'en_GB' + | 'en_US' + | 'es_ES' + | 'fi_FI' + | 'fr_BE' + | 'fr_FR' + | 'fr_LU' + | 'hu_HU' + | 'it_IT' + | 'nl_BE' + | 'nl_NL' + | 'pl_PL' + | 'pt_PT' + | 'sk_SK' + | 'sv_SE'; + } + interface Pix { /** * The number of seconds (between 10 and 1209600) after which Pix payment will expire. Defaults to 86400 seconds. @@ -5820,6 +5922,11 @@ declare module 'stripe' { */ paynow?: PaymentMethodData.Paynow; + /** + * If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. + */ + paypal?: PaymentMethodData.Paypal; + /** * If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. */ @@ -6122,6 +6229,8 @@ declare module 'stripe' { interface Paynow {} + interface Paypal {} + interface Pix {} interface Promptpay {} @@ -6173,6 +6282,7 @@ declare module 'stripe' { | 'oxxo' | 'p24' | 'paynow' + | 'paypal' | 'pix' | 'promptpay' | 'sepa_debit' @@ -6341,6 +6451,11 @@ declare module 'stripe' { */ paynow?: Stripe.Emptyable; + /** + * If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. + */ + paypal?: Stripe.Emptyable; + /** * If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options. */ @@ -7088,6 +7203,37 @@ declare module 'stripe' { setup_future_usage?: 'none'; } + interface Paypal { + capture_method?: Stripe.Emptyable<'manual'>; + + preferred_locale?: Paypal.PreferredLocale; + } + + namespace Paypal { + type PreferredLocale = + | 'cs_CZ' + | 'da_DK' + | 'de_AT' + | 'de_DE' + | 'de_LU' + | 'el_GR' + | 'en_GB' + | 'en_US' + | 'es_ES' + | 'fi_FI' + | 'fr_BE' + | 'fr_FR' + | 'fr_LU' + | 'hu_HU' + | 'it_IT' + | 'nl_BE' + | 'nl_NL' + | 'pl_PL' + | 'pt_PT' + | 'sk_SK' + | 'sv_SE'; + } + interface Pix { /** * The number of seconds (between 10 and 1209600) after which Pix payment will expire. Defaults to 86400 seconds. diff --git a/types/2022-08-01/PaymentLinks.d.ts b/types/2022-08-01/PaymentLinks.d.ts index b3fa8238e6..36c4cbd51d 100644 --- a/types/2022-08-01/PaymentLinks.d.ts +++ b/types/2022-08-01/PaymentLinks.d.ts @@ -233,6 +233,7 @@ declare module 'stripe' { | 'oxxo' | 'p24' | 'paynow' + | 'paypal' | 'pix' | 'promptpay' | 'sepa_debit' @@ -818,6 +819,7 @@ declare module 'stripe' { | 'oxxo' | 'p24' | 'paynow' + | 'paypal' | 'pix' | 'promptpay' | 'sepa_debit' @@ -1307,6 +1309,7 @@ declare module 'stripe' { | 'oxxo' | 'p24' | 'paynow' + | 'paypal' | 'pix' | 'promptpay' | 'sepa_debit' diff --git a/types/2022-08-01/PaymentMethods.d.ts b/types/2022-08-01/PaymentMethods.d.ts index f676037bbb..7372905c5a 100644 --- a/types/2022-08-01/PaymentMethods.d.ts +++ b/types/2022-08-01/PaymentMethods.d.ts @@ -90,6 +90,8 @@ declare module 'stripe' { paynow?: PaymentMethod.Paynow; + paypal?: PaymentMethod.Paypal; + pix?: PaymentMethod.Pix; promptpay?: PaymentMethod.Promptpay; @@ -624,6 +626,8 @@ declare module 'stripe' { interface Paynow {} + interface Paypal {} + interface Pix {} interface Promptpay {} @@ -713,6 +717,7 @@ declare module 'stripe' { | 'oxxo' | 'p24' | 'paynow' + | 'paypal' | 'pix' | 'promptpay' | 'sepa_debit' @@ -928,6 +933,11 @@ declare module 'stripe' { */ paynow?: PaymentMethodCreateParams.Paynow; + /** + * If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. + */ + paypal?: PaymentMethodCreateParams.Paypal; + /** * If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. */ @@ -1256,6 +1266,8 @@ declare module 'stripe' { interface Paynow {} + interface Paypal {} + interface Pix {} interface Promptpay {} @@ -1308,6 +1320,7 @@ declare module 'stripe' { | 'oxxo' | 'p24' | 'paynow' + | 'paypal' | 'pix' | 'promptpay' | 'sepa_debit' @@ -1523,6 +1536,7 @@ declare module 'stripe' { | 'oxxo' | 'p24' | 'paynow' + | 'paypal' | 'pix' | 'promptpay' | 'sepa_debit' diff --git a/types/2022-08-01/Quotes.d.ts b/types/2022-08-01/Quotes.d.ts index 6d7f8bb2a3..d885e25451 100644 --- a/types/2022-08-01/Quotes.d.ts +++ b/types/2022-08-01/Quotes.d.ts @@ -428,6 +428,11 @@ declare module 'stripe' { */ billing_cycle_anchor?: 'reset' | null; + /** + * The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription. + */ + description: string | null; + /** * When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. This date is ignored if it is in the past when the quote is accepted. Measured in seconds since the Unix epoch. */ @@ -991,6 +996,11 @@ declare module 'stripe' { */ billing_cycle_anchor?: Stripe.Emptyable<'reset'>; + /** + * The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription. + */ + description?: string; + /** * When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. When updating a subscription, the date of which the subscription will be updated using a subscription schedule. The special value `current_period_end` can be provided to update a subscription at the end of its current period. The `effective_date` is ignored if it is in the past when the quote is accepted. */ @@ -1489,6 +1499,11 @@ declare module 'stripe' { */ billing_cycle_anchor?: Stripe.Emptyable<'reset'>; + /** + * The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription. + */ + description?: string; + /** * When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. When updating a subscription, the date of which the subscription will be updated using a subscription schedule. The special value `current_period_end` can be provided to update a subscription at the end of its current period. The `effective_date` is ignored if it is in the past when the quote is accepted. */ diff --git a/types/2022-08-01/SetupIntents.d.ts b/types/2022-08-01/SetupIntents.d.ts index 6f1b9cd4c2..c2e2871669 100644 --- a/types/2022-08-01/SetupIntents.d.ts +++ b/types/2022-08-01/SetupIntents.d.ts @@ -847,6 +847,11 @@ declare module 'stripe' { */ paynow?: PaymentMethodData.Paynow; + /** + * If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. + */ + paypal?: PaymentMethodData.Paypal; + /** * If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. */ @@ -1149,6 +1154,8 @@ declare module 'stripe' { interface Paynow {} + interface Paypal {} + interface Pix {} interface Promptpay {} @@ -1200,6 +1207,7 @@ declare module 'stripe' { | 'oxxo' | 'p24' | 'paynow' + | 'paypal' | 'pix' | 'promptpay' | 'sepa_debit' @@ -1722,6 +1730,11 @@ declare module 'stripe' { */ paynow?: PaymentMethodData.Paynow; + /** + * If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. + */ + paypal?: PaymentMethodData.Paypal; + /** * If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. */ @@ -2024,6 +2037,8 @@ declare module 'stripe' { interface Paynow {} + interface Paypal {} + interface Pix {} interface Promptpay {} @@ -2075,6 +2090,7 @@ declare module 'stripe' { | 'oxxo' | 'p24' | 'paynow' + | 'paypal' | 'pix' | 'promptpay' | 'sepa_debit' @@ -2679,6 +2695,11 @@ declare module 'stripe' { */ paynow?: PaymentMethodData.Paynow; + /** + * If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. + */ + paypal?: PaymentMethodData.Paypal; + /** * If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. */ @@ -2981,6 +3002,8 @@ declare module 'stripe' { interface Paynow {} + interface Paypal {} + interface Pix {} interface Promptpay {} @@ -3032,6 +3055,7 @@ declare module 'stripe' { | 'oxxo' | 'p24' | 'paynow' + | 'paypal' | 'pix' | 'promptpay' | 'sepa_debit' diff --git a/types/2022-08-01/SubscriptionSchedules.d.ts b/types/2022-08-01/SubscriptionSchedules.d.ts index 2fd8fa9158..ede3c44d2d 100644 --- a/types/2022-08-01/SubscriptionSchedules.d.ts +++ b/types/2022-08-01/SubscriptionSchedules.d.ts @@ -153,6 +153,11 @@ declare module 'stripe' { */ default_payment_method: string | Stripe.PaymentMethod | null; + /** + * Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription. + */ + description: string | null; + /** * The subscription schedule's default invoice settings. */ @@ -246,7 +251,7 @@ declare module 'stripe' { /** * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). */ - currency?: string; + currency: string; /** * ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. @@ -258,6 +263,11 @@ declare module 'stripe' { */ default_tax_rates?: Array | null; + /** + * Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription. + */ + description: string | null; + /** * The stackable discounts that will be applied to the subscription on this phase. Subscription item discounts are applied before subscription discounts. */ @@ -592,6 +602,11 @@ declare module 'stripe' { */ default_payment_method?: string; + /** + * Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription. + */ + description?: string; + /** * All invoices will be billed using the specified settings. */ @@ -700,6 +715,11 @@ declare module 'stripe' { */ default_tax_rates?: Stripe.Emptyable>; + /** + * Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription. + */ + description?: string; + /** * The coupons to redeem into discounts for the schedule phase. If not specified, inherits the discount from the subscription's customer. Pass an empty string to avoid inheriting any discounts. */ @@ -1115,6 +1135,11 @@ declare module 'stripe' { */ default_payment_method?: string; + /** + * Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription. + */ + description?: string; + /** * All invoices will be billed using the specified settings. */ @@ -1223,6 +1248,11 @@ declare module 'stripe' { */ default_tax_rates?: Stripe.Emptyable>; + /** + * Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription. + */ + description?: string; + /** * The coupons to redeem into discounts for the schedule phase. If not specified, inherits the discount from the subscription's customer. Pass an empty string to avoid inheriting any discounts. */ @@ -1786,7 +1816,7 @@ declare module 'stripe' { interface ItemAction { /** - * Details of the subscription item to add. The `price` must be unique across all items. + * Details of the subscription item to add. If an item with the same `price` exists, it will be replaced by this new item. Otherwise, it adds the new item. */ add?: ItemAction.Add; diff --git a/types/2022-08-01/WebhookEndpoints.d.ts b/types/2022-08-01/WebhookEndpoints.d.ts index 17d2b739e1..0e61723582 100644 --- a/types/2022-08-01/WebhookEndpoints.d.ts +++ b/types/2022-08-01/WebhookEndpoints.d.ts @@ -248,6 +248,7 @@ declare module 'stripe' { | 'billing_portal.configuration.updated' | 'billing_portal.session.created' | 'capability.updated' + | 'capital.financing_transaction.created' | 'cash_balance.funds_available' | 'charge.captured' | 'charge.dispute.closed' @@ -509,6 +510,7 @@ declare module 'stripe' { | 'billing_portal.configuration.updated' | 'billing_portal.session.created' | 'capability.updated' + | 'capital.financing_transaction.created' | 'cash_balance.funds_available' | 'charge.captured' | 'charge.dispute.closed' diff --git a/types/2022-08-01/index.d.ts b/types/2022-08-01/index.d.ts index 78973de27a..d4586b94d4 100644 --- a/types/2022-08-01/index.d.ts +++ b/types/2022-08-01/index.d.ts @@ -20,6 +20,9 @@ /// /// /// +/// +/// +/// /// /// /// @@ -208,6 +211,11 @@ declare module 'stripe' { configurations: Stripe.BillingPortal.ConfigurationsResource; sessions: Stripe.BillingPortal.SessionsResource; }; + capital: { + financingOffers: Stripe.Capital.FinancingOffersResource; + financingSummaries: Stripe.Capital.FinancingSummariesResource; + financingTransactions: Stripe.Capital.FinancingTransactionsResource; + }; checkout: { sessions: Stripe.Checkout.SessionsResource; };