mitch000001 / go-hbci

A client library to use the HBCI standard
Other
66 stars 12 forks source link

dialog.Init multiple acknowledgements #14

Open lyckligtax opened 6 years ago

lyckligtax commented 6 years ago

Hi there, I was trying to retrieve Account Information from my bank (comdirect bank AG) and got into some trouble doing so:

While initializing the dialog d.init() @dialog.go:299 I got 4 errors :

The 3920 error (securityFn) is filtered and correctly caught but unfortunately the other ones are not caught and result into a failing initialization.

In my opinion the first 3 should be caught if the ONLY OTHER error is 3920. If there were other errors the function should work as it does.

Any advice on this?

mitch000001 commented 6 years ago

Hey, I am not sure if the errors can be caught. 9050 and 9800 suggest that the server just closed the dialog because of the mentioned error 9955.

I think in that case it is necessary to initialize the dialog with the correct securityFn. The default at the moment seems not to work for the comdirect bank AG, or so it seems.

I would try to add it into the Config in dialog/pin_tan_dialog.go and set it if available in the initialization. It still feels like a band-aid, but it could work in this case for now.

mitch000001 commented 6 years ago

I just pushed this change to the branch explicit-securityfn. Maybe you can try it out?

mitch000001 commented 6 years ago

In case you need a git tag: https://github.com/mitch000001/go-hbci/releases/tag/v0.1.3-beta1

maxhille commented 6 years ago

I am also using comdirect and while "get accounts" works, for transactions I have to modify the library in two places.

  1. Settings the securityFn in pin_tan_dialog did not do anything for me. I had more success with "hardcoding" the code into message/signature.go. I did not have time yet to debug why the dialog-set value does not end up in the actual message, but I think there is a bug somewhere.

  2. I guess it is comdirect-specific, but I had to change to NewAccountTransactionRequestSegmentV5 in segment/fints300.go because the V6 message HIKAZ(?) does not seem to be supported by comdirect.