From d547f025b5c1d92ae11c484de72685db08ad53b3 Mon Sep 17 00:00:00 2001 From: Danny Yang Date: Tue, 18 Feb 2025 10:38:37 -0500 Subject: [PATCH] Bump braintree to 4.33.* (#13511) --- stubs/braintree/METADATA.toml | 2 +- .../braintree/customer_session_gateway.pyi | 17 ++++++++++++ .../braintree/braintree/graphql/__init__.pyi | 13 +++++++++ .../braintree/graphql/enums/__init__.pyi | 2 ++ .../graphql/enums/recommendations.pyi | 4 +++ .../enums/recommended_payment_option.pyi | 5 ++++ .../braintree/graphql/inputs/__init__.pyi | 5 ++++ .../inputs/create_customer_session_input.pyi | 23 ++++++++++++++++ .../inputs/customer_recommendations_input.pyi | 22 +++++++++++++++ .../graphql/inputs/customer_session_input.pyi | 27 +++++++++++++++++++ .../braintree/graphql/inputs/phone_input.pyi | 14 ++++++++++ .../inputs/update_customer_session_input.pyi | 17 ++++++++++++ .../braintree/graphql/types/__init__.pyi | 4 +++ .../customer_recommendations_payload.pyi | 8 ++++++ .../graphql/types/payment_options.pyi | 8 ++++++ .../braintree/graphql/unions/__init__.pyi | 1 + .../unions/customer_recommendations.pyi | 7 +++++ .../braintree/util/graphql_client.pyi | 8 ++++++ 18 files changed, 186 insertions(+), 1 deletion(-) create mode 100644 stubs/braintree/braintree/customer_session_gateway.pyi create mode 100644 stubs/braintree/braintree/graphql/__init__.pyi create mode 100644 stubs/braintree/braintree/graphql/enums/__init__.pyi create mode 100644 stubs/braintree/braintree/graphql/enums/recommendations.pyi create mode 100644 stubs/braintree/braintree/graphql/enums/recommended_payment_option.pyi create mode 100644 stubs/braintree/braintree/graphql/inputs/__init__.pyi create mode 100644 stubs/braintree/braintree/graphql/inputs/create_customer_session_input.pyi create mode 100644 stubs/braintree/braintree/graphql/inputs/customer_recommendations_input.pyi create mode 100644 stubs/braintree/braintree/graphql/inputs/customer_session_input.pyi create mode 100644 stubs/braintree/braintree/graphql/inputs/phone_input.pyi create mode 100644 stubs/braintree/braintree/graphql/inputs/update_customer_session_input.pyi create mode 100644 stubs/braintree/braintree/graphql/types/__init__.pyi create mode 100644 stubs/braintree/braintree/graphql/types/customer_recommendations_payload.pyi create mode 100644 stubs/braintree/braintree/graphql/types/payment_options.pyi create mode 100644 stubs/braintree/braintree/graphql/unions/__init__.pyi create mode 100644 stubs/braintree/braintree/graphql/unions/customer_recommendations.pyi diff --git a/stubs/braintree/METADATA.toml b/stubs/braintree/METADATA.toml index 76d144452..5f9b367ae 100644 --- a/stubs/braintree/METADATA.toml +++ b/stubs/braintree/METADATA.toml @@ -1,2 +1,2 @@ -version = "4.32.*" +version = "4.33.*" upstream_repository = "https://github.com/braintree/braintree_python" diff --git a/stubs/braintree/braintree/customer_session_gateway.pyi b/stubs/braintree/braintree/customer_session_gateway.pyi new file mode 100644 index 000000000..fa0665397 --- /dev/null +++ b/stubs/braintree/braintree/customer_session_gateway.pyi @@ -0,0 +1,17 @@ +from _typeshed import Incomplete + +from braintree.error_result import ErrorResult +from braintree.graphql import CreateCustomerSessionInput, CustomerRecommendationsInput, UpdateCustomerSessionInput +from braintree.successful_result import SuccessfulResult + +class CustomerSessionGateway: + gateway: Incomplete + graphql_client: Incomplete + def __init__(self, gateway) -> None: ... + def create_customer_session(self, customer_session_input: CreateCustomerSessionInput) -> SuccessfulResult | ErrorResult: ... + def update_customer_session( + self, update_customer_session_input: UpdateCustomerSessionInput + ) -> SuccessfulResult | ErrorResult: ... + def get_customer_recommendations( + self, customer_recommendations_input: CustomerRecommendationsInput + ) -> SuccessfulResult | ErrorResult: ... diff --git a/stubs/braintree/braintree/graphql/__init__.pyi b/stubs/braintree/braintree/graphql/__init__.pyi new file mode 100644 index 000000000..559f65bf4 --- /dev/null +++ b/stubs/braintree/braintree/graphql/__init__.pyi @@ -0,0 +1,13 @@ +from braintree.graphql.enums import Recommendations as Recommendations, RecommendedPaymentOption as RecommendedPaymentOption +from braintree.graphql.inputs import ( + CreateCustomerSessionInput as CreateCustomerSessionInput, + CustomerRecommendationsInput as CustomerRecommendationsInput, + CustomerSessionInput as CustomerSessionInput, + PhoneInput as PhoneInput, + UpdateCustomerSessionInput as UpdateCustomerSessionInput, +) +from braintree.graphql.types import ( + CustomerRecommendationsPayload as CustomerRecommendationsPayload, + PaymentOptions as PaymentOptions, +) +from braintree.graphql.unions import CustomerRecommendations as CustomerRecommendations diff --git a/stubs/braintree/braintree/graphql/enums/__init__.pyi b/stubs/braintree/braintree/graphql/enums/__init__.pyi new file mode 100644 index 000000000..ab73711c6 --- /dev/null +++ b/stubs/braintree/braintree/graphql/enums/__init__.pyi @@ -0,0 +1,2 @@ +from braintree.graphql.enums.recommendations import Recommendations as Recommendations +from braintree.graphql.enums.recommended_payment_option import RecommendedPaymentOption as RecommendedPaymentOption diff --git a/stubs/braintree/braintree/graphql/enums/recommendations.pyi b/stubs/braintree/braintree/graphql/enums/recommendations.pyi new file mode 100644 index 000000000..907e49a15 --- /dev/null +++ b/stubs/braintree/braintree/graphql/enums/recommendations.pyi @@ -0,0 +1,4 @@ +from enum import Enum + +class Recommendations(Enum): + PAYMENT_RECOMMENDATIONS = "PAYMENT_RECOMMENDATIONS" diff --git a/stubs/braintree/braintree/graphql/enums/recommended_payment_option.pyi b/stubs/braintree/braintree/graphql/enums/recommended_payment_option.pyi new file mode 100644 index 000000000..b6e46e339 --- /dev/null +++ b/stubs/braintree/braintree/graphql/enums/recommended_payment_option.pyi @@ -0,0 +1,5 @@ +from enum import Enum + +class RecommendedPaymentOption(Enum): + PAYPAL = "PAYPAL" + VENMO = "VENMO" diff --git a/stubs/braintree/braintree/graphql/inputs/__init__.pyi b/stubs/braintree/braintree/graphql/inputs/__init__.pyi new file mode 100644 index 000000000..3c9b74a56 --- /dev/null +++ b/stubs/braintree/braintree/graphql/inputs/__init__.pyi @@ -0,0 +1,5 @@ +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.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 new file mode 100644 index 000000000..7ab2bdf0e --- /dev/null +++ b/stubs/braintree/braintree/graphql/inputs/create_customer_session_input.pyi @@ -0,0 +1,23 @@ +from _typeshed import Incomplete + +from braintree.graphql.inputs.customer_session_input import CustomerSessionInput + +class CreateCustomerSessionInput: + def __init__( + self, + merchant_account_id: str | None = None, + session_id: str | None = None, + customer: CustomerSessionInput | None = None, + domain: str | None = None, + ) -> None: ... + def to_graphql_variables(self) -> dict[Incomplete, Incomplete]: ... + @staticmethod + def 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): ... diff --git a/stubs/braintree/braintree/graphql/inputs/customer_recommendations_input.pyi b/stubs/braintree/braintree/graphql/inputs/customer_recommendations_input.pyi new file mode 100644 index 000000000..ed193fe8b --- /dev/null +++ b/stubs/braintree/braintree/graphql/inputs/customer_recommendations_input.pyi @@ -0,0 +1,22 @@ +from _typeshed import Incomplete + +from braintree.graphql.enums.recommendations import Recommendations +from braintree.graphql.inputs.customer_session_input import CustomerSessionInput + +class CustomerRecommendationsInput: + def __init__( + self, + session_id: str, + recommendations: list[Recommendations], + merchant_account_id: str | None = None, + customer: CustomerSessionInput | None = None, + ) -> None: ... + def to_graphql_variables(self) -> dict[Incomplete, Incomplete]: ... + @staticmethod + def builder(session_id: str, recommendations: list[Recommendations]): ... + + 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): ... diff --git a/stubs/braintree/braintree/graphql/inputs/customer_session_input.pyi b/stubs/braintree/braintree/graphql/inputs/customer_session_input.pyi new file mode 100644 index 000000000..bf92de8f0 --- /dev/null +++ b/stubs/braintree/braintree/graphql/inputs/customer_session_input.pyi @@ -0,0 +1,27 @@ +from _typeshed import Incomplete + +from braintree.graphql.inputs.phone_input import PhoneInput + +class CustomerSessionInput: + def __init__( + self, + email: str | None = None, + phone: PhoneInput | 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]: ... + @staticmethod + def 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): ... diff --git a/stubs/braintree/braintree/graphql/inputs/phone_input.pyi b/stubs/braintree/braintree/graphql/inputs/phone_input.pyi new file mode 100644 index 000000000..b1d8c0914 --- /dev/null +++ b/stubs/braintree/braintree/graphql/inputs/phone_input.pyi @@ -0,0 +1,14 @@ +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): ... + @staticmethod + def 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): ... diff --git a/stubs/braintree/braintree/graphql/inputs/update_customer_session_input.pyi b/stubs/braintree/braintree/graphql/inputs/update_customer_session_input.pyi new file mode 100644 index 000000000..f59d8adb3 --- /dev/null +++ b/stubs/braintree/braintree/graphql/inputs/update_customer_session_input.pyi @@ -0,0 +1,17 @@ +from _typeshed import Incomplete + +from braintree.graphql.inputs.customer_session_input import CustomerSessionInput + +class UpdateCustomerSessionInput: + def __init__( + self, session_id: str, merchant_account_id: str | None = None, customer: CustomerSessionInput | None = None + ) -> None: ... + def to_graphql_variables(self) -> dict[Incomplete, Incomplete]: ... + @staticmethod + def builder(session_id: str): ... + + class Builder: + def __init__(self, session_id: str) -> None: ... + def merchant_account_id(self, merchant_account_id): ... + def customer(self, customer): ... + def build(self): ... diff --git a/stubs/braintree/braintree/graphql/types/__init__.pyi b/stubs/braintree/braintree/graphql/types/__init__.pyi new file mode 100644 index 000000000..0978834b0 --- /dev/null +++ b/stubs/braintree/braintree/graphql/types/__init__.pyi @@ -0,0 +1,4 @@ +from braintree.graphql.types.customer_recommendations_payload import ( + CustomerRecommendationsPayload as CustomerRecommendationsPayload, +) +from braintree.graphql.types.payment_options import PaymentOptions as PaymentOptions diff --git a/stubs/braintree/braintree/graphql/types/customer_recommendations_payload.pyi b/stubs/braintree/braintree/graphql/types/customer_recommendations_payload.pyi new file mode 100644 index 000000000..2bdc9045a --- /dev/null +++ b/stubs/braintree/braintree/graphql/types/customer_recommendations_payload.pyi @@ -0,0 +1,8 @@ +from _typeshed import Incomplete + +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: ... diff --git a/stubs/braintree/braintree/graphql/types/payment_options.pyi b/stubs/braintree/braintree/graphql/types/payment_options.pyi new file mode 100644 index 000000000..02193cb83 --- /dev/null +++ b/stubs/braintree/braintree/graphql/types/payment_options.pyi @@ -0,0 +1,8 @@ +from _typeshed import Incomplete + +from braintree.graphql.enums import RecommendedPaymentOption + +class PaymentOptions: + payment_option: Incomplete + recommended_priority: Incomplete + def __init__(self, payment_option: RecommendedPaymentOption, recommended_priority: int) -> None: ... diff --git a/stubs/braintree/braintree/graphql/unions/__init__.pyi b/stubs/braintree/braintree/graphql/unions/__init__.pyi new file mode 100644 index 000000000..6b6217e4c --- /dev/null +++ b/stubs/braintree/braintree/graphql/unions/__init__.pyi @@ -0,0 +1 @@ +from braintree.graphql.unions.customer_recommendations import CustomerRecommendations as CustomerRecommendations diff --git a/stubs/braintree/braintree/graphql/unions/customer_recommendations.pyi b/stubs/braintree/braintree/graphql/unions/customer_recommendations.pyi new file mode 100644 index 000000000..91ceb3986 --- /dev/null +++ b/stubs/braintree/braintree/graphql/unions/customer_recommendations.pyi @@ -0,0 +1,7 @@ +from _typeshed import Incomplete + +from braintree.graphql.types.payment_options import PaymentOptions + +class CustomerRecommendations: + payment_options: Incomplete + def __init__(self, payment_options: list[PaymentOptions]) -> None: ... diff --git a/stubs/braintree/braintree/util/graphql_client.pyi b/stubs/braintree/braintree/util/graphql_client.pyi index 30688d672..e17cab425 100644 --- a/stubs/braintree/braintree/util/graphql_client.pyi +++ b/stubs/braintree/braintree/util/graphql_client.pyi @@ -1,10 +1,18 @@ from _typeshed import Incomplete +from typing import TypedDict from braintree.util.http import Http +class _ValidationErrors(TypedDict): + errors: Incomplete + class GraphQLClient(Http): @staticmethod def raise_exception_for_graphql_error(response) -> None: ... graphql_headers: dict[str, str] def __init__(self, config: Incomplete | None = None, environment: Incomplete | None = None) -> None: ... def query(self, definition, variables: Incomplete | None = None, operation_name: Incomplete | None = None): ... + @staticmethod + def get_validation_errors(response) -> _ValidationErrors | None: ... + @staticmethod + def get_validation_error_code(error) -> Incomplete | None: ...