I'm looking into automating/integrating some processes with Bunq. The easiest way to start (or at least to get an impression of the functionality) is to use "Bunq python tinker", as described on https://developer.bunq.com/en/quick-starts/getting-started-with-python
So I took a fresh 18.04 ubuntu image on Digital Ocean, installed the dependencies and ran the setup curl command,
bash <(curl -s https://tinker.bunq.com/python/setup.sh)
This works fine and runninbg
./go-tinker gives me some fancy output and some examples to execute.
Running the very first example,
tinker/user_overview.py already fails:
File "/root/b/.venv/lib/python3.6/site-packages/bunq/sdk/json/converter.py", line 1
from __future__ import annotations
Now that's weird. The Pipfile explicitly mentions python3.6 as a dependency which is why I picked ubuntu 18.04, but python3.6 doesn't support that future.
So I "downgraded" the sdk to "1.10.16" (the previous release as far as I can tell).
That results in
File "/root/b/.venv/lib/python3.6/site-packages/bunq/sdk/security.py", line 251, in validate_response
File "/root/b/.venv/lib/python3.6/site-packages/Cryptodome/Signature/pkcs1_15.py", line 175, in verify
raise ValueError("Invalid signature")
ValueError: Invalid signature
I remember seeing something about encryption headers changing, so perhaps the latest sdk is mandatory, so I'll need to upgrade python to 3.7 in stead and try again. And rerun pipenv install, etc.
At this point, I get
(b) root@ubuntu-s-1vcpu-1gb-ams3-01:~/b# tinker/user_overview.py
Traceback (most recent call last):
File "tinker/user_overview.py", line 2, in <module>
from libs.bunq_lib import BunqLib
File "/root/b/tinker/libs/bunq_lib.py", line 8, in <module>
from bunq.sdk.client import Pagination
ModuleNotFoundError: No module named 'bunq.sdk.client'
and I noticed this already with a previous attempt - the sdk API changed significantly and tinker is incompatible with it. In stead it should be (I think?)
from bunq import Pagination
All in all, I can't think of a configuration / setup that actually works. Can someone explain to me what I'm doing wrong here?