sdk_python
sdk_python copied to clipboard
Event object Payment.counterparty_alias is None
Steps to reproduce:
- Request events with the endpoint.Event.list()
- If an event has event.object_.Payment defined both the counterparty_alias.label_monetary_account and counterparty_alias.pointer are None
Quick test code:
# Get payments
payments = endpoint.Payment.list(
monetary_account_id=monetary_account_id,
params=params,
).value
# Add parameters to only list for current monetary_account_id
params['monetary_account_id'] = monetary_account_id
params['display_user_event'] = 'false'
# Get events
events = endpoint.Event.list(
params=params,
).value
for payment in payments:
print(payment.counterparty_alias.label_monetary_account)
for event in events:
if event.object_.Payment:
print(event.object_.Payment.counterparty_alias.label_monetary_account)
Output:
<bunq.sdk.model.generated.object_.LabelMonetaryAccount object at 0x7f3489f4ab70>
<bunq.sdk.model.generated.object_.LabelMonetaryAccount object at 0x7f3489f4d668>
<bunq.sdk.model.generated.object_.LabelMonetaryAccount object at 0x7f3489ed1160>
None
None
None
What should happen:
- The Payment object within Event.object_ should have the same attributes as the Payment object
What happens:
- the counterparty_alias variables are None
Traceback
SDK version and environment
- Tested on 1.10.16
- [x] Sandbox
- [ ] Production
@OGKevin ping, don't want to be rude but the Bunq support is of no help in this case haha
payment._counterparty_alias._ERROR_COULD_NOT_INSTANTIATE: ''Could not directly instantiate MonetaryAccountReference. Please use the class factory methods.''
This is the error thrown :)