【发布时间】:2021-10-12 23:23:37
【问题描述】:
我正在尝试在 Sails 中设置 Stripe webhook,检查 webhook 签名,如 here 所述。签名以与 Stripe 示例相同的格式返回,但每个测试 webhook 都会返回:
No signatures found matching the expected signature for payload. Are you passing the raw request body you received from Stripe? https://github.com/stripe/stripe-node#webhook-signing
为了尝试获取原始请求正文,我尝试在sails.config.http 中绕过该路由的bodyParser 中间件,如here 所述,但如果我这样做,那么this.req.body 是:
undefined
顺便说一句,我可以看到 Sails 中有一些与 Stripe 的集成,但我找不到预构建的 webhook。如果我要重新发明轮子,请告诉我,关于将 Stripe 与 Sails 集成的文档很少。
【问题讨论】: