You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Firebase云函数+Express中Stripe Webhook签名验证失败求助

问题:Firebase云函数中Stripe Webhook签名验证失败

我已花费约3周时间寻找此问题的解决方案,尝试过他人分享的方案但均无效。我使用Firebase云函数,通过module.exports = onRequest(app);传入Express实例。以下是构造Stripe签名事件的代码,目前遭遇Webhook signature verification failed错误:

app.post('/', express.raw({type: "*/*"}), (req, res) => {
    const endpointSecret = "whsec_...";
    let event;

    const signature = req.headers['stripe-signature'];
    try {
    event = stripe.webhooks.constructEvent(
        req.body,
        signature,
        endpointSecret
    );
    } catch (err) {
        logger.error(`Webhook signature verification failed.`, err.message);
        return res.sendStatus(400);

    ...
}

请问Firebase是否会在将数据交给Express前解析数据?是否需要进行相关配置?

内容的提问来源于stack exchange,提问作者Leo

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.11 20:20:55