plaid v0.3.0 Plaid.Token
Functions for working with a Plaid token.
Through this API you can:
- Exchange a public token for an access token
Plaid API Reference: https://plaid.com/docs/quickstart/#-exchange_token-endpoint
- TODO: incorporate account
_id
in payload.
Summary
Functions
Exchanges a public token for an access token
Functions
Specs
exchange(binary | map, map) :: {atom, binary | map}
Exchanges a public token for an access token.
Exchanges a user’s public token for an access token. If credentials are not supplied, credentials in the default configuration are used.
Returns access_token or Plaid.Error
struct.
Args
params
-map
orstring
- req - public token or Payloadcred
-map
- opt - Plaid credentials
Payload
public_token
-string
- req - Public token returned from Plaid Link
Example
params = "test,bofa,connected"
cred = %{client_id: "test_id", secret: "test_secret"}
{:ok, "test_bofa"} = Plaid.Token.exchange("test,bofa,connected")
{:ok, "test_bofa"} = Plaid.Token.exchange(params)
{:ok, "test_bofa"} = Plaid.Token.exchange(params, cred)
{:error, %Plaid.Error{...}} = Plaid.Token.exchange(params, cred)