diff --git a/stubs/braintree/METADATA.toml b/stubs/braintree/METADATA.toml index 5a102b9ffc6f..68ab542d5a3b 100644 --- a/stubs/braintree/METADATA.toml +++ b/stubs/braintree/METADATA.toml @@ -1,2 +1,2 @@ -version = "4.42.*" +version = "4.43.*" upstream-repository = "https://github.com/braintree/braintree_python" diff --git a/stubs/braintree/braintree/__init__.pyi b/stubs/braintree/braintree/__init__.pyi index 4eb6dc7c19bb..be8a05595d49 100644 --- a/stubs/braintree/braintree/__init__.pyi +++ b/stubs/braintree/braintree/__init__.pyi @@ -49,7 +49,10 @@ from braintree.europe_bank_account import EuropeBankAccount as EuropeBankAccount from braintree.graphql import * from braintree.liability_shift import LiabilityShift as LiabilityShift from braintree.local_payment_completed import LocalPaymentCompleted as LocalPaymentCompleted +from braintree.local_payment_context import LocalPaymentContext as LocalPaymentContext +from braintree.local_payment_context_gateway import LocalPaymentContextGateway as LocalPaymentContextGateway from braintree.local_payment_reversed import LocalPaymentReversed as LocalPaymentReversed +from braintree.local_payment_type import LocalPaymentType as LocalPaymentType from braintree.merchant import Merchant as Merchant from braintree.merchant_account import MerchantAccount as MerchantAccount from braintree.merchant_account_gateway import MerchantAccountGateway as MerchantAccountGateway diff --git a/stubs/braintree/braintree/apple_pay_card.pyi b/stubs/braintree/braintree/apple_pay_card.pyi index 86c6fc015d4f..0b0e488ac808 100644 --- a/stubs/braintree/braintree/apple_pay_card.pyi +++ b/stubs/braintree/braintree/apple_pay_card.pyi @@ -1,6 +1,7 @@ from _typeshed import Incomplete from typing import Final +from braintree.credit_card_verification import CreditCardVerification from braintree.resource import Resource from braintree.subscription import Subscription @@ -12,6 +13,7 @@ class ApplePayCard(Resource): is_expired: Incomplete subscriptions: list[Subscription] + verification: CreditCardVerification | None def __init__(self, gateway, attributes) -> None: ... @property def expiration_date(self): ... diff --git a/stubs/braintree/braintree/braintree_gateway.pyi b/stubs/braintree/braintree/braintree_gateway.pyi index c8d7b52e71aa..28a53728c47c 100644 --- a/stubs/braintree/braintree/braintree_gateway.pyi +++ b/stubs/braintree/braintree/braintree_gateway.pyi @@ -11,6 +11,7 @@ from braintree.discount_gateway import DiscountGateway from braintree.dispute_gateway import DisputeGateway from braintree.document_upload_gateway import DocumentUploadGateway from braintree.exchange_rate_quote_gateway import ExchangeRateQuoteGateway +from braintree.local_payment_context_gateway import LocalPaymentContextGateway as LocalPaymentContextGateway from braintree.merchant_account_gateway import MerchantAccountGateway from braintree.merchant_gateway import MerchantGateway from braintree.oauth_gateway import OAuthGateway @@ -44,6 +45,7 @@ class BraintreeGateway: dispute: DisputeGateway document_upload: DocumentUploadGateway exchange_rate_quote: ExchangeRateQuoteGateway + local_payment_context: LocalPaymentContextGateway graphql_client: GraphQLClient merchant: MerchantGateway merchant_account: MerchantAccountGateway diff --git a/stubs/braintree/braintree/error_codes.pyi b/stubs/braintree/braintree/error_codes.pyi index d56f7e6903ef..6647617c60af 100644 --- a/stubs/braintree/braintree/error_codes.pyi +++ b/stubs/braintree/braintree/error_codes.pyi @@ -53,6 +53,7 @@ class ErrorCodes: MerchantNotConfigured: Final = "93514" MerchantKeysAlreadyConfigured: Final = "93515" MerchantKeysNotConfigured: Final = "93516" + NetworkTransactionIdNotAllowed: Final = "93532" CertificateInvalid: Final = "93517" CertificateMismatch: Final = "93519" InvalidToken: Final = "83520" @@ -61,6 +62,18 @@ class ErrorCodes: CustomerIdIsInvalid: Final = "93528" BillingAddressFormatIsInvalid: Final = "93529" + class Options: + class Verification: + AccountTypeIsInvalid: Final = "93538" + AccountTypeNotSupported: Final = "93543" + AmountCannotBeNegative: Final = "93535" + AmountFormatIsInvalid: Final = "93534" + AmountIsTooLarge: Final = "93537" + AmountNotSupportedByProcessor: Final = "93536" + MerchantAccountIdIsInvalid: Final = "93540" + MerchantAccountIsSuspended: Final = "93541" + NotSupportedByProcessor: Final = "93533" + class AuthorizationFingerprint: MissingFingerprint: Final = "93201" InvalidFormat: Final = "93202" @@ -157,6 +170,8 @@ class ErrorCodes: IdIsNotAllowed: Final = "91611" IdIsRequired: Final = "91613" IdIsTooLong: Final = "91612" + InternationalPhoneCountryCodeIsInvalid: Final = "91625" + InternationalPhoneNationalNumberIsInvalid: Final = "91626" LastNameIsTooLong: Final = "81613" PhoneIsTooLong: Final = "81614" VaultedPaymentInstrumentNonceBelongsToDifferentCustomer: Final = "91617" @@ -478,6 +493,12 @@ class ErrorCodes: DiscountAmountFormatIsInvalid: Final = "915159" DiscountAmountIsTooLarge: Final = "915161" ExchangeRateQuoteIdIsTooLong: Final = "915229" + ApiRequestKeyTooLong: Final = "915230" + ApiRequestKeyNotAllowed: Final = "915231" + ApiRequestKeyCanBeReusedOnlyWithTheSameRequest: Final = "915232" + ApiRequestKeyIsInFlight: Final = "915233" + ApiRequestKeyWithFailedRequest: Final = "915234" + ApiRequestKeyServerError: Final = "915235" FailedAuthAdjustmentAllowRetry: Final = "95603" FailedAuthAdjustmentHardDecline: Final = "95602" FinalAuthSubmitForSettlementForDifferentAmount: Final = "95601" diff --git a/stubs/braintree/braintree/graphql/__init__.pyi b/stubs/braintree/braintree/graphql/__init__.pyi index 7944cc51e450..c39a227b1fad 100644 --- a/stubs/braintree/braintree/graphql/__init__.pyi +++ b/stubs/braintree/braintree/graphql/__init__.pyi @@ -1,9 +1,12 @@ from braintree.graphql.enums import Recommendations as Recommendations, RecommendedPaymentOption as RecommendedPaymentOption from braintree.graphql.inputs import ( + BillingAddressInput as BillingAddressInput, CreateCustomerSessionInput as CreateCustomerSessionInput, + CreateLocalPaymentContextInput as CreateLocalPaymentContextInput, CustomerRecommendationsInput as CustomerRecommendationsInput, CustomerSessionInput as CustomerSessionInput, MonetaryAmountInput as MonetaryAmountInput, + PayerInfoInput as PayerInfoInput, PayPalPayeeInput as PayPalPayeeInput, PayPalPurchaseUnitInput as PayPalPurchaseUnitInput, PhoneInput as PhoneInput, diff --git a/stubs/braintree/braintree/graphql/inputs/__init__.pyi b/stubs/braintree/braintree/graphql/inputs/__init__.pyi index f7baabaa5c8f..3ff432cc1a70 100644 --- a/stubs/braintree/braintree/graphql/inputs/__init__.pyi +++ b/stubs/braintree/braintree/graphql/inputs/__init__.pyi @@ -1,7 +1,12 @@ +from braintree.graphql.inputs.billing_address_input import BillingAddressInput as BillingAddressInput from braintree.graphql.inputs.create_customer_session_input import CreateCustomerSessionInput as CreateCustomerSessionInput +from braintree.graphql.inputs.create_local_payment_context_input import ( + CreateLocalPaymentContextInput as CreateLocalPaymentContextInput, +) 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.payer_info_input import PayerInfoInput as PayerInfoInput 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 diff --git a/stubs/braintree/braintree/graphql/inputs/billing_address_input.pyi b/stubs/braintree/braintree/graphql/inputs/billing_address_input.pyi new file mode 100644 index 000000000000..94ef587a361d --- /dev/null +++ b/stubs/braintree/braintree/graphql/inputs/billing_address_input.pyi @@ -0,0 +1,22 @@ +from typing import TypedDict, type_check_only + +@type_check_only +class _GraphqlVariables(TypedDict, total=False): + countryCode: str + extendedAddress: str + locality: str + postalCode: str + region: str + streetAddress: str + +class BillingAddressInput: + def __init__( + self, + country_code_alpha2: str | None = None, + extended_address: str | None = None, + locality: str | None = None, + postal_code: str | None = None, + region: str | None = None, + street_address: str | None = None, + ) -> None: ... + def to_graphql_variables(self) -> _GraphqlVariables: ... 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 08789e004100..b15c7227ea6a 100644 --- a/stubs/braintree/braintree/graphql/inputs/create_customer_session_input.pyi +++ b/stubs/braintree/braintree/graphql/inputs/create_customer_session_input.pyi @@ -1,8 +1,22 @@ -from _typeshed import Incomplete +from typing import TypedDict, type_check_only from typing_extensions import Self -from braintree.graphql.inputs.customer_session_input import CustomerSessionInput -from braintree.graphql.inputs.paypal_purchase_unit_input import PayPalPurchaseUnitInput +from braintree.graphql.inputs.customer_session_input import ( + CustomerSessionInput, + _GraphqlVariables as _CustomerSessionGraphqlVariables, +) +from braintree.graphql.inputs.paypal_purchase_unit_input import ( + PayPalPurchaseUnitInput, + _GraphqlVariables as _PayPalPurchaseUnitGraphqlVariables, +) + +@type_check_only +class _GraphqlVariables(TypedDict, total=False): + merchantAccountId: str + sessionId: str + customer: _CustomerSessionGraphqlVariables + domain: str + purchaseUnits: list[_PayPalPurchaseUnitGraphqlVariables] class CreateCustomerSessionInput: def __init__( @@ -13,7 +27,7 @@ class CreateCustomerSessionInput: domain: str | None = None, purchase_units: list[PayPalPurchaseUnitInput] | None = None, ) -> None: ... - def to_graphql_variables(self) -> dict[str, Incomplete]: ... + def to_graphql_variables(self) -> _GraphqlVariables: ... @staticmethod def builder() -> Builder: ... diff --git a/stubs/braintree/braintree/graphql/inputs/create_local_payment_context_input.pyi b/stubs/braintree/braintree/graphql/inputs/create_local_payment_context_input.pyi new file mode 100644 index 000000000000..dc8ea3b1c223 --- /dev/null +++ b/stubs/braintree/braintree/graphql/inputs/create_local_payment_context_input.pyi @@ -0,0 +1,36 @@ +from _typeshed import Incomplete +from typing import TypedDict, type_check_only + +from braintree.graphql.inputs.monetary_amount_input import _GraphqlVariables as _MonetaryAmountGraphqlVariables +from braintree.graphql.inputs.payer_info_input import _GraphqlVariables as _PayerInfoGraphqlVariables + +@type_check_only +class _PaymentContext(TypedDict, total=False): + amount: _MonetaryAmountGraphqlVariables + cancelUrl: str + countryCode: str + expiryDate: str + merchantAccountId: str + orderId: str + payerInfo: _PayerInfoGraphqlVariables + returnUrl: str + type: str + +@type_check_only +class _GraphqlVariables(TypedDict): + paymentContext: _PaymentContext + +class CreateLocalPaymentContextInput: + def __init__( + self, + amount: dict[str, Incomplete] | None = None, + cancel_url: str | None = None, + country_code: str | None = None, + expiry_date: str | None = None, + merchant_account_id: str | None = None, + order_id: str | None = None, + payer_info: dict[str, Incomplete] | None = None, + return_url: str | None = None, + type: str | None = None, + ) -> None: ... + def to_graphql_variables(self) -> _GraphqlVariables: ... diff --git a/stubs/braintree/braintree/graphql/inputs/customer_recommendations_input.pyi b/stubs/braintree/braintree/graphql/inputs/customer_recommendations_input.pyi index f90f98aca96e..e9fdf7817cd1 100644 --- a/stubs/braintree/braintree/graphql/inputs/customer_recommendations_input.pyi +++ b/stubs/braintree/braintree/graphql/inputs/customer_recommendations_input.pyi @@ -1,8 +1,22 @@ -from _typeshed import Incomplete -from typing_extensions import Self +from typing import TypedDict, type_check_only +from typing_extensions import Required, Self -from braintree.graphql.inputs.customer_session_input import CustomerSessionInput -from braintree.graphql.inputs.paypal_purchase_unit_input import PayPalPurchaseUnitInput +from braintree.graphql.inputs.customer_session_input import ( + CustomerSessionInput, + _GraphqlVariables as _CustomerSessionGraphqlVariables, +) +from braintree.graphql.inputs.paypal_purchase_unit_input import ( + PayPalPurchaseUnitInput, + _GraphqlVariables as _PayPalPurchaseUnitGraphqlVariables, +) + +@type_check_only +class _GraphqlVariables(TypedDict, total=False): + sessionId: Required[str] + merchantAccountId: str + purchaseUnits: list[_PayPalPurchaseUnitGraphqlVariables] + domain: str + customer: _CustomerSessionGraphqlVariables class CustomerRecommendationsInput: def __init__( @@ -13,7 +27,7 @@ class CustomerRecommendationsInput: domain: str | None = None, customer: CustomerSessionInput | None = None, ) -> None: ... - def to_graphql_variables(self) -> dict[str, Incomplete]: ... + def to_graphql_variables(self) -> _GraphqlVariables: ... @staticmethod def builder() -> Builder: ... diff --git a/stubs/braintree/braintree/graphql/inputs/customer_session_input.pyi b/stubs/braintree/braintree/graphql/inputs/customer_session_input.pyi index 9a0b948f16b7..f237a875cf85 100644 --- a/stubs/braintree/braintree/graphql/inputs/customer_session_input.pyi +++ b/stubs/braintree/braintree/graphql/inputs/customer_session_input.pyi @@ -1,7 +1,18 @@ -from _typeshed import Incomplete +from typing import TypedDict, type_check_only from typing_extensions import Self -from braintree.graphql.inputs.phone_input import PhoneInput +from braintree.graphql.inputs.phone_input import PhoneInput, _GraphqlVariables as _PhoneInputGraphqlVariables + +@type_check_only +class _GraphqlVariables(TypedDict, total=False): + email: str + hashedEmail: str + phone: _PhoneInputGraphqlVariables + hashedPhoneNumber: str + deviceFingerprintId: str + paypalAppInstalled: bool + venmoAppInstalled: bool + userAgent: str class CustomerSessionInput: def __init__( @@ -15,7 +26,7 @@ class CustomerSessionInput: venmo_app_installed: bool | None = None, user_agent: str | None = None, ) -> None: ... - def to_graphql_variables(self) -> dict[str, Incomplete]: ... + def to_graphql_variables(self) -> _GraphqlVariables: ... @staticmethod def builder() -> Builder: ... diff --git a/stubs/braintree/braintree/graphql/inputs/monetary_amount_input.pyi b/stubs/braintree/braintree/graphql/inputs/monetary_amount_input.pyi index 0df5d9403592..f7180db3baa9 100644 --- a/stubs/braintree/braintree/graphql/inputs/monetary_amount_input.pyi +++ b/stubs/braintree/braintree/graphql/inputs/monetary_amount_input.pyi @@ -1,6 +1,11 @@ -from _typeshed import Incomplete from decimal import Decimal +from typing import TypedDict, type_check_only + +@type_check_only +class _GraphqlVariables(TypedDict, total=False): + value: str + currencyCode: str class MonetaryAmountInput: def __init__(self, value: Decimal | None = None, currency_code: str | None = None) -> None: ... - def to_graphql_variables(self) -> dict[str, Incomplete]: ... + def to_graphql_variables(self) -> _GraphqlVariables: ... diff --git a/stubs/braintree/braintree/graphql/inputs/payer_info_input.pyi b/stubs/braintree/braintree/graphql/inputs/payer_info_input.pyi new file mode 100644 index 000000000000..c9dfe835bd52 --- /dev/null +++ b/stubs/braintree/braintree/graphql/inputs/payer_info_input.pyi @@ -0,0 +1,28 @@ +from _typeshed import Incomplete +from typing import TypedDict, type_check_only + +from braintree.graphql.inputs.billing_address_input import _GraphqlVariables as _BillingAddressGraphqlVariables +from braintree.graphql.inputs.shipping_address_input import _GraphqlVariables as _ShippingAddressGraphqlVariables + +@type_check_only +class _GraphqlVariables(TypedDict, total=False): + billingAddress: _BillingAddressGraphqlVariables + email: str + givenName: str + phoneCountryCode: str + phoneNumber: str + shippingAddress: _ShippingAddressGraphqlVariables + surname: str + +class PayerInfoInput: + def __init__( + self, + billing_address: dict[str, Incomplete] | None = None, + email: str | None = None, + given_name: str | None = None, + phone_country_code: str | None = None, + phone_number: str | None = None, + shipping_address: dict[str, Incomplete] | None = None, + surname: str | None = None, + ) -> None: ... + def to_graphql_variables(self) -> _GraphqlVariables: ... diff --git a/stubs/braintree/braintree/graphql/inputs/paypal_payee_input.pyi b/stubs/braintree/braintree/graphql/inputs/paypal_payee_input.pyi index a9f1e8e81515..a2e3ddbb74cf 100644 --- a/stubs/braintree/braintree/graphql/inputs/paypal_payee_input.pyi +++ b/stubs/braintree/braintree/graphql/inputs/paypal_payee_input.pyi @@ -1,9 +1,14 @@ -from _typeshed import Incomplete +from typing import TypedDict, type_check_only from typing_extensions import Self +@type_check_only +class _GraphqlVariables(TypedDict, total=False): + emailAddress: str + clientId: str + class PayPalPayeeInput: def __init__(self, email_address: str | None = None, client_id: str | None = None) -> None: ... - def to_graphql_variables(self) -> dict[str, Incomplete]: ... + def to_graphql_variables(self) -> _GraphqlVariables: ... @staticmethod def builder() -> Builder: ... diff --git a/stubs/braintree/braintree/graphql/inputs/paypal_purchase_unit_input.pyi b/stubs/braintree/braintree/graphql/inputs/paypal_purchase_unit_input.pyi index cfb04ce7004f..3b47082f1a24 100644 --- a/stubs/braintree/braintree/graphql/inputs/paypal_purchase_unit_input.pyi +++ b/stubs/braintree/braintree/graphql/inputs/paypal_purchase_unit_input.pyi @@ -1,12 +1,20 @@ -from _typeshed import Incomplete +from typing import TypedDict, type_check_only from typing_extensions import Self -from braintree.graphql.inputs.monetary_amount_input import MonetaryAmountInput -from braintree.graphql.inputs.paypal_payee_input import PayPalPayeeInput +from braintree.graphql.inputs.monetary_amount_input import ( + MonetaryAmountInput, + _GraphqlVariables as _MonetaryAmountGraphqlVariables, +) +from braintree.graphql.inputs.paypal_payee_input import PayPalPayeeInput, _GraphqlVariables as _PayPalPayeeGraphqlVariables + +@type_check_only +class _GraphqlVariables(TypedDict, total=False): + payee: _PayPalPayeeGraphqlVariables + amount: _MonetaryAmountGraphqlVariables class PayPalPurchaseUnitInput: def __init__(self, amount: MonetaryAmountInput | None = None, payee: PayPalPayeeInput | None = None) -> None: ... - def to_graphql_variables(self) -> dict[str, Incomplete]: ... + def to_graphql_variables(self) -> _GraphqlVariables: ... @staticmethod def builder(amount: MonetaryAmountInput) -> Builder: ... diff --git a/stubs/braintree/braintree/graphql/inputs/phone_input.pyi b/stubs/braintree/braintree/graphql/inputs/phone_input.pyi index 255fcc4bba99..826be0708c00 100644 --- a/stubs/braintree/braintree/graphql/inputs/phone_input.pyi +++ b/stubs/braintree/braintree/graphql/inputs/phone_input.pyi @@ -1,11 +1,17 @@ -from _typeshed import Incomplete +from typing import TypedDict, type_check_only from typing_extensions import Self +@type_check_only +class _GraphqlVariables(TypedDict, total=False): + countryPhoneCode: str + phoneNumber: str + extensionNumber: str + 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) -> dict[str, Incomplete]: ... + def to_graphql_variables(self) -> _GraphqlVariables: ... @staticmethod def builder() -> Builder: ... diff --git a/stubs/braintree/braintree/graphql/inputs/shipping_address_input.pyi b/stubs/braintree/braintree/graphql/inputs/shipping_address_input.pyi new file mode 100644 index 000000000000..f941611a7d90 --- /dev/null +++ b/stubs/braintree/braintree/graphql/inputs/shipping_address_input.pyi @@ -0,0 +1,22 @@ +from typing import TypedDict, type_check_only + +@type_check_only +class _GraphqlVariables(TypedDict, total=False): + countryCode: str + extendedAddress: str + locality: str + postalCode: str + region: str + streetAddress: str + +class ShippingAddressInput: + def __init__( + self, + country_code_alpha2: str | None = None, + extended_address: str | None = None, + locality: str | None = None, + postal_code: str | None = None, + region: str | None = None, + street_address: str | None = None, + ) -> None: ... + def to_graphql_variables(self) -> _GraphqlVariables: ... 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 1652547ccebd..b8aea510803f 100644 --- a/stubs/braintree/braintree/graphql/inputs/update_customer_session_input.pyi +++ b/stubs/braintree/braintree/graphql/inputs/update_customer_session_input.pyi @@ -1,8 +1,21 @@ -from _typeshed import Incomplete +from typing import TypedDict, type_check_only from typing_extensions import Self -from braintree.graphql.inputs.customer_session_input import CustomerSessionInput -from braintree.graphql.inputs.paypal_purchase_unit_input import PayPalPurchaseUnitInput +from braintree.graphql.inputs.customer_session_input import ( + CustomerSessionInput, + _GraphqlVariables as _CustomerSessionGraphqlVariables, +) +from braintree.graphql.inputs.paypal_purchase_unit_input import ( + PayPalPurchaseUnitInput, + _GraphqlVariables as _PayPalPurchaseUnitGraphqlVariables, +) + +@type_check_only +class _GraphqlVariables(TypedDict, total=False): + sessionId: str + customer: _CustomerSessionGraphqlVariables + merchantAccountId: str + purchaseUnits: list[_PayPalPurchaseUnitGraphqlVariables] class UpdateCustomerSessionInput: def __init__( @@ -12,7 +25,7 @@ class UpdateCustomerSessionInput: merchant_account_id: str | None = None, purchase_units: list[PayPalPurchaseUnitInput] | None = None, ) -> None: ... - def to_graphql_variables(self) -> dict[str, Incomplete]: ... + def to_graphql_variables(self) -> _GraphqlVariables: ... @staticmethod def builder(session_id: str) -> Builder: ... diff --git a/stubs/braintree/braintree/local_payment_context.pyi b/stubs/braintree/braintree/local_payment_context.pyi new file mode 100644 index 000000000000..6c7684b01a46 --- /dev/null +++ b/stubs/braintree/braintree/local_payment_context.pyi @@ -0,0 +1,6 @@ +from _typeshed import Incomplete + +from braintree.attribute_getter import AttributeGetter + +class LocalPaymentContext(AttributeGetter): + def __init__(self, attributes: dict[str, Incomplete] | None = None) -> None: ... diff --git a/stubs/braintree/braintree/local_payment_context_gateway.pyi b/stubs/braintree/braintree/local_payment_context_gateway.pyi new file mode 100644 index 000000000000..d33094c1a900 --- /dev/null +++ b/stubs/braintree/braintree/local_payment_context_gateway.pyi @@ -0,0 +1,14 @@ +from _typeshed import Incomplete + +from braintree.error_result import ErrorResult +from braintree.graphql import CreateLocalPaymentContextInput +from braintree.successful_result import SuccessfulResult + +class LocalPaymentContextGateway: + CREATE_LOCAL_PAYMENT_CONTEXT: str + FIND_LOCAL_PAYMENT_CONTEXT: str + gateway: Incomplete + graphql_client: Incomplete + def __init__(self, gateway) -> None: ... + def create(self, input: CreateLocalPaymentContextInput) -> SuccessfulResult | ErrorResult: ... + def find(self, id) -> SuccessfulResult | ErrorResult: ... diff --git a/stubs/braintree/braintree/local_payment_type.pyi b/stubs/braintree/braintree/local_payment_type.pyi new file mode 100644 index 000000000000..cf897047f2aa --- /dev/null +++ b/stubs/braintree/braintree/local_payment_type.pyi @@ -0,0 +1,5 @@ +from typing import Final + +class LocalPaymentType: + CRYPTO: Final = "CRYPTO" + MBWAY: Final = "MBWAY" diff --git a/stubs/braintree/braintree/merchant_gateway.pyi b/stubs/braintree/braintree/merchant_gateway.pyi index 48dcbad24312..54773625e1b7 100644 --- a/stubs/braintree/braintree/merchant_gateway.pyi +++ b/stubs/braintree/braintree/merchant_gateway.pyi @@ -1,4 +1,5 @@ from _typeshed import Incomplete +from typing_extensions import deprecated from braintree.error_result import ErrorResult from braintree.successful_result import SuccessfulResult @@ -7,4 +8,5 @@ class MerchantGateway: gateway: Incomplete config: Incomplete def __init__(self, gateway) -> None: ... + @deprecated("gateway.merchant.create(...) is deprecated and will be removed in a future version.") def create(self, params: dict[str, Incomplete] | None) -> SuccessfulResult | ErrorResult: ... diff --git a/stubs/braintree/braintree/transaction.pyi b/stubs/braintree/braintree/transaction.pyi index ef2477266586..7a2711040d00 100644 --- a/stubs/braintree/braintree/transaction.pyi +++ b/stubs/braintree/braintree/transaction.pyi @@ -116,7 +116,7 @@ class Transaction(Resource): @staticmethod def update_details(transaction_id, params=None): ... @staticmethod - def void(transaction_id): ... + def void(transaction_id, params=None): ... @staticmethod def create(params): ... @staticmethod @@ -141,6 +141,7 @@ class Transaction(Resource): tax_amount: Decimal | None discount_amount: Decimal | None shipping_amount: Decimal | None + surcharge_amount: Decimal | None billing_details: Address credit_card_details: CreditCard packages: list[PackageDetails] diff --git a/stubs/braintree/braintree/transaction_gateway.pyi b/stubs/braintree/braintree/transaction_gateway.pyi index c3bfc8880708..6c86d2e17397 100644 --- a/stubs/braintree/braintree/transaction_gateway.pyi +++ b/stubs/braintree/braintree/transaction_gateway.pyi @@ -1,23 +1,25 @@ from _typeshed import Incomplete +from braintree.error_result import ErrorResult from braintree.resource_collection import ResourceCollection +from braintree.successful_result import SuccessfulResult from braintree.transaction import Transaction class TransactionGateway: gateway: Incomplete config: Incomplete def __init__(self, gateway) -> None: ... - def adjust_authorization(self, transaction_id, amount): ... - def clone_transaction(self, transaction_id, params): ... - def cancel_release(self, transaction_id): ... - def create(self, params): ... - def credit(self, params): ... + def adjust_authorization(self, transaction_id, amount) -> SuccessfulResult | ErrorResult | None: ... + def clone_transaction(self, transaction_id, params) -> SuccessfulResult | ErrorResult | None: ... + def cancel_release(self, transaction_id) -> SuccessfulResult | ErrorResult | None: ... + def create(self, params) -> SuccessfulResult | ErrorResult | None: ... + def credit(self, params) -> SuccessfulResult | ErrorResult | None: ... def find(self, transaction_id: str) -> Transaction: ... - def refund(self, transaction_id, amount_or_options=None): ... - def sale(self, params): ... + def refund(self, transaction_id, amount_or_options=None) -> SuccessfulResult | ErrorResult | None: ... + def sale(self, params) -> SuccessfulResult | ErrorResult | None: ... def search(self, *query) -> ResourceCollection: ... - def submit_for_settlement(self, transaction_id, amount=None, params=None): ... - def update_details(self, transaction_id, params=None): ... - def submit_for_partial_settlement(self, transaction_id, amount, params=None): ... - def package_tracking(self, transaction_id, params=None): ... - def void(self, transaction_id): ... + def submit_for_settlement(self, transaction_id, amount=None, params=None) -> SuccessfulResult | ErrorResult | None: ... + def update_details(self, transaction_id, params=None) -> SuccessfulResult | ErrorResult | None: ... + def submit_for_partial_settlement(self, transaction_id, amount, params=None) -> SuccessfulResult | ErrorResult | None: ... + def package_tracking(self, transaction_id, params=None) -> SuccessfulResult | ErrorResult | None: ... + def void(self, transaction_id, params=None) -> SuccessfulResult | ErrorResult | None: ... diff --git a/stubs/braintree/braintree/transaction_search.pyi b/stubs/braintree/braintree/transaction_search.pyi index 0bb4d9bb6c2f..e0dfa62b4764 100644 --- a/stubs/braintree/braintree/transaction_search.pyi +++ b/stubs/braintree/braintree/transaction_search.pyi @@ -1,6 +1,7 @@ from braintree.search import Search class TransactionSearch: + acquirer_reference_number: Search.TextNodeBuilder billing_company: Search.TextNodeBuilder billing_country_name: Search.TextNodeBuilder billing_extended_address: Search.TextNodeBuilder