diff --git a/stubs/braintree/METADATA.toml b/stubs/braintree/METADATA.toml index efee48e9e..68b728414 100644 --- a/stubs/braintree/METADATA.toml +++ b/stubs/braintree/METADATA.toml @@ -1,2 +1,2 @@ -version = "4.35.*" +version = "4.36.*" upstream_repository = "https://github.com/braintree/braintree_python" diff --git a/stubs/braintree/braintree/__init__.pyi b/stubs/braintree/braintree/__init__.pyi index 7080ac619..8aa7ae9ed 100644 --- a/stubs/braintree/braintree/__init__.pyi +++ b/stubs/braintree/braintree/__init__.pyi @@ -46,6 +46,7 @@ from braintree.local_payment_reversed import LocalPaymentReversed as LocalPaymen from braintree.merchant import Merchant as Merchant from braintree.merchant_account import MerchantAccount as MerchantAccount from braintree.merchant_account_gateway import MerchantAccountGateway as MerchantAccountGateway +from braintree.monetary_amount import MonetaryAmount as MonetaryAmount from braintree.oauth_access_revocation import OAuthAccessRevocation as OAuthAccessRevocation from braintree.partner_merchant import PartnerMerchant as PartnerMerchant from braintree.payment_facilitator import PaymentFacilitator as PaymentFacilitator diff --git a/stubs/braintree/braintree/credit_card.pyi b/stubs/braintree/braintree/credit_card.pyi index a38d46c58..dd4a30c37 100644 --- a/stubs/braintree/braintree/credit_card.pyi +++ b/stubs/braintree/braintree/credit_card.pyi @@ -59,6 +59,10 @@ class CreditCard(Resource): Prepaid: type[CardTypeIndicator] ProductId: type[CardTypeIndicator] PrepaidReloadable: type[CardTypeIndicator] + Business: type[CardTypeIndicator] + Consumer: type[CardTypeIndicator] + Corporate: type[CardTypeIndicator] + Purchase: type[CardTypeIndicator] @staticmethod def create(params: dict[str, Incomplete] | None = None) -> SuccessfulResult | ErrorResult | None: ... @staticmethod diff --git a/stubs/braintree/braintree/customer_session_gateway.pyi b/stubs/braintree/braintree/customer_session_gateway.pyi index fa0665397..dbcf24f78 100644 --- a/stubs/braintree/braintree/customer_session_gateway.pyi +++ b/stubs/braintree/braintree/customer_session_gateway.pyi @@ -13,5 +13,5 @@ class CustomerSessionGateway: self, update_customer_session_input: UpdateCustomerSessionInput ) -> SuccessfulResult | ErrorResult: ... def get_customer_recommendations( - self, customer_recommendations_input: CustomerRecommendationsInput + self, get_customer_recommendations_input: CustomerRecommendationsInput ) -> SuccessfulResult | ErrorResult: ... diff --git a/stubs/braintree/braintree/graphql/__init__.pyi b/stubs/braintree/braintree/graphql/__init__.pyi index 559f65bf4..7944cc51e 100644 --- a/stubs/braintree/braintree/graphql/__init__.pyi +++ b/stubs/braintree/braintree/graphql/__init__.pyi @@ -3,11 +3,15 @@ from braintree.graphql.inputs import ( CreateCustomerSessionInput as CreateCustomerSessionInput, CustomerRecommendationsInput as CustomerRecommendationsInput, CustomerSessionInput as CustomerSessionInput, + MonetaryAmountInput as MonetaryAmountInput, + PayPalPayeeInput as PayPalPayeeInput, + PayPalPurchaseUnitInput as PayPalPurchaseUnitInput, PhoneInput as PhoneInput, UpdateCustomerSessionInput as UpdateCustomerSessionInput, ) from braintree.graphql.types import ( CustomerRecommendationsPayload as CustomerRecommendationsPayload, PaymentOptions as PaymentOptions, + PaymentRecommendation as PaymentRecommendation, ) from braintree.graphql.unions import CustomerRecommendations as CustomerRecommendations diff --git a/stubs/braintree/braintree/graphql/inputs/__init__.pyi b/stubs/braintree/braintree/graphql/inputs/__init__.pyi index 3c9b74a56..f7baabaa5 100644 --- a/stubs/braintree/braintree/graphql/inputs/__init__.pyi +++ b/stubs/braintree/braintree/graphql/inputs/__init__.pyi @@ -1,5 +1,8 @@ from braintree.graphql.inputs.create_customer_session_input import CreateCustomerSessionInput as CreateCustomerSessionInput from braintree.graphql.inputs.customer_recommendations_input import CustomerRecommendationsInput as CustomerRecommendationsInput from braintree.graphql.inputs.customer_session_input import CustomerSessionInput as CustomerSessionInput +from braintree.graphql.inputs.monetary_amount_input import MonetaryAmountInput as MonetaryAmountInput +from braintree.graphql.inputs.paypal_payee_input import PayPalPayeeInput as PayPalPayeeInput +from braintree.graphql.inputs.paypal_purchase_unit_input import PayPalPurchaseUnitInput as PayPalPurchaseUnitInput from braintree.graphql.inputs.phone_input import PhoneInput as PhoneInput from braintree.graphql.inputs.update_customer_session_input import UpdateCustomerSessionInput as UpdateCustomerSessionInput diff --git a/stubs/braintree/braintree/graphql/inputs/create_customer_session_input.pyi b/stubs/braintree/braintree/graphql/inputs/create_customer_session_input.pyi index 7ab2bdf0e..08789e004 100644 --- a/stubs/braintree/braintree/graphql/inputs/create_customer_session_input.pyi +++ b/stubs/braintree/braintree/graphql/inputs/create_customer_session_input.pyi @@ -1,6 +1,8 @@ from _typeshed import Incomplete +from typing_extensions import Self from braintree.graphql.inputs.customer_session_input import CustomerSessionInput +from braintree.graphql.inputs.paypal_purchase_unit_input import PayPalPurchaseUnitInput class CreateCustomerSessionInput: def __init__( @@ -9,15 +11,17 @@ class CreateCustomerSessionInput: session_id: str | None = None, customer: CustomerSessionInput | None = None, domain: str | None = None, + purchase_units: list[PayPalPurchaseUnitInput] | None = None, ) -> None: ... - def to_graphql_variables(self) -> dict[Incomplete, Incomplete]: ... + def to_graphql_variables(self) -> dict[str, Incomplete]: ... @staticmethod - def builder(): ... + def builder() -> Builder: ... class Builder: def __init__(self) -> None: ... - def merchant_account_id(self, merchant_account_id: str): ... - def session_id(self, session_id: str): ... - def customer(self, customer: str): ... - def domain(self, domain: str): ... - def build(self): ... + def merchant_account_id(self, merchant_account_id: str) -> Self: ... + def session_id(self, session_id: str) -> Self: ... + def customer(self, customer: CustomerSessionInput) -> Self: ... + def purchase_units(self, purchase_units: list[PayPalPurchaseUnitInput]) -> Self: ... + def domain(self, domain: str) -> Self: ... + def build(self) -> CreateCustomerSessionInput: ... diff --git a/stubs/braintree/braintree/graphql/inputs/customer_recommendations_input.pyi b/stubs/braintree/braintree/graphql/inputs/customer_recommendations_input.pyi index ed193fe8b..f90f98aca 100644 --- a/stubs/braintree/braintree/graphql/inputs/customer_recommendations_input.pyi +++ b/stubs/braintree/braintree/graphql/inputs/customer_recommendations_input.pyi @@ -1,22 +1,27 @@ from _typeshed import Incomplete +from typing_extensions import Self -from braintree.graphql.enums.recommendations import Recommendations from braintree.graphql.inputs.customer_session_input import CustomerSessionInput +from braintree.graphql.inputs.paypal_purchase_unit_input import PayPalPurchaseUnitInput class CustomerRecommendationsInput: def __init__( self, session_id: str, - recommendations: list[Recommendations], merchant_account_id: str | None = None, + purchase_units: list[PayPalPurchaseUnitInput] | None = None, + domain: str | None = None, customer: CustomerSessionInput | None = None, ) -> None: ... - def to_graphql_variables(self) -> dict[Incomplete, Incomplete]: ... + def to_graphql_variables(self) -> dict[str, Incomplete]: ... @staticmethod - def builder(session_id: str, recommendations: list[Recommendations]): ... + def builder() -> Builder: ... class Builder: - def __init__(self, session_id: str, recommendations: list[Recommendations]) -> None: ... - def merchant_account_id(self, merchant_account_id: str): ... - def customer(self, customer: CustomerSessionInput): ... - def build(self): ... + def __init__(self) -> None: ... + def session_id(self, session_id: str) -> Self: ... + def merchant_account_id(self, merchant_account_id: str) -> Self: ... + def customer(self, customer: CustomerSessionInput) -> Self: ... + def purchase_units(self, purchase_units: list[PayPalPurchaseUnitInput]) -> Self: ... + def domain(self, domain: str) -> Self: ... + def build(self) -> CustomerRecommendationsInput: ... diff --git a/stubs/braintree/braintree/graphql/inputs/customer_session_input.pyi b/stubs/braintree/braintree/graphql/inputs/customer_session_input.pyi index bf92de8f0..9a0b948f1 100644 --- a/stubs/braintree/braintree/graphql/inputs/customer_session_input.pyi +++ b/stubs/braintree/braintree/graphql/inputs/customer_session_input.pyi @@ -1,4 +1,5 @@ from _typeshed import Incomplete +from typing_extensions import Self from braintree.graphql.inputs.phone_input import PhoneInput @@ -6,22 +7,26 @@ class CustomerSessionInput: def __init__( self, email: str | None = None, + hashed_email: str | None = None, phone: PhoneInput | None = None, + hashed_phone_number: str | None = None, device_fingerprint_id: str | None = None, paypal_app_installed: bool | None = None, venmo_app_installed: bool | None = None, user_agent: str | None = None, ) -> None: ... - def to_graphql_variables(self) -> dict[Incomplete, Incomplete]: ... + def to_graphql_variables(self) -> dict[str, Incomplete]: ... @staticmethod - def builder(): ... + def builder() -> Builder: ... class Builder: def __init__(self) -> None: ... - def email(self, email: str): ... - def phone(self, phone: PhoneInput): ... - def device_fingerprint_id(self, device_fingerprint_id: str): ... - def paypal_app_installed(self, paypal_app_installed: bool): ... - def venmo_app_installed(self, venmo_app_installed: bool): ... - def user_agent(self, user_agent: str): ... - def build(self): ... + def email(self, email: str) -> Self: ... + def hashed_email(self, hashed_email: str) -> Self: ... + def phone(self, phone: PhoneInput) -> Self: ... + def hashed_phone_number(self, hashed_phone_number: str) -> Self: ... + def device_fingerprint_id(self, device_fingerprint_id: str) -> Self: ... + def paypal_app_installed(self, paypal_app_installed: bool) -> Self: ... + def venmo_app_installed(self, venmo_app_installed: bool) -> Self: ... + def user_agent(self, user_agent: str) -> Self: ... + def build(self) -> CustomerSessionInput: ... diff --git a/stubs/braintree/braintree/graphql/inputs/monetary_amount_input.pyi b/stubs/braintree/braintree/graphql/inputs/monetary_amount_input.pyi new file mode 100644 index 000000000..0df5d9403 --- /dev/null +++ b/stubs/braintree/braintree/graphql/inputs/monetary_amount_input.pyi @@ -0,0 +1,6 @@ +from _typeshed import Incomplete +from decimal import Decimal + +class MonetaryAmountInput: + def __init__(self, value: Decimal | None = None, currency_code: str | None = None) -> None: ... + def to_graphql_variables(self) -> dict[str, Incomplete]: ... diff --git a/stubs/braintree/braintree/graphql/inputs/paypal_payee_input.pyi b/stubs/braintree/braintree/graphql/inputs/paypal_payee_input.pyi new file mode 100644 index 000000000..a9f1e8e81 --- /dev/null +++ b/stubs/braintree/braintree/graphql/inputs/paypal_payee_input.pyi @@ -0,0 +1,14 @@ +from _typeshed import Incomplete +from typing_extensions import Self + +class PayPalPayeeInput: + def __init__(self, email_address: str | None = None, client_id: str | None = None) -> None: ... + def to_graphql_variables(self) -> dict[str, Incomplete]: ... + @staticmethod + def builder() -> Builder: ... + + class Builder: + def __init__(self) -> None: ... + def email_address(self, email_address: str) -> Self: ... + def client_id(self, client_id: str) -> Self: ... + def build(self) -> PayPalPayeeInput: ... diff --git a/stubs/braintree/braintree/graphql/inputs/paypal_purchase_unit_input.pyi b/stubs/braintree/braintree/graphql/inputs/paypal_purchase_unit_input.pyi new file mode 100644 index 000000000..cfb04ce70 --- /dev/null +++ b/stubs/braintree/braintree/graphql/inputs/paypal_purchase_unit_input.pyi @@ -0,0 +1,16 @@ +from _typeshed import Incomplete +from typing_extensions import Self + +from braintree.graphql.inputs.monetary_amount_input import MonetaryAmountInput +from braintree.graphql.inputs.paypal_payee_input import PayPalPayeeInput + +class PayPalPurchaseUnitInput: + def __init__(self, amount: MonetaryAmountInput | None = None, payee: PayPalPayeeInput | None = None) -> None: ... + def to_graphql_variables(self) -> dict[str, Incomplete]: ... + @staticmethod + def builder(amount: MonetaryAmountInput) -> Builder: ... + + class Builder: + def __init__(self, amount: MonetaryAmountInput) -> None: ... + def payee(self, payee: PayPalPayeeInput) -> Self: ... + def build(self) -> PayPalPurchaseUnitInput: ... diff --git a/stubs/braintree/braintree/graphql/inputs/phone_input.pyi b/stubs/braintree/braintree/graphql/inputs/phone_input.pyi index b1d8c0914..255fcc4bb 100644 --- a/stubs/braintree/braintree/graphql/inputs/phone_input.pyi +++ b/stubs/braintree/braintree/graphql/inputs/phone_input.pyi @@ -1,14 +1,17 @@ +from _typeshed import Incomplete +from typing_extensions import Self + class PhoneInput: def __init__( self, country_phone_code: str | None = None, phone_number: str | None = None, extension_number: str | None = None ) -> None: ... - def to_graphql_variables(self): ... + def to_graphql_variables(self) -> dict[str, Incomplete]: ... @staticmethod - def builder(): ... + def builder() -> Builder: ... class Builder: def __init__(self) -> None: ... - def country_phone_code(self, country_phone_code: str): ... - def phone_number(self, phone_number: str): ... - def extension_number(self, extension_number: str): ... - def build(self): ... + def country_phone_code(self, country_phone_code: str) -> Self: ... + def phone_number(self, phone_number: str) -> Self: ... + def extension_number(self, extension_number: str) -> Self: ... + def build(self) -> PhoneInput: ... diff --git a/stubs/braintree/braintree/graphql/inputs/update_customer_session_input.pyi b/stubs/braintree/braintree/graphql/inputs/update_customer_session_input.pyi index f59d8adb3..1652547cc 100644 --- a/stubs/braintree/braintree/graphql/inputs/update_customer_session_input.pyi +++ b/stubs/braintree/braintree/graphql/inputs/update_customer_session_input.pyi @@ -1,17 +1,24 @@ from _typeshed import Incomplete +from typing_extensions import Self from braintree.graphql.inputs.customer_session_input import CustomerSessionInput +from braintree.graphql.inputs.paypal_purchase_unit_input import PayPalPurchaseUnitInput class UpdateCustomerSessionInput: def __init__( - self, session_id: str, merchant_account_id: str | None = None, customer: CustomerSessionInput | None = None + self, + session_id: str, + customer: CustomerSessionInput | None = None, + merchant_account_id: str | None = None, + purchase_units: list[PayPalPurchaseUnitInput] | None = None, ) -> None: ... - def to_graphql_variables(self) -> dict[Incomplete, Incomplete]: ... + def to_graphql_variables(self) -> dict[str, Incomplete]: ... @staticmethod - def builder(session_id: str): ... + def builder(session_id: str) -> Builder: ... class Builder: def __init__(self, session_id: str) -> None: ... - def merchant_account_id(self, merchant_account_id): ... - def customer(self, customer): ... - def build(self): ... + def merchant_account_id(self, merchant_account_id: str) -> Self: ... + def customer(self, customer: CustomerSessionInput) -> Self: ... + def purchase_units(self, purchase_units: list[PayPalPurchaseUnitInput]) -> Self: ... + def build(self) -> UpdateCustomerSessionInput: ... diff --git a/stubs/braintree/braintree/graphql/types/__init__.pyi b/stubs/braintree/braintree/graphql/types/__init__.pyi index 0978834b0..0e2d21a80 100644 --- a/stubs/braintree/braintree/graphql/types/__init__.pyi +++ b/stubs/braintree/braintree/graphql/types/__init__.pyi @@ -2,3 +2,4 @@ from braintree.graphql.types.customer_recommendations_payload import ( CustomerRecommendationsPayload as CustomerRecommendationsPayload, ) from braintree.graphql.types.payment_options import PaymentOptions as PaymentOptions +from braintree.graphql.types.payment_recommendation import PaymentRecommendation as PaymentRecommendation diff --git a/stubs/braintree/braintree/graphql/types/customer_recommendations_payload.pyi b/stubs/braintree/braintree/graphql/types/customer_recommendations_payload.pyi index 2bdc9045a..d03908781 100644 --- a/stubs/braintree/braintree/graphql/types/customer_recommendations_payload.pyi +++ b/stubs/braintree/braintree/graphql/types/customer_recommendations_payload.pyi @@ -1,8 +1,13 @@ -from _typeshed import Incomplete +from typing import Any from braintree.graphql.unions.customer_recommendations import CustomerRecommendations class CustomerRecommendationsPayload: - is_in_paypal_network: Incomplete - recommendations: Incomplete - def __init__(self, is_in_paypal_network: bool, recommendations: CustomerRecommendations) -> None: ... + is_in_paypal_network: bool | None + recommendations: CustomerRecommendations | None + def __init__( + self, + is_in_paypal_network: bool | None = None, + recommendations: CustomerRecommendations | None = None, + response: dict[str, Any] | None = None, + ): ... diff --git a/stubs/braintree/braintree/graphql/types/payment_options.pyi b/stubs/braintree/braintree/graphql/types/payment_options.pyi index 02193cb83..756f4d141 100644 --- a/stubs/braintree/braintree/graphql/types/payment_options.pyi +++ b/stubs/braintree/braintree/graphql/types/payment_options.pyi @@ -1,8 +1,6 @@ -from _typeshed import Incomplete - from braintree.graphql.enums import RecommendedPaymentOption class PaymentOptions: - payment_option: Incomplete - recommended_priority: Incomplete + payment_option: RecommendedPaymentOption + recommended_priority: int def __init__(self, payment_option: RecommendedPaymentOption, recommended_priority: int) -> None: ... diff --git a/stubs/braintree/braintree/graphql/types/payment_recommendation.pyi b/stubs/braintree/braintree/graphql/types/payment_recommendation.pyi new file mode 100644 index 000000000..34ed4dc43 --- /dev/null +++ b/stubs/braintree/braintree/graphql/types/payment_recommendation.pyi @@ -0,0 +1,6 @@ +from braintree.graphql.enums import RecommendedPaymentOption + +class PaymentRecommendation: + payment_option: RecommendedPaymentOption + recommended_priority: int + def __init__(self, payment_option: RecommendedPaymentOption, recommended_priority: int) -> None: ... diff --git a/stubs/braintree/braintree/graphql/unions/customer_recommendations.pyi b/stubs/braintree/braintree/graphql/unions/customer_recommendations.pyi index 91ceb3986..63a3df64f 100644 --- a/stubs/braintree/braintree/graphql/unions/customer_recommendations.pyi +++ b/stubs/braintree/braintree/graphql/unions/customer_recommendations.pyi @@ -1,7 +1,7 @@ -from _typeshed import Incomplete - from braintree.graphql.types.payment_options import PaymentOptions +from braintree.graphql.types.payment_recommendation import PaymentRecommendation class CustomerRecommendations: - payment_options: Incomplete - def __init__(self, payment_options: list[PaymentOptions]) -> None: ... + payment_options: list[PaymentOptions] + payment_recommendations: list[PaymentRecommendation] + def __init__(self, payment_recommendations: list[PaymentRecommendation] | None = None) -> None: ... diff --git a/stubs/braintree/braintree/montary_amount.pyi b/stubs/braintree/braintree/monetary_amount.pyi similarity index 79% rename from stubs/braintree/braintree/montary_amount.pyi rename to stubs/braintree/braintree/monetary_amount.pyi index 98f6a9555..6da51aaaa 100644 --- a/stubs/braintree/braintree/montary_amount.pyi +++ b/stubs/braintree/braintree/monetary_amount.pyi @@ -2,6 +2,6 @@ from decimal import Decimal from braintree.attribute_getter import AttributeGetter -class MontaryAmount(AttributeGetter): +class MonetaryAmount(AttributeGetter): value: Decimal def __init__(self, attributes) -> None: ... diff --git a/stubs/braintree/braintree/test/credit_card_numbers.pyi b/stubs/braintree/braintree/test/credit_card_numbers.pyi index 085591590..7ddbb9120 100644 --- a/stubs/braintree/braintree/test/credit_card_numbers.pyi +++ b/stubs/braintree/braintree/test/credit_card_numbers.pyi @@ -2,13 +2,17 @@ from typing import Final class CreditCardNumbers: class CardTypeIndicators: + Business: Final = "4229989800000003" Commercial: Final = "4111111111131010" + Consumer: Final = "4229989700000004" + Corporate: Final = "4229989100000000" DurbinRegulated: Final = "4111161010101010" Debit: Final = "4117101010101010" Healthcare: Final = "4111111510101010" Payroll: Final = "4111111114101010" Prepaid: Final = "4111111111111210" PrepaidReloadable: Final = "4229989900000002" + Purchase: Final = "4229989500000006" IssuingBank: Final = "4111111141010101" CountryOfIssuance: Final = "4111111111121102" No: Final = "4111111111310101" diff --git a/stubs/braintree/braintree/test/nonces.pyi b/stubs/braintree/braintree/test/nonces.pyi index c59ffa78a..1c85c2864 100644 --- a/stubs/braintree/braintree/test/nonces.pyi +++ b/stubs/braintree/braintree/test/nonces.pyi @@ -56,7 +56,10 @@ class Nonces: ThreeDSecureVisaUnavailable: Final = "fake-three-d-secure-visa-unavailable-nonce" Transactable: Final = "fake-valid-nonce" TransactableAmEx: Final = "fake-valid-amex-nonce" + TransactableBusiness: Final = "fake-valid-business-nonce" TransactableCommercial: Final = "fake-valid-commercial-nonce" + TransactableConsumer: Final = "fake-valid-consumer-nonce" + TransactableCorporate: Final = "fake-valid-corporate-nonce" TransactableCountryOfIssuanceCAD: Final = "fake-valid-country-of-issuance-cad-nonce" TransactableCountryOfIssuanceUSA: Final = "fake-valid-country-of-issuance-usa-nonce" TransactableDebit: Final = "fake-valid-debit-nonce" @@ -73,6 +76,7 @@ class Nonces: TransactablePinlessDebitVisa: Final = "fake-pinless-debit-visa-nonce" TransactablePrepaid: Final = "fake-valid-prepaid-nonce" TransactablePrepaidReloadable: Final = "fake-valid-prepaid-reloadable-nonce" + TransactablePurchase: Final = "fake-valid-purchase-nonce" TransactableUnknownIndicators: Final = "fake-valid-unknown-indicators-nonce" TransactableVisa: Final = "fake-valid-visa-nonce" VenmoAccount: Final = "fake-venmo-account-nonce" diff --git a/stubs/braintree/braintree/util/__init__.pyi b/stubs/braintree/braintree/util/__init__.pyi index 974d71418..62115e01e 100644 --- a/stubs/braintree/braintree/util/__init__.pyi +++ b/stubs/braintree/braintree/util/__init__.pyi @@ -1,5 +1,6 @@ from braintree.util.constants import Constants as Constants from braintree.util.crypto import Crypto as Crypto +from braintree.util.experimental import Experimental as Experimental from braintree.util.generator import Generator as Generator from braintree.util.graphql_client import GraphQLClient as GraphQLClient from braintree.util.http import Http as Http diff --git a/stubs/braintree/braintree/util/experimental.pyi b/stubs/braintree/braintree/util/experimental.pyi new file mode 100644 index 000000000..4b1c1b906 --- /dev/null +++ b/stubs/braintree/braintree/util/experimental.pyi @@ -0,0 +1,5 @@ +from typing import TypeVar + +_T = TypeVar("_T") + +def Experimental(cls: _T) -> _T: ...