Make transaction details optional
A few weeks ago, I had problems using this because the key transaction_details was missing. I dirtily hacked a solution by hacking the python scripts in my installation, but I planned to properly commit it back upstream. For doing so, I wrote some unit tests.
I now realised that in the meantime, an issue and a PR have already been created for this (#3). However, I decided to PR this anyway, because I also made unit tests for my fix.
Also, my fix uses the field "purpose" for the memo in case "transaction_details" are missing (which is what my bank provides, and it seems to contain what you'd expect a memo to contain).
Please merge only after #4 has been merged.
Fixes #2.
#3 also protects against transaction.data['customer_reference'] not existing, which was the case for me.
@karyon Are you sure? I don't see anything protecting from transaction.data['customer_reference'] not existing in the diff of #3 – instead, I see multiple occurences where it still accesses transaction.data['customer_reference'] without checking.