From d48e0a754c1922996d74be999fc6e95acff40aa8 Mon Sep 17 00:00:00 2001 From: Zixuan James Li Date: Fri, 5 Aug 2022 21:46:36 -0400 Subject: [PATCH] Add classmethod to stripe.PaymentIntent.confirm. Similar to #7230, stripe.PaymentIntent.confirm can be called as an instance method or a classmethod. Signed-off-by: Zixuan James Li --- stubs/stripe/@tests/stubtest_allowlist.txt | 5 +++-- stubs/stripe/stripe/api_resources/payment_intent.pyi | 11 ++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/stubs/stripe/@tests/stubtest_allowlist.txt b/stubs/stripe/@tests/stubtest_allowlist.txt index 9ad2bcf74473..e58e34427659 100644 --- a/stubs/stripe/@tests/stubtest_allowlist.txt +++ b/stubs/stripe/@tests/stubtest_allowlist.txt @@ -1,2 +1,3 @@ -# DeletableAPIResource.delete is has a custom classmethod overload -stripe\..*\.delete \ No newline at end of file +# The following methods have custom classmethod decorators +stripe\..*\.delete +stripe\..*PaymentIntent\.confirm diff --git a/stubs/stripe/stripe/api_resources/payment_intent.pyi b/stubs/stripe/stripe/api_resources/payment_intent.pyi index f90e3d4475ae..c644747a07a8 100644 --- a/stubs/stripe/stripe/api_resources/payment_intent.pyi +++ b/stubs/stripe/stripe/api_resources/payment_intent.pyi @@ -1,3 +1,5 @@ +from typing import overload + from stripe.api_resources.abstract import ( CreateableAPIResource as CreateableAPIResource, ListableAPIResource as ListableAPIResource, @@ -9,4 +11,11 @@ class PaymentIntent(CreateableAPIResource, ListableAPIResource, UpdateableAPIRes OBJECT_NAME: str def cancel(self, idempotency_key: str | None = ..., **params): ... def capture(self, idempotency_key: str | None = ..., **params): ... - def confirm(self, idempotency_key: str | None = ..., **params): ... + @overload + @classmethod + def confirm( + cls, intent: str, api_key: str | None = ..., stripe_version: str | None = ..., stripe_account: str | None = ..., **params + ): ... + @overload + @classmethod + def confirm(cls, idempotency_key: str | None = ..., **params): ...