Skip to content
 
 

Latest commit

 

History

61 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ruby-plaidio

Ruby gem wrapper for Plaid.io API.

Be sure to read over the very well written Plaid.io documentation at https://plaid.io/v2/docs

Installation

Plaidio is available through Rubygems and can be installed via:

$ gem install plaidio

or add it to your Gemfile like this:

gem 'plaidio'

Usage

require 'plaidio'

Plaidio global configuration

Pop this into your enviornment file.

Plaidio.config do |config|
  config.customer_id = keys[CUSTOMER_ID]
  config.secret = keys[SECRET]
end

Now create a YML file that has your CUSTOMER_ID and your SECRET provided by Plaid.io

There are two different requests one can make using the gem. Call and Customer.

Call Methods

Call is anything that does not require an access_token.

  1. add_account( type , username , password , email )
    Returns a hash with keys: code, access_token, accounts, transactions all with embedded json from Plaid.
# if(code == 200) {returns {[:code => 'x'],[:access_token => 'y'],[:accounts => 'z'],[:transactions => 'a']}
# Note: 'x','y','z','a' are all formatted as json. 

Ex)
  new_account = Plaidio.call.add_account("amex","plaid_test","plaid_good","test@gmail.com") 
  puts new_account[:code]
  "200"
  1. get_place( id )
    Returns a hash with keys: entity and location all with embedded json from Plaid.
# if(code == 200) {returns {[:entity => 'x'],[:location => 'y']}
# Note: 'x','y' are formatted as json. 

Ex)
  location_deets = Plaidio.call.location("52a77fea4a2eab775f004109") 
  puts new_account[:location]["address"]
  "125 Main St"

Customer Methods

Customer defines anything that requires an access_token.

  1. mfa_step( access_token , code )
    Returns a hash with keys: code, access_token, accounts, transactions all with embedded json from Plaid.
# if(code == 200) {returns {[:code => 'x'],[:access_token => 'y'],[:accounts => 'z'],[:transactions => 'a']}
# Note: 'x','y','z','a' are all formatted as json. 

Ex)
  new_account = Plaidio.customer.mfa("test","tomato") 
  puts new_account[:code]
  "200"
  1. get_transactions( access_token )
    Returns a hash with key transaction
# if(code == 200) {returns {[:transaction => 'x']}
# Note: 'x' is formatted as json. 

Ex)
  transactions = Plaidio.customer.transactions("test") 
  puts transactions[:transactions][1]["amount"]
  1334.99
  1. delete_account( access_token )
    Returns a hash with key code
Ex)
  message = Plaidio.customer.delete("test") 
  puts message[:code]
  "200"

Requirements

  • Ruby 2.0.0 or higher

About

Ruby bindings for Plaid

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors