View Source Plaid Elixir Library

build Hex Version Hex Docs Hex.pm MIT License

Simply Beautiful Elixir library for the Plaid API.

motivation-principles

Motivation & Principles

  1. Provide FANTASTIC documentation
  2. Full plaid API coverage
  3. Use the plaid API versioning plan
  4. Return well-defined structs, always

example-usage

Example Usage

# get auth data
Plaid.Auth.get("access-prod-123xxx", client_id: "123", secret: "abc")

# get item details
Plaid.Item.get("access-prod-123xxx", client_id: "123", secret: "abc", env: :production)

# refresh transactions
Plaid.Transactions.refresh("access-prod-123xxx", client_id: "123", secret: "abc", env: :development)

# get categories
Plaid.Categories.get(env: :production)

api

API

Full Documentation on HexDocs.

configuration

Configuration

Each function takes a Plaid.config keyword list as it's trailing argument. Authenticated requests require a client_id and secert at minimum for authentication with the plaid API.

KeyValue
:client_idYour plaid client id. (required for authenticated requests)
:secretYour plaid secret. (required for authenticated requests)
:envEither :production, :development, or :sandbox. (defaults to :sandbox)
:http_clientAny module that implements the Plaid.Client behaviour. (defaults to Plaid.Client.HTTPoison)
:test_api_hostAny base URL e.g. http://localhost:2100/.

The choice to avoid using application configuration is due to the anti-pattern documented by elixir of libraries using application configuration. Passing configuration to each function avoids the library touching any global state, as well as making function calls objectively more "functional".

Likely you will need to pass keys dynamically anyway for development/production, overwriting the need for global application config. Therefore using patterns like those outlined in this blog post and using a test mocking library like Mox help aid in making code more clear.

installation

Installation

Add elixir_plaid to your list of dependencies in mix.exs:

def deps do
  [
    {:elixir_plaid, "~> 1.0.0"}

    # optional, but recommended http client
    {:httpoison, "~> 1.7"}
  ]
end

versioning

Versioning

Each major version of elixir_plaid targets a specific version of the Plaid API:

API versionpackage version
2020-09-14 (latest)1.x.x

For information about what has changed between API versions, head to the version changelog.

api-coverage

API Coverage

βœ… - Full Coverage

πŸ— - In Progress

πŸ—Ί - On the Roadmap

APIStatus
Accountβœ…
Assetsβœ…
Authβœ…
Balanceβœ…
Bank Transfers (beta)πŸ—Ί
Deposit Switch (beta)πŸ—Ί
EmployerπŸ—
EnrichπŸ—ΊοΈ
Identity VerificationπŸ—ΊοΈ
Identityβœ…
IncomeπŸ—ΊοΈ
Institutionβœ…
Investmentsβœ…
Itemβœ…
Liabilitiesβœ…
MonitorπŸ—ΊοΈ
Payment Initiation (UK and Europe)βœ…
Processorβœ…
SandboxπŸ—
SignalπŸ—ΊοΈ
Tokenβœ…
Transactionsβœ…
TransferπŸ—ΊοΈ
Virtual AccountsπŸ—ΊοΈ
WebhooksπŸ—

contributing

Contributing

Bug reports and pull requests are welcome on GitHub. See contributing guidelines for more details.

license

License

The package is available as open source under the terms of the MIT License.