You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Language, language version, and OS: Python 3.8.6 (python:3.8-buster Docker image)
Issue description
Test disbursement webhook notifications are missing the disbursement_type attribute, causing the is_credit() and is_debit() methods to throw AttributeErrors:
>>> webhook_notification = self.gateway.webhook_testing.sample_notification(
>>> braintree.WebhookNotification.Kind.Disbursement,
>>> "test_disbursement_id",
>>> )
>>> webhook_notification.disbursement.is_credit()
Traceback (most recent call last):
File "<pudb command line>", line 1, in <module>
File "/usr/local/lib/python3.8/site-packages/braintree/disbursement.py", line 27, in is_credit
return self.disbursement_type == Disbursement.Type.Credit
AttributeError: 'Disbursement' object has no attribute 'disbursement_type'
The text was updated successfully, but these errors were encountered:
I held off submitting a PR for this while I waited for some real webhook data to come through from our sandbox environment. It seems like the disbursement type field is coming through as None, whereas the tests and documentation imply that it should always be "credit" or "debit".
I'm not sure which bit is incorrect, the documentation and the tests or the API response! I think I'll have to leave this one to you.
Here's an example of a parsed notification we received:
General information
python:3.8-buster
Docker image)Issue description
Test disbursement webhook notifications are missing the
disbursement_type
attribute, causing theis_credit()
andis_debit()
methods to throwAttributeErrors
:The text was updated successfully, but these errors were encountered: