go-hbci
go-hbci copied to clipboard
Error connecting to DKB
When trying to connect to DKB with the code in this gist, the following error is reported:
panic: Error while fetching accounts: Institute returned errors: MessageAcknowledgement for message 1 (0): Code: 9010, Position: none, Text: 'Nachricht ungueltig.', Parameters: "Validierung fehlgeschlagen."
Hey, sorry for coming back to you just know. I also experienced this error when speaking with a Sparkasse. I haven't figured out yet why some institutes work be others don't.
Hey guys, I have the same issue and like to help to fix this. I'm also a customer of Sparkasse.
Hey, thanks for joining forces on that issue. My observation so far is that when doing a request to a problematic bank institute it already fails at the first request, i.e. the dialog initialization. It could be that it is a problem with encoding. The spec says it has to be ISO 8859_1. I guess I convert the data somewhere from byte slices to strings and they get UTF8 encoding there.
The message acknowledgement for these messages:
Code: 9010, Position: none, Text: 'Nachricht ungueltig.', Parameters: "Validierung fehlgeschlagen."
Could also be a malformed signature/encryption, but strange enough it works for other institutes just fine. In my case it is possible to communicate to the bank using HBCI 2.2.0 without problems. But when switching to FINTS 3.0.0 it breaks.
Seems like I found the problem and fixed it. Please try it out with this release: https://github.com/mitch000001/go-hbci/releases/tag/0.1.0
Hey @mitch000001,
thanks now I can get the names of the bank accounts. Unfortunately we now have some following errors:
MessageAcknowledgement for message 1 (535286721777=176863099751BRJ4=): Code: 3060, Position: none, Text: 'Bitte beachten Sie die enthaltenen Warnungen/Hinweise.' SegmentAcknowledgement for message 0 (), segment 4: Code: 3050, Position: none, Text: 'UPD nicht mehr aktuell, aktuelle Version enthalten.' SegmentAcknowledgement for message 0 (), segment 4: Code: 3050, Position: none, Text: 'BPD nicht mehr aktuell, aktuelle Version enthalten.'
Looks like the version 0.1.0 differs in the specs from the current implementation
Hey @CoreTex, These warnings are expected. If you initially communicate with a bank you don't have any UPD or BPD, so they got sent by the institute so the client can use it. They are stored within dialog, though not persisted, which means, when you make additional calls with the same client, you won't get these errors again, but if you create a new client the warning will come again.
That said, Acknowledgements with codes between 3000 and 3999 are considered warnings and do not necessarily lead to an error.
@vosst can you confirm that the error is gone?
@mitch000001 it works only partially. I can access the name of the bank account and some details. If I want to get the account balance I get this error:
go-hbci: 2018/01/07 14:01:20 Supported securityFunctions: ["921"] Institute returned errors: MessageAcknowledgement for message 2 (214114170456=164082533851BRJ4=): Code: 9050, Position: none, Text: 'Die Nachricht enthält Fehler.' SegmentAcknowledgement for message 0 (), segment 3: Code: 9010, Position: none, Text: 'Auftragsart wird laut BPD nicht unterstützt.'
@CoreTex I also got this kind of error messages. What it basically tells is that we're making a request with a specific version of a segment which is not supported (anymore?). To fix that a complete overhaul of the way the segments are chosen for a given request is necessary. ATM the segment fetching is somewhat static, which means it can work with an institute when it supports the used segment version.
I haven't found the time to start with that. Also, it will be necessary to parse all so called Bankparameterdaten to see which version of a segment is supported. Also, at some point we have to implement even more versions of some segments to allow proper communication.
I have the same problem with Sparkasse. The allowed requests are returned with the accounts, so segments should probably chosen based on account? I'm not very deep into FinTS or this code base, so I have unfortunately no idea how to fix that.
Hm, but as far as I understand, requesting the balance is an HKSAL element, which is supported by my account according to my bank.
@maufl probably it does not support the version this project has implemented.
@vosst @CoreTex @maufl I refactored the library so the BankParameter Data is used and we send the right versions. Can you verify the new build: v0.1.4-beta1 ?
Looks better. I only tested it for fetching balances but that seems to work. It returns the correct balance for my Girokonto and my Tagesgeldkonto, tough not for my credit card. But this is a problem that I encountered with other FinTS software too, so I guess that is not a bug but a limitation.