Skip to content

Commit b9d2de6

Browse files
committed
[braintree] Update to 4.43.*
Closes: #15689
1 parent 483fd73 commit b9d2de6

26 files changed

Lines changed: 291 additions & 40 deletions

stubs/braintree/METADATA.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version = "4.42.*"
1+
version = "4.43.*"
22
upstream-repository = "https://github.com/braintree/braintree_python"

stubs/braintree/braintree/__init__.pyi

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@ from braintree.europe_bank_account import EuropeBankAccount as EuropeBankAccount
4949
from braintree.graphql import *
5050
from braintree.liability_shift import LiabilityShift as LiabilityShift
5151
from braintree.local_payment_completed import LocalPaymentCompleted as LocalPaymentCompleted
52+
from braintree.local_payment_context import LocalPaymentContext as LocalPaymentContext
53+
from braintree.local_payment_context_gateway import LocalPaymentContextGateway as LocalPaymentContextGateway
5254
from braintree.local_payment_reversed import LocalPaymentReversed as LocalPaymentReversed
55+
from braintree.local_payment_type import LocalPaymentType as LocalPaymentType
5356
from braintree.merchant import Merchant as Merchant
5457
from braintree.merchant_account import MerchantAccount as MerchantAccount
5558
from braintree.merchant_account_gateway import MerchantAccountGateway as MerchantAccountGateway

stubs/braintree/braintree/apple_pay_card.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from _typeshed import Incomplete
22
from typing import Final
33

4+
from braintree.credit_card_verification import CreditCardVerification
45
from braintree.resource import Resource
56
from braintree.subscription import Subscription
67

@@ -12,6 +13,7 @@ class ApplePayCard(Resource):
1213

1314
is_expired: Incomplete
1415
subscriptions: list[Subscription]
16+
verification: CreditCardVerification | None
1517
def __init__(self, gateway, attributes) -> None: ...
1618
@property
1719
def expiration_date(self): ...

stubs/braintree/braintree/braintree_gateway.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ from braintree.discount_gateway import DiscountGateway
1111
from braintree.dispute_gateway import DisputeGateway
1212
from braintree.document_upload_gateway import DocumentUploadGateway
1313
from braintree.exchange_rate_quote_gateway import ExchangeRateQuoteGateway
14+
from braintree.local_payment_context_gateway import LocalPaymentContextGateway as LocalPaymentContextGateway
1415
from braintree.merchant_account_gateway import MerchantAccountGateway
1516
from braintree.merchant_gateway import MerchantGateway
1617
from braintree.oauth_gateway import OAuthGateway
@@ -44,6 +45,7 @@ class BraintreeGateway:
4445
dispute: DisputeGateway
4546
document_upload: DocumentUploadGateway
4647
exchange_rate_quote: ExchangeRateQuoteGateway
48+
local_payment_context: LocalPaymentContextGateway
4749
graphql_client: GraphQLClient
4850
merchant: MerchantGateway
4951
merchant_account: MerchantAccountGateway

stubs/braintree/braintree/error_codes.pyi

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ class ErrorCodes:
5353
MerchantNotConfigured: Final = "93514"
5454
MerchantKeysAlreadyConfigured: Final = "93515"
5555
MerchantKeysNotConfigured: Final = "93516"
56+
NetworkTransactionIdNotAllowed: Final = "93532"
5657
CertificateInvalid: Final = "93517"
5758
CertificateMismatch: Final = "93519"
5859
InvalidToken: Final = "83520"
@@ -61,6 +62,18 @@ class ErrorCodes:
6162
CustomerIdIsInvalid: Final = "93528"
6263
BillingAddressFormatIsInvalid: Final = "93529"
6364

65+
class Options:
66+
class Verification:
67+
AccountTypeIsInvalid: Final = "93538"
68+
AccountTypeNotSupported: Final = "93543"
69+
AmountCannotBeNegative: Final = "93535"
70+
AmountFormatIsInvalid: Final = "93534"
71+
AmountIsTooLarge: Final = "93537"
72+
AmountNotSupportedByProcessor: Final = "93536"
73+
MerchantAccountIdIsInvalid: Final = "93540"
74+
MerchantAccountIsSuspended: Final = "93541"
75+
NotSupportedByProcessor: Final = "93533"
76+
6477
class AuthorizationFingerprint:
6578
MissingFingerprint: Final = "93201"
6679
InvalidFormat: Final = "93202"
@@ -157,6 +170,8 @@ class ErrorCodes:
157170
IdIsNotAllowed: Final = "91611"
158171
IdIsRequired: Final = "91613"
159172
IdIsTooLong: Final = "91612"
173+
InternationalPhoneCountryCodeIsInvalid: Final = "91625"
174+
InternationalPhoneNationalNumberIsInvalid: Final = "91626"
160175
LastNameIsTooLong: Final = "81613"
161176
PhoneIsTooLong: Final = "81614"
162177
VaultedPaymentInstrumentNonceBelongsToDifferentCustomer: Final = "91617"
@@ -478,6 +493,12 @@ class ErrorCodes:
478493
DiscountAmountFormatIsInvalid: Final = "915159"
479494
DiscountAmountIsTooLarge: Final = "915161"
480495
ExchangeRateQuoteIdIsTooLong: Final = "915229"
496+
ApiRequestKeyTooLong: Final = "915230"
497+
ApiRequestKeyNotAllowed: Final = "915231"
498+
ApiRequestKeyCanBeReusedOnlyWithTheSameRequest: Final = "915232"
499+
ApiRequestKeyIsInFlight: Final = "915233"
500+
ApiRequestKeyWithFailedRequest: Final = "915234"
501+
ApiRequestKeyServerError: Final = "915235"
481502
FailedAuthAdjustmentAllowRetry: Final = "95603"
482503
FailedAuthAdjustmentHardDecline: Final = "95602"
483504
FinalAuthSubmitForSettlementForDifferentAmount: Final = "95601"

stubs/braintree/braintree/graphql/__init__.pyi

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
from braintree.graphql.enums import Recommendations as Recommendations, RecommendedPaymentOption as RecommendedPaymentOption
22
from braintree.graphql.inputs import (
3+
BillingAddressInput as BillingAddressInput,
34
CreateCustomerSessionInput as CreateCustomerSessionInput,
5+
CreateLocalPaymentContextInput as CreateLocalPaymentContextInput,
46
CustomerRecommendationsInput as CustomerRecommendationsInput,
57
CustomerSessionInput as CustomerSessionInput,
68
MonetaryAmountInput as MonetaryAmountInput,
9+
PayerInfoInput as PayerInfoInput,
710
PayPalPayeeInput as PayPalPayeeInput,
811
PayPalPurchaseUnitInput as PayPalPurchaseUnitInput,
912
PhoneInput as PhoneInput,

stubs/braintree/braintree/graphql/inputs/__init__.pyi

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1+
from braintree.graphql.inputs.billing_address_input import BillingAddressInput as BillingAddressInput
12
from braintree.graphql.inputs.create_customer_session_input import CreateCustomerSessionInput as CreateCustomerSessionInput
3+
from braintree.graphql.inputs.create_local_payment_context_input import (
4+
CreateLocalPaymentContextInput as CreateLocalPaymentContextInput,
5+
)
26
from braintree.graphql.inputs.customer_recommendations_input import CustomerRecommendationsInput as CustomerRecommendationsInput
37
from braintree.graphql.inputs.customer_session_input import CustomerSessionInput as CustomerSessionInput
48
from braintree.graphql.inputs.monetary_amount_input import MonetaryAmountInput as MonetaryAmountInput
9+
from braintree.graphql.inputs.payer_info_input import PayerInfoInput as PayerInfoInput
510
from braintree.graphql.inputs.paypal_payee_input import PayPalPayeeInput as PayPalPayeeInput
611
from braintree.graphql.inputs.paypal_purchase_unit_input import PayPalPurchaseUnitInput as PayPalPurchaseUnitInput
712
from braintree.graphql.inputs.phone_input import PhoneInput as PhoneInput
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
from typing import TypedDict, type_check_only
2+
3+
@type_check_only
4+
class _GraphqlVariables(TypedDict, total=False):
5+
countryCode: str
6+
extendedAddress: str
7+
locality: str
8+
postalCode: str
9+
region: str
10+
streetAddress: str
11+
12+
class BillingAddressInput:
13+
def __init__(
14+
self,
15+
country_code_alpha2: str | None = None,
16+
extended_address: str | None = None,
17+
locality: str | None = None,
18+
postal_code: str | None = None,
19+
region: str | None = None,
20+
street_address: str | None = None,
21+
) -> None: ...
22+
def to_graphql_variables(self) -> _GraphqlVariables: ...

stubs/braintree/braintree/graphql/inputs/create_customer_session_input.pyi

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,22 @@
1-
from _typeshed import Incomplete
1+
from typing import TypedDict, type_check_only
22
from typing_extensions import Self
33

4-
from braintree.graphql.inputs.customer_session_input import CustomerSessionInput
5-
from braintree.graphql.inputs.paypal_purchase_unit_input import PayPalPurchaseUnitInput
4+
from braintree.graphql.inputs.customer_session_input import (
5+
CustomerSessionInput,
6+
_GraphqlVariables as _CustomerSessionGraphqlVariables,
7+
)
8+
from braintree.graphql.inputs.paypal_purchase_unit_input import (
9+
PayPalPurchaseUnitInput,
10+
_GraphqlVariables as _PayPalPurchaseUnitGraphqlVariables,
11+
)
12+
13+
@type_check_only
14+
class _GraphqlVariables(TypedDict, total=False):
15+
merchantAccountId: str
16+
sessionId: str
17+
customer: _CustomerSessionGraphqlVariables
18+
domain: str
19+
purchaseUnits: list[_PayPalPurchaseUnitGraphqlVariables]
620

721
class CreateCustomerSessionInput:
822
def __init__(
@@ -13,7 +27,7 @@ class CreateCustomerSessionInput:
1327
domain: str | None = None,
1428
purchase_units: list[PayPalPurchaseUnitInput] | None = None,
1529
) -> None: ...
16-
def to_graphql_variables(self) -> dict[str, Incomplete]: ...
30+
def to_graphql_variables(self) -> _GraphqlVariables: ...
1731
@staticmethod
1832
def builder() -> Builder: ...
1933

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
from _typeshed import Incomplete
2+
from typing import TypedDict, type_check_only
3+
4+
from braintree.graphql.inputs.monetary_amount_input import _GraphqlVariables as _MonetaryAmountGraphqlVariables
5+
from braintree.graphql.inputs.payer_info_input import _GraphqlVariables as _PayerInfoGraphqlVariables
6+
7+
@type_check_only
8+
class _PaymentContext(TypedDict, total=False):
9+
amount: _MonetaryAmountGraphqlVariables
10+
cancelUrl: str
11+
countryCode: str
12+
expiryDate: str
13+
merchantAccountId: str
14+
orderId: str
15+
payerInfo: _PayerInfoGraphqlVariables
16+
returnUrl: str
17+
type: str
18+
19+
@type_check_only
20+
class _GraphqlVariables(TypedDict):
21+
paymentContext: _PaymentContext
22+
23+
class CreateLocalPaymentContextInput:
24+
def __init__(
25+
self,
26+
amount: dict[str, Incomplete] | None = None,
27+
cancel_url: str | None = None,
28+
country_code: str | None = None,
29+
expiry_date: str | None = None,
30+
merchant_account_id: str | None = None,
31+
order_id: str | None = None,
32+
payer_info: dict[str, Incomplete] | None = None,
33+
return_url: str | None = None,
34+
type: str | None = None,
35+
) -> None: ...
36+
def to_graphql_variables(self) -> _GraphqlVariables: ...

0 commit comments

Comments
 (0)