Skip to content
Open
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
2 changes: 1 addition & 1 deletion stubs/braintree/METADATA.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version = "4.42.*"
version = "4.43.*"
upstream-repository = "https://github.com/braintree/braintree_python"
3 changes: 3 additions & 0 deletions stubs/braintree/braintree/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions stubs/braintree/braintree/apple_pay_card.pyi
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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): ...
Expand Down
2 changes: 2 additions & 0 deletions stubs/braintree/braintree/braintree_gateway.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
21 changes: 21 additions & 0 deletions stubs/braintree/braintree/error_codes.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
3 changes: 3 additions & 0 deletions stubs/braintree/braintree/graphql/__init__.pyi
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
5 changes: 5 additions & 0 deletions stubs/braintree/braintree/graphql/inputs/__init__.pyi
Original file line number Diff line number Diff line change
@@ -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
Expand Down
22 changes: 22 additions & 0 deletions stubs/braintree/braintree/graphql/inputs/billing_address_input.pyi
Original file line number Diff line number Diff line change
@@ -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: ...
Original file line number Diff line number Diff line change
@@ -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__(
Expand All @@ -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: ...

Expand Down
Original file line number Diff line number Diff line change
@@ -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: ...
Original file line number Diff line number Diff line change
@@ -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__(
Expand All @@ -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: ...

Expand Down
Original file line number Diff line number Diff line change
@@ -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__(
Expand All @@ -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: ...

Expand Down
Original file line number Diff line number Diff line change
@@ -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: ...
28 changes: 28 additions & 0 deletions stubs/braintree/braintree/graphql/inputs/payer_info_input.pyi
Original file line number Diff line number Diff line change
@@ -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: ...
Original file line number Diff line number Diff line change
@@ -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: ...

Expand Down
Original file line number Diff line number Diff line change
@@ -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: ...

Expand Down
10 changes: 8 additions & 2 deletions stubs/braintree/braintree/graphql/inputs/phone_input.pyi
Original file line number Diff line number Diff line change
@@ -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: ...

Expand Down
Loading