bnw / firefly-iii-fints-importer

Import financial transactions from you FinTS enabled bank into Firefly III.
GNU Affero General Public License v3.0
152 stars 23 forks source link

Sparkasse import stopped working #131

Closed Athesis closed 2 months ago

Athesis commented 6 months ago

Unfortunally my connection to Sparkasse stopped working. I would appreciate to get some help. The error is:


Warning: Undefined array key 921 in /var/www/html/firefly-iii-fints-importer/app/FinTsFactory.php on line 60

Fatal error: Uncaught Error: Call to a member function needsTanMedium() on null in /var/www/html/firefly-iii-fints-importer/app/FinTsFactory.php:32 Stack trace: #0 /var/www/html/firefly-iii-fints-importer/app/Choose2FADevice.php(25): App\FinTsFactory::create_from_session() #1 /var/www/html/firefly-iii-fints-importer/app/index.php(55): App\StepFunction\Choose2FADevice() #2 {main} thrown in /var/www/html/firefly-iii-fints-importer/app/FinTsFactory.php on line 32

...I guess Sparkasse changed something (again), but they won't help anymore. Maybe here someone can help? I'm more than happy to get into debugging stuff.

My configuration:

{
  "bank_username": "A",
  "bank_password": "",
  "bank_code": "56050180",
  "bank_url": "https://banking-rp3.s-fints-pt-rp.de/fints30",
  "bank_2fa": "921",
  "firefly_url": "http://127.0.0.1",
  "firefly_access_token": "key",
  "skip_transaction_review": "false",
  "__description_regex_comment__": "To disable the regex search & replace of the transaction description, set both to an empty string.",
  "description_regex_match": "",
  "description_regex_replace": ""
}

what's safed in $tanModes might be interesting as well:

    [923] => Fhp\Segment\TAN\VerfahrensparameterZweiSchrittVerfahrenV7 Object
        (
            [sicherheitsfunktion] => 923
            [tanProzess] => 2
            [technischeIdentifikationTanVerfahren] => pushTAN-cas
            [dkTanVerfahren] => Decoupled
            [versionDkTanVerfahren] => 
            [nameDesZweiSchrittVerfahrens] => pushTAN 2.0
            [maximaleLaengeDesTanEingabewertes] => 
            [erlaubtesFormat] => 
            [textZurBelegungDesRueckgabewertes] => Aufforderung
            [maximaleLaengeDesRueckgabewertes] => 2048
            [mehrfachTanErlaubt] => 1
            [tanZeitUndDialogbezug] => 2
            [auftragsstornoErlaubt] => 
            [smsAbbuchungskontoErforderlich] => 0
            [auftraggeberkontoErforderlich] => 0
            [challengeKlasseErforderlich] => 
            [challengeStrukturiert] => 
            [initialisierungsmodus] => 00
            [bezeichnungDesTanMediumsErforderlich] => 2
            [antwortHhdUcErforderlich] => 
            [anzahlUnterstuetzterAktiverTanMedien] => 5
            [maximaleAnzahlStatusabfragen] => 180
            [wartezeitVorErsterStatusabfrage] => 1
            [wartezeitVorNaechsterStatusabfrage] => 1
            [manuelleBestaetigungMoeglich] => 1
            [automatisierteStatusabfragenErlaubt] => 1
        )

Thanks a lot for your help!

Athesis commented 6 months ago

... just putting in "bank_2fa": "923" seems to work, but I guess it breaks as soon a pushTAN is actually requested.

ffidan61 commented 5 months ago

Did you manage to get it back to work? Changed 2fa to 923 and Fatal error: Uncaught Fhp\Protocol\ServerException: FinTS errors: 9050 (global): Die Nachricht enthält Fehler. 9800 (global): Dialog abgebrochen 9120 (global): Die Nachricht hat nicht die erwartete Nachrichtennummer. is the new error.

bnw commented 2 months ago

Die Nachricht hat nicht die erwartete Nachrichtennummer

Please be careful as to not accidentally submit forms twice. This can happen e.g. when you use the back button of your browser or submit a form right before it is auto-submitted.

Please reopen if you think there is anything that I can help you with.

ffidan61 commented 2 months ago

Hi @bnw it worked for a while after I added a iphone device to my pushtan devices(I think I updated the Sparkasse PushTan App befor it stopped working). But since 2-3 days I get a Fatal error: Uncaught Fhp\Protocol\ServerException: FinTS errors: 9050 (global): Die Nachricht enthält Fehler. 9800 (global): Dialog abgebrochen 9120 (global): Die Nachricht hat nicht die erwartete Nachrichtennummer Error Any idea how to fix this?

wave864 commented 2 months ago

Hi everybody, I'm running into related issues. So far I have experienced the following bugs:

According to what very little info you can find on the web this seems to potentially affect all Sparkassen bank accounts. Here's the most concise info I could find (German): Sparkassen: pushTAN ohne TAN-Eingabe

JuliusFreudenberger commented 1 month ago

I now also encounter this problem with my Sparkasse-Import. My pushTan-App presents the possibility to mark the device (the importer) as trustworthy. When I confirm this, the importer still asks for a TAN to be entered. This is however not shown in the app. Then the case described in the second point applies.

but the web ui then requests a TAN which is not supplied by this 2fa method. At this point you can either leave the mandatory TAN field empty and remain stuck or produce an error by entering a random number.

Entering a random number or removing the required field in the html leads to the following exception:

 Fatal error: Uncaught InvalidArgumentException: Cannot submit TAN for a decoupled TAN mode in /vendor/nemiah/php-fints/lib/Fhp/FinTs.php:372 Stack trace: #0 /app/TanHandler.php(39): Fhp\FinTs->submitTan(Object(Fhp\Protocol\DialogInitialization), '') #1 /app/TanHandler.php(31): App\TanHandler->create_or_continue_action() #2 /app/Login.php(21): App\TanHandler->__construct(Object(Closure), 'login-action', Object(Symfony\Component\HttpFoundation\Session\Session), Object(Twig\Environment), Object(Fhp\FinTs), Object(App\Step), Object(Symfony\Component\HttpFoundation\Request)) #3 /app/index.php(59): App\StepFunction\Login() #4 {main} thrown in /vendor/nemiah/php-fints/lib/Fhp/FinTs.php on line 372

From the error message, I think the importer has to be adapted?