sdk_python icon indicating copy to clipboard operation
sdk_python copied to clipboard

Event object Payment.counterparty_alias is None

Open wilmardo opened this issue 6 years ago • 2 comments

Steps to reproduce:

  1. Request events with the endpoint.Event.list()
  2. 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:

  1. The Payment object within Event.object_ should have the same attributes as the Payment object

What happens:

  1. the counterparty_alias variables are None

Traceback

SDK version and environment

  • Tested on 1.10.16
  • [x] Sandbox
  • [ ] Production

wilmardo avatar Sep 01 '19 17:09 wilmardo

@OGKevin ping, don't want to be rude but the Bunq support is of no help in this case haha

wilmardo avatar Sep 10 '19 12:09 wilmardo

payment._counterparty_alias._ERROR_COULD_NOT_INSTANTIATE: ''Could not directly instantiate MonetaryAccountReference. Please use the class factory methods.''

This is the error thrown :)

wilmardo avatar Oct 18 '19 13:10 wilmardo