GithubHelp home page GithubHelp logo

nordigen / nordigen-ruby Goto Github PK

View Code? Open in Web Editor NEW
11.0 11.0 15.0 496 KB

Ruby library for the Nordigen API.

License: MIT License

Ruby 80.39% Shell 0.20% JavaScript 5.53% SCSS 0.80% CSS 1.06% HTML 12.03%

nordigen-ruby's People

Contributors

danieljackson-oslo avatar dipo avatar ekatvars-gc avatar jjf21 avatar nathanberthier avatar safriks avatar victory-sokolov avatar xendk avatar zachasme avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

nordigen-ruby's Issues

Date filter doesn't work

Describe the bug
Even when providing date_from and date_to to get_transactions all transactions are returned.

To Reproduce

# Filter transactions by specific date range
transactions = account.get_transactions(date_from: "2021-12-01", date_to: "2022-01-30")

Expected behavior
Only a subset of transactions returned.

Additional context
Looks like the Faraday call here https://github.com/nordigen/nordigen-ruby/blob/master/lib/nordigen-ruby.rb#L38 doesn't actually get the parameters.

Outdated dependencies

Describe the bug
Old(ish) dependencies causes deprecation notices:

Top level ::CompositeIO is deprecated, require 'multipart/post' and use `Multipart::Post::CompositeReadIO` instead!
Top level ::Parts is deprecated, require 'multipart/post' and use `Multipart::Post::Parts` instead!

Faraday seems to be the only outdated gem:

~/d/ynai ▶ bundle outdated
Fetching gem metadata from https://rubygems.org/..........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...

Outdated gems included in the bundle:
  * faraday (newest 2.5.2, installed 1.8.0)
  * faraday-excon (newest 2.1.0, installed 1.1.0)
  * faraday-httpclient (newest 2.0.1, installed 1.0.1)
  * faraday-net_http (newest 3.0.0, installed 1.0.1)
  * faraday-net_http_persistent (newest 2.1.0, installed 1.2.0)
  * faraday-patron (newest 2.0.1, installed 1.0.0)
  * faraday-rack (newest 2.0.0, installed 1.0.0)

And some Googling suggests that it's indeed the culprit. Pinning multipart-post to an earlier version might fix it, but it's an unsatisfactory solution.

To Reproduce
Steps to reproduce the behavior:
Just require the gem in the Gemfile and requiring it in a ruby script seems to trigger it.

Expected behavior
No notices

Please add an example on how to reuse existing tokens

Describe the solution you'd like
I would like to be able to save authentication tokens so that my application does not have to visit Nordigen's or the bank's website each time the user wants to update their transactions. I am aware of the fact that this is required by the PSD2 system every 90 days, but it should not be required on every invocation of the app.

Describe alternatives you've considered
I have implemented a login flow as per the example, but I cannot get the login flow working with client.set_token(...) and an existing Refresh token, without still having to authorize my app by authenticating with the bank.

Additional context
Please add a specific example on how and what to store to be able to repeatedly access an account via Nordigen, without having to authenticate every time.

Thanks!

Access premium endpoint ?

Hi, I was wondering how to access the premium content. I searched in the lib but didn't find the endpoint for:

accounts/premium/{id}/transactions/

In here shouldn't we add a premium condition in AccountApi:

url = if premium
 "#{ENDPOINT}premium/#{@account_id}/"
else 
  "#{ENDPOINT}#{@account_id}/"
end

Thanks for your help !

Add `user_language` and `account_selection` params for requisition

Is your feature request related to a problem? Please describe.
Add the option to set user_language and account_selection when we create a requisition (init_session)

Describe the solution you'd like

# lib/nordigen-ruby.rb

def init_session(redirect_url:, institution_id:, reference_id:, max_historical_days: 90, user_language: "en", account_selection: false)
  # ...
  new_requsition = @requisition.create_requisition(
      redirect_url: redirect_url,
      reference: reference_id,
      institution_id: institution_id,
      user_language: user_language,
      account_selection: account_selection,
      agreement: new_agreement["id"]
  )
  # ...
end
# lib/nordigen_ruby/api/requisitions.rb

def create_requisition(redirect_url:, reference:, institution_id:, user_language: "en", agreement: nil, account_selection: false)
    # ...
    payload = {
        "redirect": redirect_url,
        "reference": reference,
        "institution_id": institution_id,
        "user_language": user_language,
        "account_selection": account_selection,
    }
    # ...
end

It would be nice to be able to suggest Pull Request

Cannot deserialize transactions back to a hash or json from OpenStruct

Is your feature request related to a problem? Please describe.
The Nordigen client is using parser_options: { object_class: OpenStruct } by default when initializing the Faraday request:

https://github.com/nordigen/nordigen-ruby/blob/master/lib/nordigen-ruby.rb#L36

We are trying to get a transaction list to then send to your insights API for categorization, which needs a JSON input according to Nordigen's Open Banking Portal. It is really complicated to get the transactions in this format from the OpenStruct.

Describe the solution you'd like
It would be nice if these parser option could be optional.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.