bunq / sdk_python

Python SDK for bunq API
MIT License
106 stars 25 forks source link

AttributeError: 'SessionServer' object has no attribute '_user_payment_service_provider' #134

Closed siccovansas closed 4 years ago

siccovansas commented 4 years ago

Steps to reproduce:

  1. Connect a sandbox or production Bunq account via OAuth

What should happen:

  1. Succesfull connection

What happens:

  1. After successfully scanning the OAuth QR code I'm redirected to my redirect URL where I encounter the following error/traceback:

Traceback

  File "/opt/poen/app/util.py", line 31, in create_bunq_api_config
     api_context = ApiContext.create(environment, bunq_access_token, socket.gethostname()).save('%s-project-%s.conf' % (filename, project_id))
  File "/usr/local/lib/python3.7/site-packages/bunq/sdk/context/api_context.py", line 67, in create
    api_context.__initialize_session()
  File "/usr/local/lib/python3.7/site-packages/bunq/sdk/context/api_context.py", line 152, in __initialize_session
    expiry_time = self._get_expiry_timestamp(session_server)
  File "/usr/local/lib/python3.7/site-packages/bunq/sdk/context/api_context.py", line 170, in _get_expiry_timestamp
    timeout_seconds = cls._get_session_timeout_seconds(session_server)
  File "/usr/local/lib/python3.7/site-packages/bunq/sdk/context/api_context.py", line 181, in _get_session_timeout_seconds
    elif session_server.user_payment_service_provider is not None:
  File "/usr/local/lib/python3.7/site-packages/bunq/sdk/model/core/session_server.py", line 65, in user_payment_service_provider
    return self._user_payment_service_provider
AttributeError: 'SessionServer' object has no attribute '_user_payment_service_provider'

SDK version and environment

Extra info:

My software used to work without a problem, so I guess this error started occurring because of SDK 1.13.1 or an API change. Is this problem with my code or with Bunq's SDK/API?

tovolkmar commented 4 years ago

I can confirm that the commit fixes the issue. Had the same problem, with OAuth authentification.