Git Product home page Git Product logo

angular-plaid-link's People

Contributors

csbarnes avatar

Stargazers

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

Watchers

 avatar  avatar

angular-plaid-link's Issues

Metadata on successful callback

I have not been able to get the metadata object on the success callback. This is needed for the Stripe ACH integration (https://plaid.com/docs/link/stripe/#step-3-integrate-with-plaid-link).

 onSuccess: function(public_token, metadata) {
    // The onSuccess function is called when the user has successfully
    // authenticated and selected an account to use.
    //
    // When called, you will send the public_token and the selected
    // account ID, metadata.account_id, to your backend app server.
    //
    // sendDataToBackendServer({
    //   public_token: public_token,
    //   account_id: metadata.account_id
    // });
    console.log('Public Token: ' + public_token);
    console.log('Customer-selected account ID: ' + metadata.account_id);
  },

So I'm trying to get the metadata object like this:

plaidLink.create({}, function (public_token, metadata) {
    console.log('token', public_token);
    console.log('metadata', metadata); // undefined
}

Am I missing something? Thanks

onSuccessHandler is not a function

I'm getting this error after the onSuccess runs.

metadata is undefined even though I have selectAccount: true
token does have value

Uncaught TypeError: onSuccessHandler is not a function link-initialize.js?_=1467893467014:2

myApp.config([
'plaidLinkProvider',

    function(plaidLinkProvider) {
        plaidLinkProvider.init({
            selectAccount: true,
            clientName: 'My App',
            env: 'tartan',
            key: 'test_key',
            product: 'auth'
        });
    }
])

.controller('mainPlaidCtrl', [
    '$scope',
    'plaidLink',
    'PlaidService',

    function($scope, plaidLink, PlaidService) {
        var plaidService = PlaidService;
        $scope.token = '';
        $scope.plaidIsLoaded = plaidLink.isLoaded;

        plaidLink.create({
            onSuccess: function(token, metadata) {
                $scope.token = token;
                console.log('metadata', metadata);
                console.log('token', token);
                var plaidSuccessObject = {};
                    plaidSuccessObject.public_token = token;
                    // plaidSuccessObject.account_id = metadata.account_id;
                    plaidService.sendToken(plaidSuccessObject);

            },
            onExit: function() {
                console.log('user closed');
            }
        });

        $scope.openPlaid = function() {
            plaidLink.open();
        };
    }
]);
<script type="text/javascript" src="/assets/vendors/angular/angular.min.js"></script>
<link data-require="[email protected]" data-semver="3.2.0" rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" />

<link href="https://netdna.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">

<script src="/assets/vendors/angular-plaid-link/src/angular-plaid-link.js"></script>

< body >

< script src="https://cdn.plaid.com/link/stable/link-initialize.js"></script>

< script type="text/javascript" src="/assets/scripts/plaidexample.js"></script>

< /body >

metadata is undefined in the onSuccess callback.

Hi.

As below... this is my code. selectAccount is set to true but metadata is coming back as undefined here. Any ideas?

This is an a controller.

Thanks in advance.

    function plaidSetup() {
      plaidLink.create({
        onSuccess: function (public_token, metadata) {
          console.log(`token: ${public_token}`);
          console.log(`metadata: ${metadata}`); // <--undefined
          vm.public_token = public_token;
        },
        onExit: function () {
          console.log('user closed');
        },
        selectAccount: true
      });
    }

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.