csbarnes / angular-plaid-link Goto Github PK
View Code? Open in Web Editor NEWAngularJS wrapper for Plaid Link
License: MIT License
AngularJS wrapper for Plaid Link
License: MIT License
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
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();
};
}
]);
<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 >
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
});
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.