'Plaid: Plaid.create is stuck onLoading
I am integrating with Plaid using vanilla javascript. I am able to get the link_token in order to create the Plaid platform using Plaid.create({...}). However, I am running into this weird bug where Plaid.create({...}) is stuck on loading state without ever resolving into onSuccess. When handler.open() is initiated, the plaid interface comes out but both usernames and password are saying invalid credentials (i am guessing this is due to the missing onSuccess call). Here is the code snippet (there are no console errors, just the console message from onLoad): Can anybody help me figure this out? Thank you!
function syncUpWithPlaid(token) {
const handler = Plaid.create({
token,
onSuccess: (public_token, metadata) => {
console.log('success!', public_token)
fetch('http://localhost:8000/api/tracking/access-token', {
method: 'POST',
body: {
public_token: public_token,
accounts: metadata.accounts,
institution: metadata.institution,
link_session_id: metadata.link_session_id,
},
});
},
onLoad: () => {
console.log('loading') // for some reason it is stuck here
},
onExit: (err, metadata) => {
console.log('err', err);
},
onEvent: (eventName, metadata) => {
console.log('eventName', eventName)
console.log('metadata', metadata)
},
});
handler.open();
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
