Skip to content

Commit fe56253

Browse files
committed
3.55.0
1 parent 3edadc1 commit fe56253

16 files changed

+180
-29
lines changed

CHANGELOG.md

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,24 @@
1-
## unreleased
2-
* Add `braintree.exceptions.http.timeout_error.ConnectTimeoutError`
3-
* Add `braintree.exceptions.http.timeout_error.ReadTimeoutError`
4-
* Raise introduced exceptions while allowing for backwards compatibility through inheritance.
1+
## 3.55.0
2+
* Add `captureId` field to local_payment_details
3+
* Add `refundId` field to local_payment_details
4+
* Add `debugId` field to local_payment_details
5+
* Add `transactionFeeAmount` field to local_payment_details
6+
* Add `transactionFeeCurrencyIsoCode` field to local_payment_details
7+
* Add `refundFromTransactionFeeAmount` field to local_payment_details
8+
* Add `refundFromTransactionFeeCurrencyIsoCode` field to local_payment_details
9+
* Add `ds_transaction_id` and `three_d_secure_version` to 3DS pass thru fields
10+
* Add `payer_info` field to payment_method_nonce details
11+
* Add more specific timeout errors: (#105 thanks @bhargavrpatel)
12+
* Add `braintree.exceptions.http.timeout_error.ConnectTimeoutError` (child class of TimeoutError)
13+
* Add `braintree.exceptions.http.timeout_error.ReadTimeoutError` (child class of TimeoutError)
14+
* Add `room_tax` support for transaction sale
15+
* Add `no_show` support for transaction sale
16+
* Add `advanced_deposit` support for transaction sale
17+
* Add `fire_safe` support for transaction sale
18+
* Add `property_phone` support for transaction sale
19+
* Add `additional_charges` support for transaction sale
20+
* Add `PostalCodeIsRequiredForCardBrandAndProcessor` to validation errors
21+
* Fix issue where not found error could choke on `None` values (#109)
522

623
## 3.54.0
724
* Add `payment_method_nonce` field to `LocalPaymentCompleted` webhook

braintree/credit_card_gateway.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def from_nonce(self, nonce):
5555
response = self.config.http().get(self.config.base_merchant_path() + "/payment_methods/from_nonce/" + nonce)
5656
return CreditCard(self.gateway, response["credit_card"])
5757
except NotFoundError:
58-
raise NotFoundError("payment method with nonce " + nonce + " locked, consumed or not found")
58+
raise NotFoundError("payment method with nonce " + repr(nonce) + " locked, consumed or not found")
5959

6060
def tr_data_for_create(self, tr_data, redirect_url):
6161
Resource.verify_keys(tr_data, [{"credit_card": CreditCard.create_signature()}])

braintree/error_codes.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class Address(object):
3232
PostalCodeInvalidCharacters = "81813"
3333
PostalCodeIsInvalid = "91826"
3434
PostalCodeIsRequired = "81808"
35+
PostalCodeIsRequiredForCardBrandAndProcessor = "81828"
3536
PostalCodeIsTooLong = "81809"
3637
RegionIsInvalid = "91825"
3738
RegionIsTooLong = "81810"
@@ -624,6 +625,17 @@ class Lodging(object):
624625
CheckOutDateIsInvalid = "93405"
625626
CheckOutDateMustFollowCheckInDate = "93406"
626627
UnknownDataField = "93407"
628+
RoomRateMustBeGreaterThanZero = "93433"
629+
RoomRateFormatIsInvalid = "93434"
630+
RoomRateIsTooLarge = "93435"
631+
RoomTaxMustBeGreaterThanZero = "93436"
632+
RoomTaxFormatIsInvalid = "93437"
633+
RoomTaxIsTooLarge = "93438"
634+
NoShowIndicatorIsInvalid = "93439"
635+
AdvancedDepositIndicatorIsInvalid = "93440"
636+
FireSafetyIndicatorIsInvalid = "93441"
637+
PropertyPhoneIsInvalid = "93442"
638+
627639
class TravelCruise(object):
628640
EmptyData = "93408"
629641
UnknownDataField = "93409"
@@ -675,6 +687,14 @@ class TravelFlight(object):
675687
TaxAmountIsTooLarge = "96319"
676688
TicketNumberIsTooLong = "96320"
677689

690+
class AdditionalCharge(object):
691+
KindIsInvalid = "96601"
692+
KindMustBeUnique = "96602"
693+
AmountMustBeGreaterThanZero = "96603"
694+
AmountFormatIsInvalid = "96604"
695+
AmountIsTooLarge = "96605"
696+
AmountIsRequired = "96606"
697+
678698
class LineItem(object):
679699
CommodityCodeIsTooLong = "95801"
680700
DescriptionIsTooLong = "95803"

braintree/payment_method_nonce_gateway.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,17 @@ def create(self, payment_method_token):
2121
payment_method_nonce = self._parse_payment_method_nonce(response)
2222
return SuccessfulResult({"payment_method_nonce": payment_method_nonce})
2323
except NotFoundError:
24-
raise NotFoundError("payment method with token " + payment_method_token + " not found")
24+
raise NotFoundError("payment method with token " + repr(payment_method_token) + " not found")
2525

2626
def find(self, payment_method_nonce):
2727
try:
28+
if payment_method_nonce is None or payment_method_nonce.strip() == "":
29+
raise NotFoundError()
30+
2831
response = self.config.http().get(self.config.base_merchant_path() + "/payment_method_nonces/" + payment_method_nonce)
2932
return self._parse_payment_method_nonce(response)
3033
except NotFoundError:
31-
raise NotFoundError("payment method nonce with id " + payment_method_nonce + " not found")
34+
raise NotFoundError("payment method nonce with id " + repr(payment_method_nonce) + " not found")
3235

3336
def _parse_payment_method_nonce(self, response):
3437
return PaymentMethodNonce(self.gateway, response["payment_method_nonce"])

braintree/subscription_gateway.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def find(self, subscription_id):
3535
response = self.config.http().get(self.config.base_merchant_path() + "/subscriptions/" + subscription_id)
3636
return Subscription(self.gateway, response["subscription"])
3737
except NotFoundError:
38-
raise NotFoundError("subscription with id " + subscription_id + " not found")
38+
raise NotFoundError("subscription with id " + repr(subscription_id) + " not found")
3939

4040
def retry_charge(self, subscription_id, amount=None, submit_for_settlement=False):
4141
response = self.config.http().post(self.config.base_merchant_path() + "/transactions", {"transaction": {

braintree/test/nonces.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class Nonces(object):
4040
ProcessorDeclinedAmEx = "fake-processor-declined-amex-nonce"
4141
ProcessorDeclinedDiscover = "fake-processor-declined-discover-nonce"
4242
ProcessorFailureJCB = "fake-processor-failure-jcb-nonce"
43-
LocalPayment = "fake-local-payment-nonce"
43+
LocalPayment = "fake-local-payment-method-nonce"
4444
LuhnInvalid = "fake-luhn-invalid-nonce"
4545
PayPalFuturePaymentRefreshToken = "fake-paypal-future-refresh-token-nonce"
4646
SEPA = "fake-sepa-bank-account-nonce"

braintree/transaction.py

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,16 +209,18 @@ class Status(object):
209209
"""
210210
Constants representing transaction statuses. Available statuses are:
211211
212+
* braintree.Transaction.Status.AuthorizationExpired
212213
* braintree.Transaction.Status.Authorized
213214
* braintree.Transaction.Status.Authorizing
215+
* braintree.Transaction.Status.SettlementPending
216+
* braintree.Transaction.Status.SettlementDeclined
214217
* braintree.Transaction.Status.Failed
215218
* braintree.Transaction.Status.GatewayRejected
216219
* braintree.Transaction.Status.ProcessorDeclined
217220
* braintree.Transaction.Status.Settled
218-
* braintree.Transaction.Status.SettlementFailed
219221
* braintree.Transaction.Status.Settling
220222
* braintree.Transaction.Status.SubmittedForSettlement
221-
* braintree.Transaction.Status.Void
223+
* braintree.Transaction.Status.Voided
222224
"""
223225

224226
AuthorizationExpired = "authorization_expired"
@@ -235,6 +237,7 @@ class Status(object):
235237
Settling = "settling"
236238
SubmittedForSettlement = "submitted_for_settlement"
237239
Voided = "voided"
240+
# NEXT_MAJOR_VERSION this is never used and should be removed
238241
Unrecognized = "unrecognized"
239242

240243
class Type(object):
@@ -253,6 +256,14 @@ class IndustryType(object):
253256
TravelAndCruise = "travel_cruise"
254257
TravelAndFlight = "travel_flight"
255258

259+
class AdditionalCharge(object):
260+
Restaurant = "restaurant"
261+
GiftShop = "gift_shop"
262+
MiniBar = "mini_bar"
263+
Telephone = "telephone"
264+
Laundry = "laundry"
265+
Other = "other"
266+
256267
@staticmethod
257268
def clone_transaction(transaction_id, params):
258269
return Configuration.gateway().transaction.clone_transaction(transaction_id, params)
@@ -551,7 +562,9 @@ def create_signature():
551562
"xid",
552563
"authentication_response",
553564
"directory_response",
554-
"cavv_algorithm"
565+
"cavv_algorithm",
566+
"ds_transaction_id",
567+
"three_d_secure_version"
555568
]
556569
},
557570
{
@@ -617,12 +630,17 @@ def create_signature():
617630
"data": [
618631
"folio_number", "check_in_date", "check_out_date", "departure_date", "lodging_check_in_date", "lodging_check_out_date", "travel_package", "lodging_name", "room_rate",
619632
"passenger_first_name", "passenger_last_name", "passenger_middle_initial", "passenger_title", "issued_date", "travel_agency_name", "travel_agency_code", "ticket_number",
620-
"issuing_carrier_code", "customer_code", "fare_amount", "fee_amount", "tax_amount", "restricted_ticket",
633+
"issuing_carrier_code", "customer_code", "fare_amount", "fee_amount", "room_tax", "tax_amount", "restricted_ticket", "no_show", "advanced_deposit", "fire_safe", "property_phone",
621634
{
622635
"legs": [
623636
"conjunction_ticket", "exchange_ticket", "coupon_number", "service_class", "carrier_code", "fare_basis_code", "flight_number", "departure_date", "departure_airport_code", "departure_time",
624637
"arrival_airport_code", "arrival_time", "stopover_permitted", "fare_amount", "fee_amount", "tax_amount", "endorsement_or_restrictions"
625638
]
639+
},
640+
{
641+
"additional_charges": [
642+
"kind", "amount"
643+
],
626644
}
627645
]
628646
}

braintree/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Version = "3.54.0"
1+
Version = "3.55.0"

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
setup(
1414
name="braintree",
15-
version="3.54.0",
15+
version="3.55.0",
1616
description="Braintree Python Library",
1717
long_description=long_description,
1818
author="Braintree",

tests/integration/test_credit_card.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,9 +1109,7 @@ def test_expired_can_iterate_over_all_items(self):
11091109
CreditCard.create({
11101110
"customer_id": customer_id,
11111111
"number": "4111111111111111",
1112-
"expiration_date": "05/2014",
1113-
"cvv": "100",
1114-
"cardholder_name": "John Doe"
1112+
"expiration_date": "01/2015"
11151113
})
11161114

11171115
collection = CreditCard.expired()

0 commit comments

Comments
 (0)