Coder Social home page Coder Social logo

plaid-elixir's Introduction

Plaid

Build Status Coverage Status Hex.pm Version Hex.pm Download Total

Documentation

Elixir library for Plaid's V2 API.

Supported Plaid products:

  • Transactions
  • Auth
  • Identity
  • Balance
  • Income
  • Assets
  • Investments

Plaid Documentation

Usage

Add to your dependencies in mix.exs. The hex specification is required.

def deps do
  [{:plaid, "~> 2.0", hex: :plaid_elixir}]
end

Configuration

All calls to Plaid require either your client id and secret, or public key. Add the following configuration to your project to set the values. This configuration is optional as of version 1.6, see below for a runtime configuration. The library will raise an error if the relevant credentials are not provided either via config.exs or at runtime.

config :plaid,
  root_uri: "https://development.plaid.com/",
  client_id: "your_client_id",
  secret: "your_secret",
  public_key: "your_public_key",
  httpoison_options: [timeout: 10_000, recv_timeout: 30_000]

By default, root_uri is set by mix environment. You can override it in your config.

  • dev - development.plaid.com
  • prod- production.plaid.com

Finally, you can pass in custom configuration for HTTPoison. It's recommended you extend the receive timeout for Plaid, especially for retrieving historical transactions.

Runtime configuration

Alternatively, you can provide the configuration at runtime. The configuration passed as a function argument will overwrite the configuration in config.exs, if one exists.

For example, if you want to hit a different URL when calling the /accounts endpoint, you could pass in a configuration argument to Plaid.Accounts.get/2.

Plaid.Accounts.get(%{access_token: "my-token"}, %{root_uri: "http://sandbox.plaid.com/", secret: "no-secrets"})

Obtaining Access Tokens

Access tokens are required for almost all calls to Plaid. However, they can only be obtained using Plaid Link.

Call the /link endpoint to create a link token that you'll use to initialize Plaid Link. Once a user successfully connects to his institution using Plaid Link, a public token is returned to the client. This single-use public token can be exchanged for an access token and item id (both of which should be stored) using Plaid.Item.exchange_public_token/1.

Consult Plaid's documentation for additional detail on this process.

Compatibility

As of version 1.2, this library natively supports serialization of its structs using Jason for compatibility with Phoenix.

Tests and Style

This library uses bypass to simulate HTTP responses from Plaid.

It uses Elixir's native formatter as of 1.3.2 and Credo.

plaid-elixir's People

Contributors

wfgilman avatar jc00ke avatar agramichael avatar cblage avatar degzhaus avatar lightningk0ala avatar churcho avatar dnsbty avatar filmknurd avatar kafaichoi avatar pdgonzalez872 avatar mrhooray avatar backdoer avatar tylerwray avatar zacck avatar

Watchers

James Cloos avatar

Forkers

alchemyfintech

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.