格子:格子。创建被卡住了

发布于 2025-01-29 07:34:43 字数 1110 浏览 3 评论 0原文

我正在与使用香草JavaScript的格子集成。我能够获得link_token,以便使用plaid.create({...})创建格子平台。但是,我遇到了这个怪异的错误,其中plaid.create.greate({...})被困在加载状态下而无需解决onsuccess。当启动handler.open()时,格子接口会出来,但是用户名和密码都在说无效的凭据(我猜这是由于丢失的OnSuccess Call造成的)。这是代码段(没有控制台错误,只有on Load的控制台消息):有人可以帮助我解决这个问题吗?谢谢你!

 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();
}

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();
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文