diff --git a/types/stripe/index.d.ts b/types/stripe/index.d.ts index d7d198d746..772a4bdb87 100644 --- a/types/stripe/index.d.ts +++ b/types/stripe/index.d.ts @@ -3359,6 +3359,15 @@ declare namespace Stripe { source?: string; } + interface IPaymentIntentRetrieveOptions { + /** + * The client secret of the PaymentIntent. Required if a publishable key is used to retrieve the source. + * + * REQUIRED IF USING PUBLISHABLE KEY! + */ + client_secret: string; + } + interface IPaymentIntentCaptureOptions { /** * The amount to capture (in cents) from the PaymentIntent, which must be less than or equal to the original amount. Any additional amount will be automatically refunded. Defaults to the full `amount_capturable` if not provided. @@ -7276,6 +7285,17 @@ declare namespace Stripe { * Client-side retrieval using a publishable key is allowed when the client_secret is provided in the query string. * When retrieved with a publishable key, only a subset of properties will be returned. Please refer to the payment intent object reference for more details. */ + retrieve( + id: string, + data: paymentIntents.IPaymentIntentRetrieveOptions, + options: HeaderOptions, + response?: IResponseFn, + ): Promise; + retrieve( + id: string, + data: paymentIntents.IPaymentIntentRetrieveOptions, + response?: IResponseFn, + ): Promise; retrieve( id: string, options: HeaderOptions, @@ -7304,6 +7324,15 @@ declare namespace Stripe { data: paymentIntents.IPaymentIntentConfirmOptions, response?: IResponseFn, ): Promise; + confirm( + paymentIntentId: string, + options: HeaderOptions, + response?: IResponseFn, + ): Promise; + confirm( + paymentIntentId: string, + response?: IResponseFn, + ): Promise; /** * Capture the funds of an existing uncaptured PaymentIntent where `required_action="requires_capture"`. @@ -7322,6 +7351,15 @@ declare namespace Stripe { data: paymentIntents.IPaymentIntentCaptureOptions, response?: IResponseFn, ): Promise; + capture( + paymentIntentId: string, + options: HeaderOptions, + response?: IResponseFn, + ): Promise; + capture( + paymentIntentId: string, + response?: IResponseFn, + ): Promise; /** * A PaymentIntent object can be canceled when it is in one of these statuses: `requires_payment_method`, `requires_capture`, `requires_confirmation`, `requires_action`. @@ -7337,6 +7375,11 @@ declare namespace Stripe { options: HeaderOptions, response?: IResponseFn, ): Promise; + cancel( + paymentIntentId: string, + options: HeaderOptions, + response?: IResponseFn, + ): Promise; cancel( paymentIntentId: string, data: { @@ -7344,6 +7387,10 @@ declare namespace Stripe { }, response?: IResponseFn, ): Promise; + cancel( + paymentIntentId: string, + response?: IResponseFn, + ): Promise; } class Payouts extends StripeResource { diff --git a/types/stripe/stripe-tests.ts b/types/stripe/stripe-tests.ts index 6fc4a5ac25..bffadadb23 100644 --- a/types/stripe/stripe-tests.ts +++ b/types/stripe/stripe-tests.ts @@ -1057,6 +1057,8 @@ stripe.paymentIntents.confirm("pi_Aabcxyz01aDfoo", {}).then((intent) => {}); stripe.paymentIntents.capture("pi_Aabcxyz01aDfoo", {}, (err, intent) => {}); stripe.paymentIntents.capture("pi_Aabcxyz01aDfoo", {}).then((intent) => {}); +stripe.paymentIntents.cancel("pi_Aabcxyz01aDfoo", (err, intent) => {}); +stripe.paymentIntents.cancel("pi_Aabcxyz01aDfoo").then((intent) => {}); stripe.paymentIntents.cancel("pi_Aabcxyz01aDfoo", {}, (err, intent) => {}); stripe.paymentIntents.cancel("pi_Aabcxyz01aDfoo", {}).then((intent) => {}); stripe.paymentIntents.cancel("pi_Aabcxyz01aDfoo", { cancellation_reason: 'duplicate' }, (err, intent) => {});