Skip to content

Commit

Permalink
4.31.0
Browse files Browse the repository at this point in the history
Co-authored-by: klaguerre <klaguerre@paypal.com>
  • Loading branch information
braintreeps and klaguerrePay committed Oct 29, 2024
1 parent ca488de commit 6aa9005
Show file tree
Hide file tree
Showing 35 changed files with 709 additions and 206 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @braintree/team-sdk-server
* @PayPal-Braintree/team-sdk-server
3 changes: 3 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
# Checklist

- [ ] Added changelog entry
- [ ] I alphabetized all attributes, parameters, and methods by name in any class file I changed
- [ ] Ran unit tests (`python3 -m unittest discover tests/unit`)
- [ ] I have linked the JIRA ticket in the summary section
- [ ] I have reviewed the JIRA ticket to ensure all AC's are met
- [ ] I understand that unless this is a Draft PR or has a DO NOT MERGE label, this PR is considered to be in a deploy ready state and can be deployed if merged to main

<!-- **For Braintree Developers only, don't forget:**
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 4.31.0
* Add `fail_on_duplicate_payment_method_for_customer` option to
* `ClientToken`
* `PaymentMethod`
* `CreditCard`
* Add `blik_aliases` to LocalPaymentCompleted webhook and LocalPaymentDetail
* Deprecate `samsung_pay_card`
* Updated expiring pinned vendor SSL certificates

## 4.30.0
* Add `payer_name`, `bic` and `iban_last_chars` to LocalPaymentCompleted webhook
* Add `edit_paypal_vault_id` to PayPalAccount
Expand Down
1 change: 1 addition & 0 deletions braintree/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from braintree.android_pay_card import AndroidPayCard
from braintree.apple_pay_card import ApplePayCard
from braintree.apple_pay_gateway import ApplePayGateway
from braintree.blik_alias import BlikAlias
from braintree.braintree_gateway import BraintreeGateway
from braintree.client_token import ClientToken
from braintree.configuration import Configuration
Expand Down
15 changes: 15 additions & 0 deletions braintree/blik_alias.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import braintree

from braintree.resource import Resource

class BlikAlias(Resource):
"""
A class representing a BlikAlias.
For more information on BlikAliases, see https://developer.paypal.com/braintree/docs/guides/local-payment-methods/blik-one-click
"""

def __init__(self, gateway, attributes):
Resource.__init__(self, gateway, attributes)

2 changes: 1 addition & 1 deletion braintree/client_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ def generate_signature():
"proxy_merchant_id",
"version",
{"domains": ["__any_key__"]},
{"options": ["make_default", "verify_card", "fail_on_duplicate_payment_method"]}
{"options": ["fail_on_duplicate_payment_method", "fail_on_duplicate_payment_method_for_customer", "make_default", "verify_card"]}
]
2 changes: 1 addition & 1 deletion braintree/client_token_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def generate(self, params=None):
if params is None:
params = {}
if "options" in params and "customer_id" not in params:
for option in ["verify_card", "make_default", "fail_on_duplicate_payment_method"]:
for option in ["fail_on_duplicate_payment_method", "fail_on_duplicate_payment_method_for_customer", "make_default", "verify_card"]:
if option in params["options"]:
raise exceptions.InvalidSignatureError("cannot specify %s without a customer_id" % option)

Expand Down
1 change: 1 addition & 0 deletions braintree/credit_card.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ def signature(type):

options = [
"fail_on_duplicate_payment_method",
"fail_on_duplicate_payment_method_for_customer",
"make_default",
"skip_advanced_fraud_checking",
"venmo_sdk_session", # NEXT_MJOR_VERSION remove venmo_sdk_session
Expand Down
2 changes: 2 additions & 0 deletions braintree/customer.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from braintree.ids_search import IdsSearch
from braintree.exceptions.not_found_error import NotFoundError
from braintree.resource_collection import ResourceCollection
# NEXT_MAJOR_VERSION remove SamsungPayCard
from braintree.samsung_pay_card import SamsungPayCard


Expand Down Expand Up @@ -273,6 +274,7 @@ def __init__(self, gateway, attributes):
self.masterpass_cards = [MasterpassCard(gateway, masterpass_card) for masterpass_card in self.masterpass_cards]
self.payment_methods += self.masterpass_cards

# NEXT_MAJOR_VERSION remove all deprecated SamsungPayCard
if "samsung_pay_cards" in attributes:
self.samsung_pay_cards = [SamsungPayCard(gateway, samsung_pay_card) for samsung_pay_card in self.samsung_pay_cards]
self.payment_methods += self.samsung_pay_cards
3 changes: 3 additions & 0 deletions braintree/error_codes.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ class AuthorizationFingerprint(object):
class ClientToken(object):
CustomerDoesNotExist = "92804"
FailOnDuplicatePaymentMethodRequiresCustomerId = "92803"
FailOnDuplicatePaymentMethodForCustomerRequiresCustomerId = "92805"
InvalidDomainFormat = "92011"
MakeDefaultRequiresCustomerId = "92801"
MerchantAccountDoesNotExist = "92807"
Expand All @@ -105,6 +106,7 @@ class CreditCard(object):
CvvIsRequired = "81706"
CvvVerificationFailed = "81736"
DuplicateCardExists = "81724"
DuplicateCardExistsForCustomer = "81763"
ExpirationDateConflict = "91708"
ExpirationDateIsInvalid = "81710"
ExpirationDateIsRequired = "81709"
Expand All @@ -113,6 +115,7 @@ class CreditCard(object):
ExpirationYearIsInvalid = "81713"
InvalidParamsForCreditCardUpdate = "91745"
InvalidVenmoSDKPaymentMethodCode = "91727" # NEXT_MJOR_VERSION remove this code
LimitExceededforDuplicatePaymentMethodCheckForCustomer = "81764"
NetworkTokenizationAttributeCryptogramIsRequired = "81762"
NumberHasInvalidLength = NumberLengthIsInvalid = "81716"
NumberIsInvalid = "81715"
Expand Down
3 changes: 3 additions & 0 deletions braintree/local_payment_completed.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from braintree.blik_alias import BlikAlias
from braintree.resource import Resource
from braintree.transaction import Transaction

Expand All @@ -7,3 +8,5 @@ def __init__(self, gateway, attributes):

if "transaction" in attributes:
self.transaction = Transaction(gateway, attributes.pop("transaction"))
if "blik_aliases" in attributes:
self.blik_aliases = [BlikAlias(gateway, blik_alias) for blik_alias in self.blik_aliases]
4 changes: 2 additions & 2 deletions braintree/payment_instrument_type.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

class PaymentInstrumentType():
# NEXT_MAJOR_VERSION remove amex express checkout
# NEXT_MAJOR_VERSION remove masterpass
# NEXT_MAJOR_VERSION remove amex express checkout, masterpass,
# and SamsungPayCard. They have been deprecated
AmexExpressCheckoutCard = "amex_express_checkout_card"
AndroidPayCard = "android_pay_card"
ApplePayCard = "apple_pay_card"
Expand Down
2 changes: 2 additions & 0 deletions braintree/payment_method.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def create_signature():
def signature(type):
options = [
"fail_on_duplicate_payment_method",
"fail_on_duplicate_payment_method_for_customer",
"make_default",
"skip_advanced_fraud_checking",
"us_bank_account_verification_method",
Expand Down Expand Up @@ -119,6 +120,7 @@ def update_signature():
"device_session_id", "fraud_merchant_id", # NEXT_MAJOR_VERSION remove device_session_id and fraud_merchant_id
{
"options": [
"fail_on_duplicate_payment_method_for_customer",
"make_default",
"skip_advanced_fraud_checking",
"us_bank_account_verification_method",
Expand Down
4 changes: 4 additions & 0 deletions braintree/payment_method_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from braintree.visa_checkout_card import VisaCheckoutCard
# NEXT_MAJOR_VERSION remove masterpass
from braintree.masterpass_card import MasterpassCard
# NEXT_MAJOR_VERSION remove SamsungPayCard
from braintree.samsung_pay_card import SamsungPayCard
from braintree.unknown_payment_method import UnknownPaymentMethod
from braintree.error_result import ErrorResult
Expand Down Expand Up @@ -159,3 +160,6 @@ def __check_for_deprecated_attributes(self, params):
warnings.warn("fraud_merchant_id is deprecated, use device_data parameter instead", DeprecationWarning)
if "venmo_sdk_payment_method_code" in params.keys() or "venmo_sdk_session" in params.keys():
warnings.warn("The Venmo SDK integration is Unsupported. Please update your integration to use Pay with Venmo instead.", DeprecationWarning)
if "samsung_pay_card" in params.keys():
warnings.warn("SamsungPay is deprecated", DeprecationWarning)

1 change: 1 addition & 0 deletions braintree/payment_method_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from braintree.visa_checkout_card import VisaCheckoutCard
from braintree.masterpass_card import MasterpassCard
from braintree.sepa_direct_debit_account import SepaDirectDebitAccount
# NEXT_MAJOR_VERSION remove SamsungPayCard
from braintree.samsung_pay_card import SamsungPayCard
from braintree.unknown_payment_method import UnknownPaymentMethod

Expand Down
2 changes: 2 additions & 0 deletions braintree/samsung_pay_card.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
from braintree.address import Address
from braintree.resource import Resource

# NEXT_MAJOR_VERSION remove this class
# SamsungPay is deprecated
class SamsungPayCard(Resource):
def __init__(self, gateway, attributes):
Resource.__init__(self, gateway, attributes)
Expand Down
Loading

0 comments on commit 6aa9005

Please sign in to comment.