woudt / bunq2ifttt

bunq2IFTTT creates a self-hosted interface between the bunq banking API and IFTTT.
MIT License
24 stars 8 forks source link

Superfluous field "notification_filters" #2

Closed ghost closed 4 years ago

ghost commented 4 years ago

I'm trying to change some triggers in a bunq slave, but I'm getting the following error:

127.0.0.1 - - [26/Oct/2019 13:10:30] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [26/Oct/2019 13:10:30] "GET /static/bunq2ifttt.png HTTP/1.1" 304 -
GET v1/user/XXXX/monetary-account-joint/XXXX
New:  [{'notification_delivery_method': 'URL', 'notification_target': 'https://XXXX.appspot.com/bunq2ifttt_request', 'category': 'REQUEST'}]
PUT v1/user/XXXX/monetary-account-joint/XXXX
{'Error': [{'error_description': 'Superfluous field "notification_filters".', 'error_description_translated': 'Superfluous field "notification_filters".'}]}
Result:  {'Error': [{'error_description': 'Superfluous field "notification_filters".', 'error_description_translated': 'Superfluous field "notification_filters".'}]}
127.0.0.1 - - [26/Oct/2019 13:10:34] "GET /account_change_request?iban=XXXX&value=true HTTP/1.1" 200 -
127.0.0.1 - - [26/Oct/2019 13:10:35] "GET / HTTP/1.1" 200 -
GET v1/user/XXXX/monetary-account
127.0.0.1 - - [26/Oct/2019 13:10:37] "GET /update_accounts HTTP/1.1" 200 -
127.0.0.1 - - [26/Oct/2019 13:10:38] "GET / HTTP/1.1" 200 -

It doesn't work with any account, joint or not. The notification_filters object seems fine according to the documentation. Should another URL be used?

ghost commented 4 years ago

That seems to be the case: https://beta.doc.bunq.com/basics/changelog#october-8-2019

woudt commented 4 years ago

Thank you for the report. I was already working on this and already have a working version with the new API. My goal is to commit a new version this weekend.

ghost commented 4 years ago

Ok, great! I've changed the API endpoint in the current codebase, and it does work, although they keep being marked as "disabled". I'll wait for your new version.

woudt commented 4 years ago

Changes have been committed to the 'dev' branch. The new version no longer needs a slave and can set callbacks directly using OAuth. I need to do some more testing and update the documentation before doing a new release, but feel free to try it.

ghost commented 4 years ago

I'm getting this error after deploying and setting a password:

2019-10-28 06:10:19 default[20191028t070621]  [2019-10-28 06:10:19,881] ERROR in app: Exception on / [GET]
2019-10-28 06:10:19 default[20191028t070621]  Traceback (most recent call last):    File "/env/lib/python3.7/site-packages/flask/app.py", line 2446, in wsgi_app      response = self.full_dispatch_request()    File "/env/lib/python3.7/site-packages/flask/app.py", line 1951, in full_dispatch_request      rv = self.handle_user_exception(e)    File "/env/lib/python3.7/site-packages/flask/app.py", line 1820, in handle_user_exception      reraise(exc_type, exc_value, tb)    File "/env/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise      raise value    File "/env/lib/python3.7/site-packages/flask/app.py", line 1949, in full_dispatch_request      rv = self.dispatch_request()    File "/env/lib/python3.7/site-packages/flask/app.py", line 1935, in dispatch_request      return self.view_functions[rule.endpoint](**req.view_args)    File "/srv/main.py", line 40, in home_get      accounts = util.get_bunq_accounts_with_permissions(config)    File "/srv/util.py", line 77, in get_bunq_accounts_with_permissions      for acc in config["accounts"]:  KeyError: 'accounts'

It seems like it expects accounts while I didn't add the OAuth key yet. Do I need to do something before deploying, or is this a bug?

woudt commented 4 years ago

I do apologize, this is indeed a bug which I didn't spot due to lack of testing. I'll fix it tonight or tomorrow.

PowerThomas commented 4 years ago

I do apologize, this is indeed a bug which I didn't spot due to lack of testing. I'll fix it tonight or tomorrow.

Any news? Or is there an alternative way for enabling Mutation/Balance triggers?

woudt commented 4 years ago

I am very sorry for the delay. @makruiten @tcvdw1605 The issue has been fixed in version 2.0 that has just been released.