Skip to content

braintree: Replace usages of Any #11679

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions stubs/braintree/braintree/account_updater_daily_report.pyi
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from typing import Any
from _typeshed import Incomplete

from braintree.configuration import Configuration as Configuration
from braintree.resource import Resource as Resource

class AccountUpdaterDailyReport(Resource):
report_url: Any
report_date: Any
report_url: Incomplete
report_date: Incomplete
def __init__(self, gateway, attributes) -> None: ...
6 changes: 3 additions & 3 deletions stubs/braintree/braintree/add_on_gateway.pyi
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from typing import Any
from _typeshed import Incomplete

from braintree.add_on import AddOn as AddOn
from braintree.resource_collection import ResourceCollection as ResourceCollection

class AddOnGateway:
gateway: Any
config: Any
gateway: Incomplete
config: Incomplete
def __init__(self, gateway) -> None: ...
def all(self): ...
5 changes: 2 additions & 3 deletions stubs/braintree/braintree/address_gateway.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from _typeshed import Incomplete
from typing import Any

from braintree.address import Address as Address
from braintree.error_result import ErrorResult as ErrorResult
Expand All @@ -8,8 +7,8 @@ from braintree.resource import Resource as Resource
from braintree.successful_result import SuccessfulResult as SuccessfulResult

class AddressGateway:
gateway: Any
config: Any
gateway: Incomplete
config: Incomplete
def __init__(self, gateway) -> None: ...
def create(self, params: Incomplete | None = None): ...
def delete(self, customer_id, address_id): ...
Expand Down
5 changes: 2 additions & 3 deletions stubs/braintree/braintree/amex_express_checkout_card.pyi
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
from typing import Any

from braintree.resource import Resource as Resource
from braintree.subscription import Subscription

class AmexExpressCheckoutCard(Resource):
subscriptions: Any
subscriptions: list[Subscription]
def __init__(self, gateway, attributes) -> None: ...
@property
def expiration_date(self): ...
7 changes: 4 additions & 3 deletions stubs/braintree/braintree/android_pay_card.pyi
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
from typing import Any
from _typeshed import Incomplete

from braintree.resource import Resource as Resource
from braintree.subscription import Subscription

class AndroidPayCard(Resource):
is_expired: Any
subscriptions: Any
is_expired: Incomplete
subscriptions: list[Subscription]
def __init__(self, gateway, attributes) -> None: ...
@property
def expiration_date(self): ...
Expand Down
7 changes: 4 additions & 3 deletions stubs/braintree/braintree/apple_pay_card.pyi
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
from typing import Any
from _typeshed import Incomplete

from braintree.resource import Resource as Resource
from braintree.subscription import Subscription

class ApplePayCard(Resource):
class CardType:
AmEx: str
MasterCard: str
Visa: str

is_expired: Any
subscriptions: Any
is_expired: Incomplete
subscriptions: list[Subscription]
def __init__(self, gateway, attributes) -> None: ...
@property
def expiration_date(self): ...
Expand Down
6 changes: 3 additions & 3 deletions stubs/braintree/braintree/apple_pay_gateway.pyi
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
from typing import Any
from _typeshed import Incomplete

from braintree.apple_pay_options import ApplePayOptions as ApplePayOptions
from braintree.error_result import ErrorResult as ErrorResult
from braintree.exceptions.unexpected_error import UnexpectedError as UnexpectedError
from braintree.successful_result import SuccessfulResult as SuccessfulResult

class ApplePayGateway:
gateway: Any
config: Any
gateway: Incomplete
config: Incomplete
def __init__(self, gateway) -> None: ...
def register_domain(self, domain): ...
def unregister_domain(self, domain): ...
Expand Down
7 changes: 5 additions & 2 deletions stubs/braintree/braintree/attribute_getter.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
from _typeshed import Incomplete
from typing import Any

class AttributeGetter:
def __init__(self, attributes: Incomplete | None = None) -> None: ...
def __init__(self, attributes: dict[str, Any] | None = None) -> None: ...
# This doesn't exist at runtime, but subclasses should define their own fields populated by attributes in __init__
# Until that's done, keep __getattribute__ to fill in the gaps
def __getattribute__(self, name: str) -> Any: ...
4 changes: 2 additions & 2 deletions stubs/braintree/braintree/authorization_adjustment.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import Any
from decimal import Decimal

from braintree.attribute_getter import AttributeGetter as AttributeGetter

class AuthorizationAdjustment(AttributeGetter):
amount: Any
amount: Decimal | None
def __init__(self, attributes) -> None: ...
61 changes: 32 additions & 29 deletions stubs/braintree/braintree/braintree_gateway.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from _typeshed import Incomplete
from typing import Any

from braintree.add_on_gateway import AddOnGateway as AddOnGateway
from braintree.address_gateway import AddressGateway as AddressGateway
Expand All @@ -12,13 +11,15 @@ from braintree.customer_gateway import CustomerGateway as CustomerGateway
from braintree.discount_gateway import DiscountGateway as DiscountGateway
from braintree.dispute_gateway import DisputeGateway as DisputeGateway
from braintree.document_upload_gateway import DocumentUploadGateway as DocumentUploadGateway
from braintree.exchange_rate_quote_gateway import ExchangeRateQuoteGateway
from braintree.merchant_account_gateway import MerchantAccountGateway as MerchantAccountGateway
from braintree.merchant_gateway import MerchantGateway as MerchantGateway
from braintree.oauth_gateway import OAuthGateway as OAuthGateway
from braintree.payment_method_gateway import PaymentMethodGateway as PaymentMethodGateway
from braintree.payment_method_nonce_gateway import PaymentMethodNonceGateway as PaymentMethodNonceGateway
from braintree.paypal_account_gateway import PayPalAccountGateway as PayPalAccountGateway
from braintree.plan_gateway import PlanGateway as PlanGateway
from braintree.sepa_direct_debit_account_gateway import SepaDirectDebitAccountGateway
from braintree.settlement_batch_summary_gateway import SettlementBatchSummaryGateway as SettlementBatchSummaryGateway
from braintree.subscription_gateway import SubscriptionGateway as SubscriptionGateway
from braintree.testing_gateway import TestingGateway as TestingGateway
Expand All @@ -30,32 +31,34 @@ from braintree.webhook_notification_gateway import WebhookNotificationGateway as
from braintree.webhook_testing_gateway import WebhookTestingGateway as WebhookTestingGateway

class BraintreeGateway:
config: Any
add_on: Any
address: Any
apple_pay: Any
client_token: Any
credit_card: Any
customer: Any
discount: Any
dispute: Any
document_upload: Any
graphql_client: Any
merchant: Any
merchant_account: Any
oauth: Any
payment_method: Any
payment_method_nonce: Any
paypal_account: Any
plan: Any
settlement_batch_summary: Any
subscription: Any
testing: Any
transaction: Any
transaction_line_item: Any
us_bank_account: Any
us_bank_account_verification: Any
verification: Any
webhook_notification: Any
webhook_testing: Any
config: Configuration
add_on: AddOnGateway
address: AddressGateway
apple_pay: ApplePayGateway
client_token: ClientTokenGateway
credit_card: CreditCardGateway
customer: CustomerGateway
discount: DiscountGateway
dispute: DisputeGateway
document_upload: DocumentUploadGateway
exchange_rate_quote: ExchangeRateQuoteGateway
graphql_client: Incomplete
merchant: MerchantGateway
merchant_account: MerchantAccountGateway
oauth: OAuthGateway
payment_method: PaymentMethodGateway
payment_method_nonce: PaymentMethodNonceGateway
paypal_account: PayPalAccountGateway
plan: PlanGateway
sepa_direct_debit_account: SepaDirectDebitAccountGateway
settlement_batch_summary: SettlementBatchSummaryGateway
subscription: SubscriptionGateway
testing: TestingGateway
transaction: TransactionGateway
transaction_line_item: TransactionLineItemGateway
us_bank_account: UsBankAccountGateway
us_bank_account_verification: UsBankAccountVerificationGateway
verification: CreditCardVerificationGateway
webhook_notification: WebhookNotificationGateway
webhook_testing: WebhookTestingGateway
def __init__(self, config: Incomplete | None = None, **kwargs) -> None: ...
5 changes: 2 additions & 3 deletions stubs/braintree/braintree/client_token_gateway.pyi
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
from _typeshed import Incomplete
from typing import Any

from braintree import exceptions as exceptions
from braintree.client_token import ClientToken as ClientToken
from braintree.resource import Resource as Resource

class ClientTokenGateway:
gateway: Any
config: Any
gateway: Incomplete
config: Incomplete
def __init__(self, gateway) -> None: ...
def generate(self, params: Incomplete | None = None): ...
19 changes: 9 additions & 10 deletions stubs/braintree/braintree/configuration.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from _typeshed import Incomplete
from typing import Any

from braintree.credentials_parser import CredentialsParser as CredentialsParser
from braintree.environment import Environment as Environment
Expand All @@ -19,15 +18,15 @@ class Configuration:
def api_version(): ...
@staticmethod
def graphql_api_version(): ...
environment: Any
merchant_id: Any
public_key: Any
private_key: Any
client_id: Any
client_secret: Any
access_token: Any
timeout: Any
wrap_http_exceptions: Any
environment: Incomplete
merchant_id: Incomplete
public_key: Incomplete
private_key: Incomplete
client_id: Incomplete
client_secret: Incomplete
access_token: Incomplete
timeout: Incomplete
wrap_http_exceptions: Incomplete
def __init__(
self,
environment: Incomplete | None = None,
Expand Down
11 changes: 5 additions & 6 deletions stubs/braintree/braintree/credentials_parser.pyi
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
from _typeshed import Incomplete
from typing import Any

from braintree.environment import Environment as Environment
from braintree.exceptions.configuration_error import ConfigurationError as ConfigurationError

class CredentialsParser:
client_id: Any
client_secret: Any
access_token: Any
client_id: Incomplete
client_secret: Incomplete
access_token: Incomplete
def __init__(
self, client_id: Incomplete | None = None, client_secret: Incomplete | None = None, access_token: Incomplete | None = None
) -> None: ...
environment: Any
environment: Incomplete
def parse_client_credentials(self) -> None: ...
merchant_id: Any
merchant_id: Incomplete
def parse_access_token(self) -> None: ...
def get_environment(self, credential): ...
def get_merchant_id(self, credential): ...
28 changes: 14 additions & 14 deletions stubs/braintree/braintree/credit_card.pyi
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from _typeshed import Incomplete
from enum import Enum
from typing import Any

from braintree.address import Address as Address
from braintree.configuration import Configuration as Configuration
from braintree.credit_card_verification import CreditCardVerification as CreditCardVerification
from braintree.resource import Resource as Resource
from braintree.subscription import Subscription

class CreditCard(Resource):
class CardType:
Expand Down Expand Up @@ -45,15 +45,15 @@ class CreditCard(Resource):
Star = "STAR"
Star_Access = "STAR_ACCESS"

Commercial: Any
DurbinRegulated: Any
Debit: Any
Healthcare: Any
CountryOfIssuance: Any
IssuingBank: Any
Payroll: Any
Prepaid: Any
ProductId: Any
Commercial: type[CardTypeIndicator]
DurbinRegulated: type[CardTypeIndicator]
Debit: type[CardTypeIndicator]
Healthcare: type[CardTypeIndicator]
CountryOfIssuance: type[CardTypeIndicator]
IssuingBank: type[CardTypeIndicator]
Payroll: type[CardTypeIndicator]
Prepaid: type[CardTypeIndicator]
ProductId: type[CardTypeIndicator]
@staticmethod
def create(params: Incomplete | None = None): ...
@staticmethod
Expand All @@ -74,10 +74,10 @@ class CreditCard(Resource):
def update_signature(): ...
@staticmethod
def signature(type): ...
is_expired: Any
billing_address: Any
subscriptions: Any
verification: Any
is_expired = expired
billing_address: Address | None
subscriptions: list[Subscription]
verification: CreditCardVerification
def __init__(self, gateway, attributes): ...
@property
def expiration_date(self): ...
Expand Down
5 changes: 2 additions & 3 deletions stubs/braintree/braintree/credit_card_gateway.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from _typeshed import Incomplete
from typing import Any

from braintree.credit_card import CreditCard as CreditCard
from braintree.error_result import ErrorResult as ErrorResult
Expand All @@ -10,8 +9,8 @@ from braintree.resource_collection import ResourceCollection as ResourceCollecti
from braintree.successful_result import SuccessfulResult as SuccessfulResult

class CreditCardGateway:
gateway: Any
config: Any
gateway: Incomplete
config: Incomplete
def __init__(self, gateway) -> None: ...
def create(self, params: Incomplete | None = None): ...
def delete(self, credit_card_token): ...
Expand Down
19 changes: 10 additions & 9 deletions stubs/braintree/braintree/credit_card_verification.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from typing import Any
from _typeshed import Incomplete
from decimal import Decimal

from braintree.attribute_getter import AttributeGetter as AttributeGetter
from braintree.configuration import Configuration as Configuration
Expand All @@ -13,14 +14,14 @@ class CreditCardVerification(AttributeGetter):
ProcessorDeclined: str
Verified: str

amount: Any
currency_iso_code: Any
processor_response_code: Any
processor_response_text: Any
network_response_code: Any
network_response_text: Any
risk_data: Any
three_d_secure_info: Any
amount: Decimal | None
currency_iso_code: Incomplete
processor_response_code: Incomplete
processor_response_text: Incomplete
network_response_code: Incomplete
network_response_text: Incomplete
risk_data: RiskData | None
three_d_secure_info: ThreeDSecureInfo | None
def __init__(self, gateway, attributes) -> None: ...
@staticmethod
def find(verification_id): ...
Expand Down
Loading
Loading