Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[15.0][add] account_bank_statement_import_online_nordigen #496

Conversation

JordiBForgeFlow
Copy link
Member

Integration with Nordigen

TODO:

  • Test scripts

@github-actions
Copy link

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Jan 15, 2023
@ayushin
Copy link

ayushin commented Feb 6, 2023

is this still being worked on?

@github-actions github-actions bot removed the stale PR/Issue without recent activity, it'll be soon closed automatically. label Feb 12, 2023
@Rad0van
Copy link

Rad0van commented Mar 3, 2023

@JordiBForgeFlow this is a great initiative! Currently testing it and willing to provide feedback, improvements, etc...

Found one thing that prevents it from working for me.
I have created an account with Nordigen, created secret id and key, created bank account in Odoo, configured OCA provider and added secret and key.
When I click "Select Nordigen Bank Identifier" it lets me choose Country and Bank. Then it provides this screen - seems it read my name (radovan) from the id/key:
image

After clicking "I Agree" it redirects me here:
image

When I enter Nordigen username/password it provides some kind of demo/trial accounts...
image

This is kind of different from what you do inside Nordigen GUI, when you try to add a bank account. Country / Bank selection is basically the same. The next step is a bit different - as if it didn't know who I was:
image

After this step it asks for IBAN number:
image
Then it adds it to the list in Nordigen. But I cannot get to this step in Odoo... Any idea what may be going wrong?

@Rad0van
Copy link

Rad0van commented Mar 6, 2023

@JordiBForgeFlow I have found out why that is... This line:
SANDBOX_INSTITUTION_ID = "SANDBOXFINANCE_SFIN0000"

OK, going to disable this and test again...

@Entrepreneur-AJ
Copy link

Ok, so I have been testing this for the past couple of days. I had to comment out SANDBOX_INSTITUTION_ID = "SANDBOXFINANCE_SFIN0000" as @Rad0van mentions to connect to my real bank account, which works.
I have stumbled across the following issues;

  1. Scheduled Action doesn't pull any data using the cron worker
  2. Scheduled Action doesn't pull any data when you push run manually
  3. For some reason it although today's date is the 17th of March 2023 it is only pulling the 14th instead of the latest data.
  4. When you need to reauthorise the connection to the bank the click here html link shows as code instead of a link
  5. The account it matches to has to be in IBAN format I entered a UK sort code and account number at the add bank account part of odoo and it couldn't link them. Noticed it pulling IBAN numbers on auth so tried that and it pull's data (Maybe a Nordigen issue) (Maybe document this bit)

Maybe i'm doing something wrong, but it's worth a comment to see if anyone else is having the same problem.

@ayushin
Copy link

ayushin commented May 7, 2023

What does need to happen to have this merged?

@Entrepreneur-AJ
Copy link

Need 2 approvals after code review, I've been testing this since 14th of March with my issues commented above.

Update on previous comment;
Scheduled action is working just seems to work once a day only, whether that's a module or bank problem I don't know.

IBAN and BIC still a requirement.

Line 163 of https://github.com/ForgeFlow/bank-statement-import/blob/15.0-add-account_bank_statement_import_online_nordigen/account_bank_statement_import_online_nordigen/models/online_bank_statement_provider_nordigen.py needs removing to work with a real bank.

Documentation stating that you need to generate api keys on the nordigen website would be beneficial.

Copy link

@Entrepreneur-AJ Entrepreneur-AJ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the sandbox id on line 163 of the online_bank_statement_provider_nordigen.py file or convert it until a UI based config option.

institution_id = SANDBOX_INSTITUTION_ID
self.nordigen_last_requisition_ref = str(uuid4())
# TO DELETE
institution_id = "SANDBOXFINANCE_SFIN0000"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only thing I see stopping a merge is this hardcode, either it should be removed or made into a UI based switch for demo

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy to approve after. (Been testing for 2 months)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, so who should comment that line out? :-)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ayushin Normally the person who initially posted the PR.
@JordiBForgeFlow are you still wanting this PR or should it be forked to another PR

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Entrepreneur-AJ feel free to propose the fix in another PR. Then we can close this one.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will look at sorting it after work tonight

@Entrepreneur-AJ
Copy link

As promised, a new PR clearing that sandbox id #592 Seems to have flagged a translation issue with pre-commit, so I am looking into a workaround for that now.

@Entrepreneur-AJ
Copy link

@JordiBForgeFlow @ChrisOForgeFlow @Rad0van @ayushin PR #592 ready for review this PR plus the sandbox line deleted, and satisfying translation issues given by pre-commit (pylint).

@Entrepreneur-AJ Entrepreneur-AJ mentioned this pull request May 17, 2023
13 tasks
@Rad0van
Copy link

Rad0van commented May 17, 2023

Update on previous comment; Scheduled action is working just seems to work once a day only, whether that's a module or bank problem I don't know.

Try having a look at the source code of the module account_bank_statement_import_online which is a base for this one.

IBAN and BIC still a requirement.

As it should. Nordigen implements PSD2 APIs which are standardized in European Union predominantly for SEPA system where IBAN and BIC are the cornerstones...

Documentation stating that you need to generate api keys on the nordigen website would be beneficial.

I see it there though... See last line of CONFIGURE.rst and appropriate section of generated README.rst

@pedrobaeza pedrobaeza added this to the 15.0 milestone May 17, 2023
@pedrobaeza
Copy link
Member

Please clean the commit history and we can merge.

@JordiBForgeFlow
Copy link
Member Author

@Entrepreneur-AJ I have now done the fixes you asked for and closed your PR. In order to properly take up the PR from another person an continue you must clone my branch first, then make your changes in your local and finally push to your own repo, to then make a new PR. That way the commit history will be preserved.

Anyway this PR is not ready to merge because it lacks to add automated tests. Do you think that you @Entrepreneur-AJ are able to add automated tests?

@pedrobaeza
Copy link
Member

Automated tests are not strictly needed, although always welcome and desirable. In this case, having connections to external systems, the tests should be mocked, so their effectiveness is limited, so I think is good to go if it works.

Copy link
Contributor

@MiquelRForgeFlow MiquelRForgeFlow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact, the commit history is already clean IMO 🤔 @pedrobaeza

@MiquelRForgeFlow
Copy link
Contributor

Ah, needs a rebase

@Rad0van
Copy link

Rad0van commented May 17, 2023

@JordiBForgeFlow we have found Nordigen API is in some cases behaving funny. For example when you add a month period from beginning of May to Beginning of June this year it returns nothing. The latest date can be today. Also the way the date ranges for daily pulls are generated in the account_bank_statement_import_online causes this to behave strange. So I am working with a colleague on improvements. You do not necessarily need to wait for these - we can always amend by new PRs. Just informing that we are working on this trying to make it better.

Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

About the commit history:

Selección_049

And I have just seen the web_notify dependency, which is an undesired coupling dependency for a toolset like this. Please remove it.

@Entrepreneur-AJ
Copy link

@Rad0van

I see it there though... See last line of CONFIGURE.rst and appropriate section of generated README.rst
Must have overlooked this section.

@JordiBForgeFlow thank you for the updates and the quick run down for future reference, happy to look at automated tests when I will have time I honestly don't know so push forward for now. I will double-check the latest commit before editing my review/approval.

@ayushin
Copy link

ayushin commented Jun 1, 2023

This is such a useful integration, how can we get it merged?

Can somebody please produce a checklist of what needs to be done?

It feels we are nearly there but weeks go by and it would be great to have it backported to 14 & 13

@rokmarko
Copy link

Hi

This is very good tool for european customers. Is there any problem with this PR? Why is still not merged?

Can I help somehow to get this merged?

@ayushin
Copy link

ayushin commented Sep 2, 2023

@pedrobaeza Is the web_notify dependency the only issue holding back this PR merge?

@pedrobaeza
Copy link
Member

Closed in favor of #635

@pedrobaeza pedrobaeza closed this Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants