Skip to content

Commit f1f9c84

Browse files
committed
Tighhten the return type in braintree.PaymentMethod.find()
The possible return types are listed here: https://developer.paypal.com/braintree/docs/reference/response/payment-method/python/ Annoyingly, these classes don't inherit from PaymentMethod, so need to be listed out.
1 parent 1559678 commit f1f9c84

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

stubs/braintree/braintree/payment_method.pyi

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
11
from _typeshed import Incomplete
2-
2+
from braintree.android_pay_card import AndroidPayCard
3+
from braintree.apple_pay_card import ApplePayCard
4+
from braintree.credit_card import CreditCard
35
from braintree.error_result import ErrorResult
6+
from braintree.paypal_account import PayPalAccount
47
from braintree.resource import Resource
58
from braintree.successful_result import SuccessfulResult
9+
from braintree.us_bank_account import UsBankAccount
10+
from braintree.venmo_account import VenmoAccount
11+
from braintree.visa_checkout_card import VisaCheckoutCard
612

713
class PaymentMethod(Resource):
814
@staticmethod
915
def create(params: dict[str, Incomplete] | None = None) -> SuccessfulResult | ErrorResult: ...
1016
@staticmethod
11-
def find(payment_method_token: str) -> Resource: ...
17+
def find(
18+
payment_method_token: str,
19+
) -> AndroidPayCard | ApplePayCard | CreditCard | PayPalAccount | UsBankAccount | VenmoAccount | VisaCheckoutCard: ...
1220
@staticmethod
1321
def update(payment_method_token: str, params) -> SuccessfulResult | ErrorResult: ...
1422
@staticmethod

0 commit comments

Comments
 (0)