javascript - 谷歌云功能不执行条纹调用
问题描述
我在承诺结构中运行一系列条纹收费。当我只运行一次收费时,一切正常。但是,当我尝试运行多个条带收费代码行时,根本不会执行。
有没有人了解我的代码结构或谷歌云函数会阻止执行多个条带调用的发生?
const idempotency_key = randomstring.generate(); // prevent duplicate charges
const amount = total + 30;
const currency = "usd";
console.log("Blue Scarfs", idempotency_key);
console.log("Blue Scarfs", user_ID);
return docRef2.doc(`/users_stripe/${user_ID}`).get()
.then(snapshot => {
console.log("the dollars", snapshot);
console.log("the dollars", user_ID);
const customer = snapshot.data().id;
const charge = {amount, currency, customer};
console.log("Bills", charge);
return stripe.charges.create(charge , { idempotency_key });
console.log("Bills");
})
解决方案
推荐阅读
- laravel - 在 Laravel 中删除返回 404 Not Found 并且不删除
- neo4j - 此查询是否为节点分配了新标签?
- javascript - 如何在地图函数中调用api
- python - F字符串自动完成python
- azure-devops - 如何从 Azure DevOps 访问 pagesBatch?
- angularjs - 有什么方法可以减少 AngularJS 包的大小(使用 Webpack)
- android - 未找到改造响应
- javascript - 如何避免呈现复选框编号?
- agda - 立方体agda中具有不同refl组合的立方体
- wpf - WPF 是否有任何方法可以将徽章应用于应用程序图标?