plaid / plaid-node

Node bindings for Plaid

Home Page:https://plaid.com/docs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Creating a sandbox `public token` to use for creating a `processor token`

legendsjohn opened this issue · comments

I'm writing some integration tests, and am using the API sandboxPublicTokenCreate method to create a public token.

I'd like to use this token to create a processor token, however I have no way to access an associated account_id so my attempts to create processor tokens are failing.

This account_id field would normally be returned in the metadata object of the onSuccess callback that Plaid Link provides. In this integration test, I don't have access to this. Is there a way to obtain a valid account_id field with a sandbox-created public token?

I'd prefer to not exchange the public_token for an access_token and then use the accounts endpoint to obtain the account id. So far this is the only I can find to do this.

commented

That's a great question -- as far as I can see, using the accounts endpoint like you're describing does appear to be the only way to do this. For context when I send this feedback to the team that owns the Sandbox, would it be possible for you to explain why using the accounts endpoint isn't the best solution for your use case?

I wound up doing exactly what I described and used the accounts endpoint to grab account data.

I didn't know this was possible, because I wasn't sure if an access token could be exchanged for a public token multiple times. Apparently it can, so my tests do work.

It would be nice if the sandboxPublicTokenCreate endpoint would provide account metadata to more accurately simulate the onSuccess callback of the Link API. It would definitely simplify my tests.

Hi @legendsjohn! My name is Gilberto and I’m on the Developer Relations team at Plaid. Thank you for your feedback here on the sandbox/public_token/create endpoint! Our team is currently conducting a bit of research to learn more about how devs engage with us. I was wondering if you'd be interested in participating in a 30 minute research session with me and a member of our research team? You would be compensated with a gift card for your time. If you’re interested, let me know and I can send over a Calendly link so we can schedule some time (we could also switch to email, etc., for communication). Thanks! 🙏

commented

@legendsjohn we're currently doing a project to improve sandbox usability and I've sent your feedback along to the team working on it!