Giter VIP home page Giter VIP logo

argyle's Introduction

Argyle Build Status Code Climate Test Coverage

A Rails plugin to make adding Plaid Link integrations super easy. The plugin aims to remove some of the boilerplate and prioritize configuration-over-code. It also encapsulates the plaid-ruby library for use throughout your application.

Plaid is the API for banking data.
Plaid API documentation

If you're attempting to use Stripe ACH with Plaid Link you'll need to get the 1.0.0.beta version of the gem which supports the latest version of the Plaid Ruby Library. Updated documentation.

Installation

Add this line to your Rails application's Gemfile:

gem 'argyle'

And then execute:

$ bundle

Configuration

Create an initializer named argyle.rb in your config/initializers/ directory. It should look like this:

Argyle.configure do |config|
  config.key = 'test_key'         # Public key from Plaid
  config.secret = "test_secret"   # Secret from Plaid
  config.customer_id = "test_id"  # Client ID from Plaid
end

You may also optionally configure the following:

config.env = "production"         # defaults to 'tartan' (Plaid's test environment)
config.product = "connect"        # defaults to 'auth'

Using the Helper

The plaid_link helper takes the following options:

:name => required     # name of the customer used in Plaid Link flow
:action => required   # form action that will be called on successful authentication
:id => 'plaidForm'    # HTML id of the form
:env => 'tartan'      # overrides Argyle.configuration.env
:product => 'auth'    # overrides Arygle.configuration.product
:webhook => optional  # optionally set a webhook for a user
:token => optional    # optionally use an existing token
:data => optional     # optionally set a data attribute. Example: `:data => { :longtail => true }`

Simply place the helper in any of your views to add the Plaid button:

<%= plaid_link(:name => 'Tony Soprano', :action => my_callback_path) %>      

Using the Callback Controller (optional)

Argyle ships with an application controller that takes care of the Plaid token exchange and quickly gives you access to a Plaid user and access token. You can choose to use this controller to scaffold your Plaid Link callback by simply extending it, like so:

class MyPersonalCallBack < Argyle::CallbackController
  ...
end

Inside your controller you now have access to the following methods:

plaid_access_token - the raw access token for the authenticated user. You'll most likely want to store this in the DB.
plaid_user - an instance of a Plaid User (as defined in plaid-ruby)

Access to the Plaid client

Since we make use of the Plaid client within Argyle, it is also exposed for your use if you need to make calls to the Plaid API. Argyle.plaid_client returns an instance of Plaid from plaid-ruby

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/jcbarry/argyle. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

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

argyle's People

Contributors

jcbarry avatar jespr avatar

Watchers

 avatar

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.