JAVA:Stripe webhook错误:未找到与负载的预期签名匹配的签名
我一直在尝试为JAVA:Stripe webhook错误:未找到与负载的预期签名匹配的签名,java,stripe-payments,Java,Stripe Payments,我一直在尝试为person.updatedAPI设置一个webhook。我正在尝试一个测试webhook,其中我在方法中发送了一个字符串,如下所示: @ApiOperation(value = "Webhook controller") @PostMapping("/accountUpdate") public void handle(@RequestBody String event1, Response response, HttpServletRequest htt
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
);
}
但是我得到了一个错误提示:没有找到与有效负载的预期签名匹配的签名
我尝试将字符串event1(请求主体)解析为Json,但没有成功。传递请求对象而不是字符串也不起作用。您在代码中提供的端点机密似乎不正确或与您的个人不匹配。请更新webhook的机密。终点秘密是这样的
“秘密”:“whsec_gaasdfklkklasew**********”谢谢!我更改并确保秘密与我的webhook中的一样,并且它在作为字符串传递时实际起作用。