Open bcdickinson opened 3 years ago
Would you like to open a PR to fix this? If not, we'll add it to our backlog to fix. Thanks for bringing this to our attention!
Thanks for getting back to me.
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:
<WebhookNotification {kind: 'disbursement', timestamp: datetime.datetime(2021, 2, 23, 6, 20, 56), subject: {'disbursement': {'id': 'abcdef', 'merchant_account': {'status': 'active', 'id': '<snip>', 'currency_iso_code': 'GBP', 'default': True, 'sub_merchant_account': False}, 'exception_message': None, 'amount': '10.00', 'disbursement_date': datetime.date(2021, 2, 23), 'disbursement_type': None, 'follow_up_action': None, 'success': True, 'retry': False, 'transaction_ids': ['<snip>']}}} at 140366520028080>
for internal tracking, ticket 842
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
: