如何解决Google Cloud Function不会触发Stripe的端点
我正在尝试修复以前使用的(无法理解的)firebase云功能,该功能在删除文档时应触发条带的customers.deleteSource端点。但是它根本不会触发它,我也不明白为什么。
这是功能:
h264
在这种情况下,我希望看到一些错误,因为它确实记录了Firebase的功能日志,但记录了“成功执行..”。我还要提到我所有其他的条带终结点都工作正常,因此,条带实现本身就很好,只是该死的 exports.removePaymentSource = functions.region('europe-west1').firestore.document('/stripe_customers/{userId}/sources/{sourceId}').onDelete(async (change,context) => {
console.log('Does not log..')
try {
const source = change.before.data();
const customer_id = source.customer;
const card = source.card;
console.log('Does not log..')
console.log('Does not trigger the await')
return await stripe.customers.deleteSource(customer_id,card);
} catch (error) {
return reportError(error,{user: context.params.userId});
}
});
。
这是Firebase功能日志中的图片:
我做错了什么?有人可以引导我朝正确的方向吗?任何帮助表示赞赏!
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。