还有其他人对 Plaid 的 linkTokenCreate 方法有疑问吗?我使用 node.js 作为后端,当我与前端一起运行它时,错误从涉及此函数的行开始。
即使我使用标准快速启动选项,我仍然收到相同的 400 bad request 错误。
这是后端代码,与快速入门相同。我只是测试链接令牌,因此它是我定义的唯一路由。
app.post('/create_link_token', function (request, response, next) {
console.log('HI THERE')
Promise.resolve()
.then(async function () {
const configs = {
user: {
//this should be a unique id for the current user.
client_user_id: 'user-id',
},
client_name: 'Plaid Quickstart',
products: PLAID_PRODUCTS,
country_codes: PLAID_COUNTRY_CODES,
language: 'en',
};
console.log(configs);
// if (PLAID_REDIRECT_URI !== '') {
// configs.redirect_uri = PLAID_REDIRECT_URI;
// };
const createTokenResponse = await client.linkTokenCreate(configs);
console.log(createTokenResponse);
prettyPrintResponse(createTokenResponse);
response.json(createTokenResponse.data);
})
.catch(next);
});
Run Code Online (Sandbox Code Playgroud)
这是错误: …