Use of Nordigen Bank API

Hey,

I just saw that the Nordigen Bank API has finally been integrated in version 5.8.0.

However, I’m currently not sure how to integrate it so that my bank statements will be imported into Invoice Ninja.

Any help here?

Hi,

There are two steps, first you’ll need to add the Nordigen API key info to the .env file.

NORDIGEN_SECRET_ID=
NORDIGEN_SECRET_KEY=
NORDIGEN_TEST_MODE=

Once that’s setup you can use “Connect” button on Settings > Back Accounts to connect your account.

Thanks, will try that later. Question: for the Nordigen_Test_Mode, do I simply set it to true/false?

Yes, that is correct

“Thanks, I think I got the connection working. The problem now is that I’m unable to set up the connection via the web interface. The mobile app works fine; here I can click on ‘Verbinden’ and it directs me to GoCardless.”

Thanks for the info, we’ll look into it.

cc @david

@juwillsee

How are you attempting to create the connection via the web interface?

If you navigate to Settings > Credit Cards & Back Accounts > Connect accounts

You should be bounced to gocardless immediately.

That’s what I’m trying to do, as displayed in the screens above. When I click the button Add Bank Account (Bankverbindung hinzufügen) I get the normal dialog to create a manual bank account.

After I clicked on the button Add Bank Account.

Hey all - glad to see that this feature is being introduced!

I’ve tried activating it, but unfortunately, I get a HTTP 500 after redirect, and I can find this in the logs:

 Undefined array key \"ownerName\" at /var/www/billing/ninja/app/Helpers/Bank/Nordigen/Transformer/AccountTransformer.php:113

I don’t really know what is going wrong here, anybody has an idea what might be going wrong?

Does this work with US Banks?

I don’t believe so, you can see their coverage here:

So, I did some further digging in the GoCardless documentation.
The ownerName field is optional (see Bank Account Data - Account Details) and not all banks provide it, but it seems to be set up in such a way that this input is required.

In some further testing, I found out that when I comment out lines app/Http/Controllers/Bank/NordigenController.php:237 and app/Helpers/Bank/Nordigen/Transformer/AccountTransformer.php:113, it fixes this issue and the integration instantly works.

I’ll create an issue for this on GitHub and look if I can cook up a decent fix.

Edit: already has been fixed, 9 minutes after creating the issue. You guys are crazy fast!

2 Likes

I have the same problem and would love to find a stable solution to this problem as this would really be nice for bookkeeping

What issue exactly do you have? Do you get a HTTP 500 error, or some other issue?
What steps have you taken, can you find anything strange in your logs?

I get a HTTP 500 error with a certain bank but not another. I haven’t been able to find anything in the logs that was leading me towards a solution unfortunately.

If you hit a HTTP 500 error, there must be traces in the logs that point towards this.
In my case, I could find traces of it in the in the storage/logs folder (laravel.log).
Try to look in this log, there might be some traces there of what is going wrong - that would be the place where I would look for it.

Thank you! That’s the error:

[2024-02-12 16:37:23] production.ERROR: Undefined array key "iban" {"exception":"[object] (ErrorException(code: 0): Undefined array key \"iban\" at /app/code/app/Helpers/Bank/Nordigen/Transformer/AccountTransformer.php:107
[stacktrace]
#0 /app/code/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(255): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleError()
#1 /app/code/app/Helpers/Bank/Nordigen/Transformer/AccountTransformer.php(107): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->Illuminate\\Foundation\\Bootstrap\\{closure}()
#2 /app/code/app/Helpers/Bank/Nordigen/Nordigen.php(96): App\\Helpers\\Bank\\Nordigen\\Transformer\\AccountTransformer->transform()
#3 /app/code/app/Http/Controllers/Bank/NordigenController.php(219): App\\Helpers\\Bank\\Nordigen\\Nordigen->getAccount()
#4 /app/code/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): App\\Http\\Controllers\\Bank\\NordigenController->confirm()
#5 /app/code/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(43): Illuminate\\Routing\\Controller->callAction()
#6 /app/code/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Tracing/Routing/TracingControllerDispatcherTracing.php(21): Illuminate\\Routing\\ControllerDispatcher->dispatch()
#7 /app/code/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Tracing/Routing/TracingRoutingDispatcher.php(19): Sentry\\Laravel\\Tracing\\Routing\\TracingControllerDispatcherTracing->Sentry\\Laravel\>
#8 /app/code/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Tracing/Routing/TracingControllerDispatcherTracing.php(20): Sentry\\Laravel\\Tracing\\Routing\\TracingRoutingDispatcher->wrapRouteDispatc>
#9 /app/code/vendor/laravel/framework/src/Illuminate/Routing/Route.php(260): Sentry\\Laravel\\Tracing\\Routing\\TracingControllerDispatcherTracing->dispatch()
#10 /app/code/vendor/laravel/framework/src/Illuminate/Routing/Route.php(205): Illuminate\\Routing\\Route->runController()
#11 /app/code/vendor/laravel/framework/src/Illuminate/Routing/Router.php(806): Illuminate\\Routing\\Route->run()
#12 /app/code/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(144): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}()
#13 /app/code/app/Http/Middleware/QueryLogging.php(39): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#14 /app/code/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): App\\Http\\Middleware\\QueryLogging->handle()
#15 /app/code/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(50): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#16 /app/code/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Routing\\Middleware\\SubstituteBindings->handle()
#17 /app/code/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(78): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#18 /app/code/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken->handle()
#19 /app/code/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#20 /app/code/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\View\\Middleware\\ShareErrorsFromSession->handle()
#21 /app/code/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#22 /app/code/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse->handle()
#23 /app/code/app/Http/Middleware/SessionDomains.php(30): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#24 /app/code/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): App\\Http\\Middleware\\SessionDomains->handle()
#25 /app/code/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(121): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#26 /app/code/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(64): Illuminate\\Session\\Middleware\\StartSession->handleStatefulRequest()
#27 /app/code/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Session\\Middleware\\StartSession->handle()
#28 /app/code/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(67): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#29 /app/code/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Cookie\\Middleware\\EncryptCookies->handle()
#30 /app/code/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(119): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#31 /app/code/vendor/laravel/framework/src/Illuminate/Routing/Router.php(807): Illuminate\\Pipeline\\Pipeline->then()
#32 /app/code/vendor/laravel/framework/src/Illuminate/Routing/Router.php(784): Illuminate\\Routing\\Router->runRouteWithinStack()
#33 /app/code/vendor/laravel/framework/src/Illuminate/Routing/Router.php(748): Illuminate\\Routing\\Router->runRoute()
#34 /app/code/vendor/laravel/framework/src/Illuminate/Routing/Router.php(737): Illuminate\\Routing\\Router->dispatchToRoute()
#35 /app/code/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(200): Illuminate\\Routing\\Router->dispatch()
#36 /app/code/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(144): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}()
#37 /app/code/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Http/SetRequestIpMiddleware.php(45): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#38 /app/code/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Sentry\\Laravel\\Http\\SetRequestIpMiddleware->handle()
#39 /app/code/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Http/SetRequestMiddleware.php(31): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#40 /app/code/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Sentry\\Laravel\\Http\\SetRequestMiddleware->handle()
#41 /app/code/vendor/livewire/livewire/src/Features/SupportDisablingBackButtonCache/DisableBackButtonCacheMiddleware.php(19): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#42 /app/code/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Livewire\\Features\\SupportDisablingBackButtonCache\\DisableBackButtonCacheMiddleware->handle()
#43 /app/code/app/Http/Middleware/Cors.php(24): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#44 /app/code/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): App\\Http\\Middleware\\Cors->handle()
#45 /app/code/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php(39): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#46 /app/code/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Http\\Middleware\\TrustProxies->handle()
#47 /app/code/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()

iban is indeed an optional field; Bank Account Data - Account Details.

To be sure, what is your bank? I suspect your bank either provides an iban or a bban, but InvoiceNinja only checks (currently) for iban. I suspect your bank provides a bban but no iban.
You can look it up in this list: Data Points (last_update: 2023_09_14) - Google Sheets

What I’m trying to conect is a WISE account which according to this sheet does provide an IBAN: