繁体   English   中英

JAVA:Stripe webhook 错误:未找到与有效负载的预期签名匹配的签名

[英]JAVA: Stripe webhook error: No signatures found matching the expected signature for payload

我一直在尝试为 Stripe 的person.updated API 设置一个 webhook。 我正在尝试一个测试 webhook,我在方法中发送一个字符串,如下所示:

    @ApiOperation(value = "Webhook controller")
    @PostMapping("/accountUpdate")
    public void handle(@RequestBody String event1, Response response, HttpServletRequest httpServletRequest){
}

然后在我的Webhook.constructEvent ,我按如下方式传递该字符串 event1:

 try {
            event = Webhook.constructEvent(
                    event1, sigHeader, endpointSecret
            );
     }

但是我收到一条错误消息: No signatures found matching the expected signature for payload

我试图将 String event1(即请求正文)解析为 Json,但它不起作用。 传递 Request 对象而不是 String 也不起作用。

您在代码中提供的端点 Secret 似乎不正确或与您的 person.update webhook 的秘密不匹配。 端点秘密是这样的。

“秘密”:“whsec_gaasdfkalkkklasew**********”

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM