Giter Club home page Giter Club logo

plaid-node's Introduction

plaid-node npm version

The official Node.js client library for the Plaid API.

Table of Contents

Install

$ npm install plaid

Versioning

This release only supports the latest Plaid API version, 2020-09-14, and is generated from our OpenAPI schema.

For information about what has changed between versions and how to update your integration, head to the API upgrade guide.

The plaid-node client library is typically updated on a monthly basis. The canonical source for the latest version number is the client library changelog. New versions are published as GitHub tags, not as Releases. New versions are also published on npm. Plaid uses semantic versioning to version the client libraries, with potentially breaking changes being indicated by a major version bump.

All users are strongly recommended to use a recent version of the library, as older versions do not contain support for new endpoints and fields. For more details, see the Migration Guide.

Getting started

Most endpoints require a valid client_id and secret as authentication. Attach them via the configuration.

import { Configuration, PlaidApi, PlaidEnvironments } from 'plaid';

const configuration = new Configuration({
  basePath: PlaidEnvironments.sandbox,
  baseOptions: {
    headers: {
      'PLAID-CLIENT-ID': CLIENT_ID,
      'PLAID-SECRET': SECRET,
    },
  },
});

The PlaidEnvironments parameter dictates which Plaid API environment you will access. Values are:

The baseOptions field allows for clients to override the default options used to make requests. e.g.

const configuration = new Configuration({
  basePath: PlaidEnvironments.sandbox,
  baseOptions: {
    // Axios request options
  },
});

Dates

Dates and datetimes in requests and responses are represented as strings.

Time zone information is required for request fields that accept datetimes. Failing to include time zone information will result in an error. See the following examples for guidance on syntax.

If the API reference documentation for a field specifies format: date, use a string formatted as 'YYYY-MM-DD':

const start_date = '2022-05-05';

If the API reference documentation for a field specifies format: date-time, use a string formatted as 'YYYY-MM-DDTHH:mm:ssZ':

const start_date = '2019-12-12T22:35:49Z';

Error Handling

All errors can now be caught using try/catch with async/await or through promise chaining.

try {
  await plaidClient.transactionsSync(request);
} catch (error) {
  const err = error.response.data;
}

// or

plaidClient
  .transactionsSync(request)
  .then((data) => {
    console.log(data);
  })
  .catch((e) => {
    console.log(e.response.data);
  });

Note that the full error object includes the API configuration object, including the request headers, which in turn include the API key and secret. To avoid logging your API secret, log only error.data and/or avoid logging the full error.config.headers object.

Examples

For more examples, see the test suites, Quickstart, or API Reference documentation.

Exchange a public_token from Plaid Link for a Plaid access_token and then retrieve account data:

const response = await plaidClient.itemPublicTokenExchange({ public_token });
const access_token = response.data.access_token;
const accounts_response = await plaidClient.accountsGet({ access_token });
const accounts = accounts_response.data.accounts;

Retrieve the last 100 transactions for a transactions user (new, recommended method):

const response = await plaidClient.transactionsSync({
  access_token
});
const transactions = response.data.transactions;
);

Retrieve the transactions for a transactions user for the last thirty days (using the older method):

const now = moment();
const today = now.format('YYYY-MM-DD');
const thirtyDaysAgo = now.subtract(30, 'days').format('YYYY-MM-DD');

const response = await plaidClient.transactionsGet({
  access_token,
  start_date: thirtyDaysAgo,
  end_date: today,
});
const transactions = response.data.transactions;
console.log(
  `You have ${transactions.length} transactions from the last thirty days.`,
);

Get accounts for a particular Item:

const response = await plaidClient.accountsGet({
  access_token,
  options: {
    account_ids: ['123456790'],
  },
});
console.log(response.data.accounts);

Download Asset Report PDF:

const pdfResp = await plaidClient.assetReportPdfGet(
  {
    asset_report_token: assetReportToken,
  },
  {
    responseType: 'arraybuffer',
  },
);

fs.writeFileSync('asset_report.pdf', pdfResp.data);

Promise Support

Every method returns a promise, so you can use async/await or promise chaining.

API methods that return either a success or an error can be used with the usual then/catch paradigm, e.g.

plaidPromise
  .then((successResponse) => {
    // ...
  })
  .catch((err) => {
    // ...
  });

For example:

import * as bodyParser from 'body-parser';
import * as express from 'express';
import { Configuration, PlaidApi, PlaidEnvironments } from 'plaid';

const configuration = new Configuration({
  basePath: PlaidEnvironments.sandbox,
  baseOptions: {
    headers: {
      'PLAID-CLIENT-ID': CLIENT_ID,
      'PLAID-SECRET': SECRET,
      'Plaid-Version': '2020-09-14',
    },
  },
});

const plaidClient = new PlaidApi(configuration);

const app = express();
const port = process.env.PORT || 3000;

app.use(
  bodyParser.urlencoded({
    extended: true,
  }),
);
app.use(bodyParser.json());

app.post('/plaid_exchange', (req, res) => {
  var public_token = req.body.public_token;

  return plaidClient
    .itemPublicTokenExchange({ public_token })
    .then((tokenResponse) => tokenResponse.access_token)
    .then((access_token) => plaidClient.accountsGet({ access_token }))
    .then((accountsResponse) => console.log(accountsResponse.data.accounts))
    .catch((error) => {
      const err = error.response.data;

      // Indicates plaid API error
      console.error('/exchange token returned an error', {
        error_type: err.error_type,
        error_code: err.error_code,
        error_message: err.error_message,
        display_message: err.display_message,
        documentation_url: err.documentation_url,
        request_id: err.request_id,
      });

      // Inspect error_type to handle the error in your application
      switch (err.error_type) {
        case 'INVALID_REQUEST':
          // ...
          break;
        case 'INVALID_INPUT':
          // ...
          break;
        case 'RATE_LIMIT_EXCEEDED':
          // ...
          break;
        case 'API_ERROR':
          // ...
          break;
        case 'ITEM_ERROR':
          // ...
          break;
        default:
        // fallthrough
      }

      res.sendStatus(500);
    });
});

app.listen(port, () => {
  console.log(`Listening on port ${port}`);
});

Migration guide

9.0.0 or later to latest

Migrating from version 9.0.0 or later of the library to a recent version should involve very minor integration changes. Many customers will not need to make changes to their integrations at all. To see a list of all potentially-breaking changes since your current version, see the client library changelog and search for "Breaking changes in this version". Breaking changes are annotated at the top of each major version header.

Pre-9.0.0 to latest

Version 9.0.0 of the client library was released in August 2021 and represents a major interface change. Any customer migrating from a version prior to 9.0.0 should consult the migration guide below.

This version represents a transition in how we maintain our external client libraries. We are now using an API spec written in OpenAPI 3.0.0 and running our definition file through OpenAPITool's typescript-axios generator. All tests have been rewritten in Typescript.

Client initialization

From:

const configs = {
  clientID: CLIENT_ID,
  secret: SECRET,
  env: plaid.environments.sandbox,
  options: {
    version: '2020-09-14',
  },
};

new plaid.Client(configs);

To:

const configuration = new Configuration({
  basePath: PlaidEnvironments.sandbox,
  baseOptions: {
    headers: {
      'PLAID-CLIENT-ID': CLIENT_ID,
      'PLAID-SECRET': SECRET,
      'Plaid-Version': '2020-09-14',
    },
  },
});

new PlaidApi(configuration);

Endpoints

All endpoint requests now take a request model, have better Typescript support and the functions have been renamed to move the verb to the end (e.g getTransactions is now transactionsGet). Callbacks are no longer supported.

From:

pCl.sandboxPublicTokenCreate(
  testConstants.INSTITUTION,
  testConstants.PRODUCTS,
  {},
  cb,
);

To:

const request: SandboxPublicTokenCreateRequest = {
  institution_id: TestConstants.INSTITUTION,
  initial_products: TestConstants.PRODUCTS as Products[],
  options,
};

const response = await plaidClient.sandboxPublicTokenCreate(request);

Errors

From:

pCl.getTransactions(
  accessToken,
  startDate,
  endDate,
  { count: count, offset: offset },
  (err, response) => {
    if (err) {
      if (err.status_code === 400 && err.error_code === 'PRODUCT_NOT_READY') {
        setTimeout(() => {
          getTransactionsWithRetries(
            accessToken,
            startDate,
            endDate,
            count,
            offset,
            num_retries_remaining - 1,
            cb,
          );
        }, 1000);
      } else {
        throw new Error('Unexpected error while polling for transactions', err);
      }
    } else {
      cb(null, response);
    }
  },
);

To:

plaidClient
  .transactionsGet(request)
  .then((response) => resolve(response.data))
  .catch(() => {
    setTimeout(() => {
      if (retriesLeft === 1) {
        return reject('Ran out of retries while polling for transactions');
      }
      getTransactionsWithRetries(
        plaidClient,
        access_token,
        start_date,
        end_date,
        count,
        offset,
        ms,
        retriesLeft - 1,
      ).then((response) => resolve(response));
    }, ms);
  });

or use `try/catch`

try {
  await plaidClient.transactionsGet(request);
} catch (error) {
  const err = error.response.data;
  ...
}

Enums

While the API and pre-9.0.0 versions represent enums using strings, 9.0.0 and later allows either strings or Node enums.

Old:

products: ['auth', 'transactions'],

Current:

products: ['auth', 'transactions'],

// or

const { Products } = require("plaid");

products: [Products.Auth, Products.Transactions],

Support

Open an issue!

Contributing

Click here!

License

MIT

plaid-node's People

Contributors

aarohmankad avatar aeidelson avatar cgfarmer4 avatar davidchambers avatar davidzhanghp avatar dependabot[bot] avatar dsfish avatar gargavi avatar jdudek avatar jeffzwang avatar jking-plaid avatar mattnguyen1 avatar michaelckelly avatar nathankot avatar nkomanski avatar notthefakestephen avatar ntindall avatar otherchen avatar pbernasconi avatar peterbsmyth avatar philmod avatar phoenixy1 avatar rajeevmehrotra avatar rayraycano avatar sjlu avatar skylarmb avatar stephenjayakar avatar timruffles avatar vorpus avatar whockey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

plaid-node's Issues

addAuthUser not working for American Express

I'm following the instructions to authorize a user on an American Express account but I get this response:

I20160714-16:25:44.128(-4)? { code: 1601,
I20160714-16:25:44.129(-4)?   message: 'product not available',
I20160714-16:25:44.129(-4)?   resolve: 'This product is not yet available for this institution.',
I20160714-16:25:44.129(-4)?   statusCode: 404 }

The documentation says American Express is supported - what gives?

Here's my code:

import plaid from 'plaid';
const plaidClient = new plaid.Client(myPlaidClientId, myPlaidSecrett, plaid.environments.tartan);

plaidClient.addAuthUser('amex', {username: 'myUsername', password: 'myPassword'}, function (error, response) {
  if (error) {
    console.log(error);
  }
  else {
    console.log(response);
  }
);

createStripeToken always return null/undefined.

Hey!

I've been trying to use the createStripeToken method but even with all the right credentials and tokens, it seems to be returning null/undefined. I tried manually requesting the stripe token using post man with the same credentials/sandbox accounts and it returned a valid token. Any help would be appreciated!

Unhandled TypeError on 503 error

Hi,

I was doing some testing against a plaid sandbox the other day and had a 503 response from the server, I didn't inspect the body of the response at the time but my assumption is it wasn't something that parsed to an object. Because of this, the module throws a TypeError "Cannot assign to read only property 'status_code'" but this error doesn't appear to be caught in the promise implementation.

In plaidRequest.js (line: 77), the following code creates the Promise:
return wrapPromise(new Promise(function(resolve, reject) { request(requestOptions, function(err, res, body) { handleApiResponse(resolve, reject, err, res, body, requestSpec.includeMfaResponse); }); }), cb);

but the TypeError occurs at the start of the handleApiResponse function, isn't caught and doesn't reject the Promise. Meaning I can't handle these errors which may occur - I assume it'll be the same for any non-code based responses that don't return an object response.

I've tested this locally using nock (npm module for stubbing http requests), with the following stub:
nock('https://sandbox.plaid.com) .post('/institutions/get', {"secret":"${secret}","client_id":"${client_id}","count":500,"offset":0}) .reply(503, 'oops')

and then making a request to client.getInstitutions(500, 0)

Access token error when running quickstart code

Hello,

I get this error when trying to run the python quickstart code on this github. I also tried running the node version, which returned a 400 INVALID_REQUEST error, with error code INVALID_FIELD.

Specifically, here is the screenshot when I try to log in using user_good on sandbox mode:

screen shot 2017-06-22 at 10 12 00 am

Does anyone know what could be the issue? Aside from adding my api keys, I have not modified the code. I have used pip to install all the relevant packages.

Thanks!
Sam

MFA return answer

Hello,

Using your example code. When there is an MFA, how do you enter the answer? If I run the code once the console outputs the MFA question or sends the code, but upon inserting the answer and running again, it will either generate a new code or ask a different question.

Thanks

Webhook api, examples and documentation

The plaid-node library does not include any substantive information about setting and receiving webhooks. There is only one function (webhook update).

There nearly zero documentation about what is required to set webhooks (only to update them) and even less about the what degree of granularity is available. For example if i want all transactions from an item_id what timeframes can i request them ? Immediately? Batched hourly, daily, weekly, monthly?

Also I realize that someone went to a lot of trouble to create this api but it is really much easier to use the rest / curl specification. By doing this the entire plaid node code base and its unnecessarily arcane api can be avoided. (They use ramda for functional type (or 2015) methods such as merge in lieu of Object.assign ).

I would be willing to provide a full rest only version if anyone is interested but only in exchange for some better data about webhooks so i can include that information in the request calls.

Also I had to grow my own async and yield implementation of the api which is why i tossed the plaid version. I have offered this to plaid but instead they said to submit it to github.

I hope that my experience with plaid and their lackadaisical attitude to virtually every issue i have raised is an anomaly.

CORS issue

I'm trying to call the Plaid API from an Ionic app and getting a CORS error.
My guess is I need a self signed cert or some such thing. Can someone guide me into the best practice for both testing this (localhost, non https env) as well as production inside a hybrid app?

Fetch API cannot load https://tartan.plaid.com/connect/get. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://192.168.1.151:8100' is therefore not allowed access. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

Return request id as requestId (camel-case) instead of request_id

First, thanks for adding this!

It would be slightly better from my perspective if you converted request_id to camel-case, as you do with statusCode. We're referencing this in our code in a few places, and it's annoying to have to keep track of different naming conventions for variables in the same module.

Can't make any requests

Hey there,

This isn't an issue with this library I believe, but the internal request library isn't returning any data from your endpoints. I'm calling plaid.getInstitutions() which internally is calling:

REQUEST: 
    { 
        uri: 'https://tartan.plaid.com/institutions',
        method: 'GET',
        body: {} 
    }

After 60 seconds it times out and returns nothing.

If you go to https://tartan.plaid.com/institutions the response is correct. So I'm just curious where the hangup is.

Pending for wells fargo

Here is my script to pull transactions from my wells fargo bank:

var plaid = require('plaid');

var plaidClient = new plaid.Client('__removed__', '__removed__', plaid.environments.tartan);

var options = {};

plaidClient.addConnectUser('wells',
    {
        username: '__wells_username__',
        password: '__password_removed__',
    },
    options,
    function(err, mfaRes, response) {
        var token = response.access_token;

        plaidClient.getConnectUser(token,
            {
                pending: true, // <-- SPECIFIED
                account: response.accounts[0]._id,
                gte: '5 days ago',
            },
            function(err, response) {
                // console.dir(response);
                for(var i = 0; i < response.transactions.length; i++) {
                  var t = response.transactions[i];
                  console.log(t.date + '\t' + (t.amount * -1) + '\t\t' + t.name);
                }
            });
    });

I don't see any pending transactions.

This thing also doesn't work:

curl -X POST https://tartan.plaid.com/connect/get \
  -d client_id=__ID_REMOVED__ \
  -d secret=__SECRET_REMOVED__ \
  -d options='{"pending":true, "gte":"5 days ago"}' \
  -d account=__ACCOUNT_REMOVED__ \
  -d access_token=__TOKEN_REMOVED__

I've seen on GitHub that you ask customers to contact them by email. I'm not ready to give you my token. Feel free to go ahead and try it yourself. Wells Fargo is quite popular. I think it's something about Plaid.

Let me know and please don't close this issue (as similar other issues you've closed), until it's resolved. Thanks for help!

No getIncome function

Hey there! I feel like I'm going crazy right now - there's a getIncome function that's mentioned in the docs, but it's undefined in the client library and I can't find it in the code here. If you switch to node, it's specified in the docs here: https://plaid.com/docs/api/#income

Is this not implemented yet or am I missing something?

Thanks!

Changelog?

Please consider publishing a CHANGELOG.md file.

Update webhook (Patch) not working without creadential

When i tried to do it,

plaidClient.patchConnectUser(access_token, {}, {
  webhook: 'http://requestb.in',
}, function(err, mfaResponse, response) {
  // The webhook URI should receive a code 4 "webhook acknowledged" webhook 
});

i got below error -

{ code: 1200,
  message: 'invalid credentials',
  resolve: 'The username or password provided were not correct.',
  access_token: 'test_bofa',
  statusCode: 402 }

As per documentation i can call PATCH /connect without username/password. is there something missing in node lib. can any one help me out please.

Pending transactions for Discover Card

I'm not getting any pending transactions for my Discover Card account. I've waited 48 hours just to be sure. I wanted to make sure there wasnt any pending flag I need to set for in options in createItem for example. Saw legacy issue #70 so just wanted to be sure if this was also the case for the latest API.

How would you submit a webhook update with the PATCH request?

There doesn't seem to be a way to submit a webhook update via the patchConnectUser method without including the credentials. The official Plaid documentation would suggest this is possible.

PATCH may also be used to update the webhook associated with a particular user. A PATCH request submitted without credentials but with a webhook will trigger a confirmation webhook.

How to get updated date with transaction list ?

Hi,

I'm using getConnectUser() to get all transactions, It send me "date" field, which is created date i think, I want updated date of transaction. Is there any way to get updated date along with created date?

open source proects

Do you know of any open source projects using plaid-node? It would be great to look at the patterns they're using.

plaidClient.exchangeToken method not returning stripe_bank_account_token

On my Plaid dashboard I have been approved for the Stripe ACH + Plaid Link integration and see the following message: You're approved to use Plaid Link to instantly tokenize your customers' bank accounts for use with Stripe's ACH API. Your Stripe account is linked! Check out a demo and then head to the docs to get started.

But when I try to use the exchangeToken method using the plaid-node library I only get a access_token back and not a stripe_bank_account_token. Below is my implementation. I'm using the sandbox environment.

plaidClient.exchangeToken(public_token, account_id, function(err, response) {
if (err != null) {
// Handle error!
console.log("PLAID exchange token error", err)
} else {
// This is your Plaid access token - store somewhere persistent
// The access_token can be used to make Plaid API calls to
// retrieve accounts and transactions
var access_token = response.access_token;
var bank_account_token = response.stripe_bank_account_token;
console.log("PLAID ACCESS TOKEN and STRIPE TOKEN", access_token, bank_account_token)
}
});

Unable to exchange public token

I have successfully used Link to create items and to retrieve a public token from the item. However, every attempt at plaidClient.exchangePublicToken results in an error. I have made sure that the req.body is correctly populated with the public_token.

My plaid keys are regular strings.

The item public_key is correctly passed to the exchangePublicToken function.

The error is very vague and only states that Could not exchange public_token!

What do I seem to be doing wrong?

var express = require('express');
var router = express.Router();
var bodyParser = require('body-parser');
var plaid = require('plaid');

// fake keys for this example
var PLAID_CLIENT_ID = '123123123123';
var PLAID_SECRET = '123123123123123';
var PLAID_PUBLIC_KEY = '123123123123123';
var PLAID_ENV = 'development';

// Initialize the Plaid plaidClient
var plaidClient = new plaid.Client(
    PLAID_CLIENT_ID,
    PLAID_SECRET,
    PLAID_PUBLIC_KEY,
    plaid.environments[PLAID_ENV]
);

router.use(bodyParser.json());
router.use(bodyParser.urlencoded({ extended: true }));

router.post('/authenticate_item', function(req, res, next) {
  var accountPublicToken = req.body.public_token;
  plaidClient.exchangePublicToken(accountPublicToken, function(error, tokenResponse) {
    if (error != null) {
        var msg = 'Could not exchange public_token!';
        console.log(msg + '\n' + error);
        return res.json({error: msg});
    }

    var accessToken = tokenResponse.access_token;
    console.log('Access Token: ' + accessToken);

  });
});

TypeScript typings

Hi,

I wanted to ask if there exist TypeScript definitions for plaid-node client and how to install them if they exist.

Thanks!

getting all transactions?

Hi

Is there an example of using the offset in getTransactions to get all the transactions for an auth token?

I may just not understand how to deal with this is promises, but it seems like something that isn't useful for the promise model when the only thing we have access to is the offset and the number of results back.

Unable to get transactions while using Sandbox

Hi,
I am testing my code to see if I can retrieve transactions with the stored access_token I got after exchanging public token.

But when I run the getTransaction call, I get the following errors.
error_message: 'provided token is the wrong type. expected "access", got "public"'

This is the value of my access_token for my sandbox testing.

public-sandbox-9200c6b5-edd4-4345-9e3d-ba9e28f95738

Below is my server code.

import moment from 'moment';
import Plaid from 'plaid';
import { Meteor } from 'meteor/meteor';

import {Commits} from '../api/data/commitment';

var client_id="5a8d0fb7bdc6a47debd6ef1b";
var secret="68dc0ffb58972050b872d29a177ec8";
var public_key="24bca70c22bf0174f2b4e10bbe3932";
var plaid_env= Plaid.environments.sandbox;


const plaidClient = new Plaid.Client(client_id, secret, public_key, plaid_env, null);

const now = moment();
const today = now.format('YYYY-MM-DD');
const thirtyDaysAgo = now.subtract(30, 'days').format('YYYY-MM-DD');


Meteor.methods({
    const commitment = Commits.findOne({}, {fields: {'access_token': 1, 'offset':1}});
    if(commitment){
        var {access_token} = commitment;
        var {offset} = commitment;

        plaidClient.getTransactions(access_token, thirtyDaysAgo, today, 
            options={
                offset
            },
            (err, res) => {
                console.log(err);
        });
    }
});

Can someone tell me what I am obviously doing wrong? Thanks.

Adding live account to sandbox works but production fails

If I connect via our correct secret, id and "plaid.environments.tartan" everything works as expected and I can add a user. However if I switch to "plaid.environments.production" it fails at "plaid.exchangeToken(publicToken, callback)" with an 1106 error.

Add API for discriminating errors

Right now, determining whether an error is plaid-caused or network caused is a little awkard. We should consider building a simple function like isPlaidError that can be called on error objects. For type script, we can make the typing for this a user defined type guard so that the typing compiles.

See discussion here: #138 (comment)

Is it possible to step PATCH requests?

I'm running into some issues calling PATCH requests with mfa responses. Looks like stepConnectUser always calls a POST method. There are instances though when we need to call a PATCH method on the step methods

A changelog or upgrade guide would be nice for large API changes

Based on the blog post (and our breaking build) it seems like 2.0 was a relatively large change however we can't seem to find any upgrade guide or changelog to help us understand what we need to do specifically to upgrade to 2.0. Is this just buried somewhere and we missed it?

Retrieve status of token?

Is there an endpoint or otherwise some common method of confirming the 'state' of an account/token?

I've run into various situations now for instance where I would like to check the current products associated to see if an upgrade is needed, or to check what the current webhook is associated with this token.. those sorts if things.

Support for createItem, MFA, patchItem

In the documentation for Methods, I don't see any that accept credentials for creating/patching items. However in the section on Promise Support, there is the following:

const promise = plaidClient.createItem(credentials, institutionId, products);

Does this library and the 2.0 API support manual management of Items by passing in the raw credentials, or must we use Link to accomplish these tasks?

Testing MFA against sandbox credentials

Hello,

I'm trying to trigger the MFA when creating an item but I always get an INVALID_CREDENTIALS error. I've tried different combinations for the password making sure username is: user_good. I've tried different institutions including the five supported sandbox only institutions. Any suggestions?

You can trigger any type of MFA flow that Plaid supports when creating an Item. Do so by using username user_good and modifying the password

Example unclear

The example provided is very unclear. Who's email is "[email protected]"? The user's? Also, the credentials 'demo' and 'test' don't seem to work. After some digging it looks like 'plaid_test' and 'plaid_good' do, though.

plaid.connect({username: 'demo', password: 'test'}, 'type', '[email protected]', function(error, response, mfa){
...
}

Library sends secret information through the URL

https://github.com/plaid/plaid-node/blob/master/lib/client.js#L197

Regardless of request type, the Node library seems to send all relevant request information in the URL. This is a really big problem, as we're talking about access keys, secrets, account information, etc.

Offending code in _exec:

var query = {
      client_id   : this.client_id
    , secret      : this.secret
    , credentials : JSON.stringify(this.credentials)
    , type        : this.type
    , email       : this.email
    , access_token: this.access_token
    , options     : JSON.stringify(this.options)
    , mfa         : this.mfa
  }

  // the login option has to be set a separate parameter
  if (this.options.login) {
    query.login = this.options.login;
  }

  uri += "?"+qs.stringify(query);

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.