Closed jimrrchen closed 6 years ago
@jimrrchen Please reach out to Braintree support -- they'll be able to help you debug issues surrounding specific transactions.
This is not related to a specific transaction. All transactions with authorization adjustments or status events fail to get fetched by the API.
Eg :
Results :
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 1, in <dictcomp>
File "/home/ubuntu/venv/local/lib/python2.7/site-packages/braintree/resource_collection.py", line 38, in items
for item in self.__method(self.__query, batch):
File "/home/ubuntu/venv/local/lib/python2.7/site-packages/braintree/transaction_gateway.py", line 159, in __fetch
return [Transaction(self.gateway, item) for item in ResourceCollection._extract_as_array(response["credit_card_transactions"], "transaction")]
File "/home/ubuntu/venv/local/lib/python2.7/site-packages/braintree/transaction.py", line 676, in __init__
self.authorization_adjustments = [AuthorizationAdjustment(authorization_adjustment) for authorization_adjustment in self.authorization_adjustments]
File "/home/ubuntu/venv/local/lib/python2.7/site-packages/braintree/authorization_adjustment.py", line 8, in __init__
self.amount = Decimal(self.amount)
File "/usr/lib/python2.7/decimal.py", line 657, in __new__
raise TypeError("Cannot convert %r to Decimal" % value)
TypeError: Cannot convert None to Decimal
Please fix the lib to import such transactions. Amount should be None if the API return None.
Hey @jimrrchen @Antwan86 !
We were able to reproduce this error, and the fix is on its way.
The fix is released in 3.39.0. Please update to latest version. Thank you for pointing out the issue. 🥂
Hey,
I'm getting "TypeError: Cannot convert None to Decimal" whenever I tried to fetch some certain transactions. Here are the tracebacks. The transaction looks fine in Braintree dashboard.