From d6748925aae7eb34de578f623c72995b7f392d71 Mon Sep 17 00:00:00 2001 From: Jonas Keisel Date: Thu, 7 Mar 2019 11:25:14 +0100 Subject: [PATCH 1/2] =?UTF-8?q?added=20missing=20`paymentIntents.cancel(?= =?UTF-8?q?=E2=80=A6)`=20signatures?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/stripe/index.d.ts | 9 +++++++++ types/stripe/stripe-tests.ts | 2 ++ 2 files changed, 11 insertions(+) diff --git a/types/stripe/index.d.ts b/types/stripe/index.d.ts index d7d198d746..d747fc6de9 100644 --- a/types/stripe/index.d.ts +++ b/types/stripe/index.d.ts @@ -7337,6 +7337,11 @@ declare namespace Stripe { options: HeaderOptions, response?: IResponseFn, ): Promise; + cancel( + paymentIntentId: string, + options: HeaderOptions, + response?: IResponseFn, + ): Promise; cancel( paymentIntentId: string, data: { @@ -7344,6 +7349,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) => {}); From b26e09b0deefa5442d085e09daa685382b2d4486 Mon Sep 17 00:00:00 2001 From: Jonas Keisel Date: Thu, 7 Mar 2019 11:38:42 +0100 Subject: [PATCH 2/2] Added missing signatures based on the Java implementation --- types/stripe/index.d.ts | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/types/stripe/index.d.ts b/types/stripe/index.d.ts index d747fc6de9..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`.