[英]JAVA: Stripe webhook error: No signatures found matching the expected signature for payload
I have been trying to set a webhook for the person.updated
API from Stripe.我一直在尝试为 Stripe 的
person.updated
API 设置一个 webhook。 I am trying a test webhook where I send a String in the method, like this:我正在尝试一个测试 webhook,我在方法中发送一个字符串,如下所示:
@ApiOperation(value = "Webhook controller")
@PostMapping("/accountUpdate")
public void handle(@RequestBody String event1, Response response, HttpServletRequest httpServletRequest){
}
and then in my Webhook.constructEvent
, I am passing that String event1 as follows:然后在我的
Webhook.constructEvent
,我按如下方式传递该字符串 event1:
try {
event = Webhook.constructEvent(
event1, sigHeader, endpointSecret
);
}
But I am getting an error saying: No signatures found matching the expected signature for payload
但是我收到一条错误消息:
No signatures found matching the expected signature for payload
I have tried to parse the String event1 (Which is the request body) into Json and it doesn't work.我试图将 String event1(即请求正文)解析为 Json,但它不起作用。 Passing the Request object instead of String didn't work either.
传递 Request 对象而不是 String 也不起作用。
It seems like your end point Secret which you are providing in your code is incorrect or not matching to your person.update webhook's secret.您在代码中提供的端点 Secret 似乎不正确或与您的 person.update webhook 的秘密不匹配。 End point secret goes like this.
端点秘密是这样的。
"secret": "whsec_gaasdfkalkkklasew**********" “秘密”:“whsec_gaasdfkalkkklasew**********”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.