我让这段代码完美地返回了帐户和交易对象,以响应 Plaid MFA 问题。我不确定出了什么问题,因为我(直到它停止工作并且我已经尝试了一些事情)没有触摸代码(据我的回忆),甚至检查了几个以前的工作版本以确保安全。无论如何,鉴于这种情况,我现在得到以下错误列表:
1) 如果我尝试美国银行 MFA,它会返回一个 MFA,在我回答后它还会返回一个帐户和交易对象。在我的终端中该信息的末尾,它还返回 events.js 85 throw er; // 未处理的错误事件
2) 如果我尝试 USAA 或美国银行,我的回复会收到以下错误对象:
{ code: 1203,
message: 'invalid mfa',
resolve: 'The MFA response provided was not correct.',
access_token: 'test_bofa' }
它返回 MFA 问题,当我用“再次”回答时,我得到:
{ type: 'questions',
mfa: [ { question: 'You say tomato, I say...?' } ],
access_token: 'test_bofa' }
events.js:85 throw er; // 未处理的“错误”事件
plaid.connect({username: req.body.cardName, password: req.body.cardPass, pin: req.body.pin}, req.body.type,
'test@plaid.com',
function (error, response, mfa) {
if (response == undefined) {
res.send(response);
} else if (response.hasOwnProperty('accounts')) {
res.send(response);
} else if (response.hasOwnProperty("mfa")) {
res.send(response);//If I remove this response it kicks me out right away. But with it, I receive an undefined MFA response.
plaid.step(response.access_token, req.body.answer, function (err, response) {
if (response == undefined) {
res.send(response);
} else if (response.hasOwnProperty("resolve")) {
res.send(response);
} else if (response.hasOwnProperty('accounts')) {
res.send(response);
} else if (response.hasOwnProperty('mfa')) {
res.send(response);
}
}
)
}
else {
response = "error";
response.send("something went wrong with Plaid");
}
}
)
}