No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
michaelckelly Merge pull request #2 from cdram/master
Changed URL for fetching LongTailInstitutions
Latest commit 67782be Mar 13, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src Changed URL for fetching LongTailInstitutions Mar 11, 2018
LICENSE Fork plaid-java@0.3.2; set up plaid-java-legacy Feb 16, 2017
README.md Fork plaid-java@0.3.2; set up plaid-java-legacy Feb 16, 2017
pom.xml Fork plaid-java@0.3.2; set up plaid-java-legacy Feb 16, 2017

README.md

plaid-java-legacy

Java Bindings for the Plaid API (https://www.plaid.com/docs)

These bindings are under active development and currently support the main usecases of the Plaid API. There are some parts that are as yet unimplemented so pull requests are welcome!

Installation

Plaid-java is available at Maven Central with the following coordinates (latest release 0.3.2):

<dependency>
  <groupId>com.plaid</groupId>
  <artifactId>plaid-java-legacy</artifactId>
  <version>0.3.2</version>
</dependency>

Basic Usage

// Add Amex user, get 30 days of transactions

PlaidUserClient plaidUserClient = PlaidClients.testUserClient("test_id", "test_secret");
Credentials testCredentials = new Credentials("plaid_test", "plaid_good");
TransactionsResponse response = plaidUserClient.addUser(testCredentials, "amex", "test@test.com", null);

List<Transaction> transactions = response.getTransactions();


// Get all Categories

PlaidPublicClient plaidPublicClient = PlaidClients.testPublicClient();
CategoriesResponse categoriesResponse = plaidPublicClient.getAllCategories();

List<Category> categories = categoriesResponse.getCategories();

Check the Junit test classes for examples of more use cases.

Exchange a Plaid Link public_token for an API access_token

// Initialize a Plaid client with your client_id and secret
PlaidUserClient plaidUserClient = PlaidClients.testUserClient("test_id", "test_secret");

// Exchange the Link public_token ("test,bofa,connected") for an API access_token
PlaidUserResponse response = plaidUserClient.exchangeToken("test,bofa,connected");

// Initialize the user with the access_token returned by the exchangeToken call
plaidUserClient.setAccessToken(response.getAccessToken());

// Pull accounts for the user
// Note: This assumes you are using Link with the "auth" product
AccountsResponse response = plaidUserClient.updateAuth();

To use Stripe ACH + Plaid Integration exchange a public_token and account_id to retrive a Stripe bank account token

// Initialize a Plaid client with your client_id and secret
PlaidUserClient plaidUserClient = PlaidClients.testUserClient("test_id", "test_secret");

// Exchange the Link public_token ("test,bofa,connected") and account_id ("test_account_id")
PlaidUserResponse response = plaidUserClient.exchangeToken("test,bofa,connected", "test_account_id");

// Get the Stripe bank account token from response
String stripeToken = response.getStripeBankAccountToken();

Dependencies

There are two main dependencies (of course automatically managed by Maven):

  1. Apache HTTPComponents Client. One reason for this, besides it being a nice library, is that the native JDK HttpUrlConnection doesn't have support for the HTTP Patch method, that is required by the Plaid API. The bindings are, however, designed so that you can replace HTTPComponents client with the HTTP library of your choice, by creating a different implementation of the HttpDelegate interface.

  2. The Jackson JSON Parser.

The project also has a test scope dependency on Wiremock, which is really useful in order to avoid hitting the sandbox API all the time.

Contributors