diff --git a/types/stripe/index.d.ts b/types/stripe/index.d.ts index 93620e5577..6c1b4d842b 100644 --- a/types/stripe/index.d.ts +++ b/types/stripe/index.d.ts @@ -2050,9 +2050,9 @@ declare namespace Stripe { client_reference_id?: string; /** - * ID of customer + * ID of customer [Expandable] */ - customer?: string; + customer?: string | customers.ICustomer; /** * Email address of customer @@ -2075,9 +2075,9 @@ declare namespace Stripe { locale?: string; /** - * ID of payment intent created + * ID of payment intent created [Expandable] */ - payment_intent?: string; + payment_intent?: string | paymentIntents.IPaymentIntent; /** * Array of accepted payment methods @@ -2085,9 +2085,9 @@ declare namespace Stripe { payment_method_types?: string[]; /** - * ID of subscription if one was created + * ID of subscription if one was created [Expandable] */ - subscription?: string; + subscription?: string | subscriptions.ISubscription; /** * URL to redirect to upon success @@ -7802,6 +7802,7 @@ declare namespace Stripe { class Sessions extends StripeResource { create(data: checkouts.sessions.ICheckoutCreationOptions, response?: IResponseFn): Promise; + retrieve(data: string, options: HeaderOptions, response?: IResponseFn): Promise; retrieve(data: string, response?: IResponseFn): Promise; } diff --git a/types/stripe/stripe-tests.ts b/types/stripe/stripe-tests.ts index eae7d9ef6f..5c7b6dd33e 100644 --- a/types/stripe/stripe-tests.ts +++ b/types/stripe/stripe-tests.ts @@ -282,6 +282,13 @@ stripe.checkout.sessions.create({ // asynchronously called }); +stripe.checkout.sessions.retrieve('ch_test_123').then(session => { + session; // $ExpectType ICheckoutSession +}); +stripe.checkout.sessions.retrieve('ch_test_123', { expand: ['payment_intent'] }).then(session => { + session.payment_intent; // $ExpectType string | IPaymentIntent +}); + //#endregion //#region CreditNotes tests