小编Ada*_*ner的帖子

Stripe - Webhook 负载必须以字符串或缓冲区的形式提供

我正在尝试用条纹编写订阅系统。我的以下代码大部分是从 stripe 文档复制的,但它总是向我显示此错误:

\n
Webhook signature verification failed. Webhook payload must b\ne provided as a string or a Buffer (https://nodejs.org/api/buffer.html) instance representing the _raw_ request body.Payload was provided as a parsed JavaScript object instead.\nSignature verification is impossible without access to the original signed material.\nLearn more about webhook signing and explore webhook integration \nexamples for various frameworks at https://github.com/stripe/stripe-node#webhook-signing\n
Run Code Online (Sandbox Code Playgroud)\n

这是我用 javascript 编写的代码:

\n
app.post(\n  '/webhook',\n  express.raw({ type: 'application/json' }),\n  (request, response) => {\n    let event = request.body;\n\n    const endpointSecret = …
Run Code Online (Sandbox Code Playgroud)

javascript node.js express stripe-payments

13
推荐指数
2
解决办法
8590
查看次数

标签 统计

express ×1

javascript ×1

node.js ×1

stripe-payments ×1