所以我正在使用Google函数编写脚本来自动向我的工人付款!在后端,我已经存储了公共令牌和帐户ID。我正在尝试使用格子将其转换为条纹令牌,然后使用条纹来进行转移!条带功能正常运行,但格子功能不会返回新的条带银行帐号。有什么想法吗?
plaidClient.exchangePublicToken("public-sandbox-6be57fb5-3286-4bc8-a770-54a16ea39283",
res => {
var accessToken = res.access_token;
// debugging = exchangedata.access_token;
//debugging = err.message;
// Generate a bank account token
plaidClient.createStripeToken(accessToken, snapshot.val().plaid_account_id,
res => {
bankAccountToken = res.stripe_bank_account_token;
stripe.transfers.create({
amount: (Number(appointmentchildSnapshot.val().price)/3).toString(),
currency: "usd",
destination:bankAccountToken,
transfer_group: "ORDER_95"
},(_err, transfer)=> {
// asynchronously called
});
});
答案 0 :(得分:0)
让您在声明客户秘密和内容时使用双“”!
为了测试错误,请使用res.json(错误:正在使用的帽子函数)
-不幸的是,某些银行代币无法在沙箱中与Plaid一起使用,并且它们也会很快过期,因此如果无法使用,则会创建一个新代币并重试
---使用错误日志的内容,您可以跟踪何时发生这种情况
await plaidClient.exchangePublicToken(snapshot.val().plaid_token,
async (error,response1) => {
if (error !== null) {
res.json({error:snapshot.val().plaid_token});
} else {
var accessToken = response1.access_token;
//res.json(accessToken);
// debugging = exchangedata.access_token;
//debugging = err.message;
// Generate a bank account token
debugging = await plaidClient.createStripeToken(accessToken, snapshot.val().plaid_account_id,
async (error2,response2) => {
if(error2!==null){
res.json({error:snapshot.val().plaid_account_id});
}else{
//res.json({error:response2});
// bankAccountToken = response2.stripe_bank_account_token;
stripe.transfers.create({
amount: (Number(appointmentchildSnapshot.val().price)/3).toString(),
currency: "usd",
destination:response2.stripe_bank_account_token,
transfer_group: "ORDER_95"
},(_err, transfer)=> {
// asynchronously called
});
}