简体   繁体   English

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

[英]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.

相关问题 转换为客户时出现条带化Java API Webhook错误 - Stripe Java API Webhook Error when casting to a Customer 如何将矩阵数组传递给Java方法参数列表整数变量error:error:没有为类找到具有匹配签名的方法“ list_method”? - How to Pass Matrix Array to Java Method arguments List Integer variable error:error:No method 'list_method' with matching signature found for class? 如何在 Java 中从 Stripe 接收 Webhook - How to Receive Webhook from Stripe in Java 为什么我的Java服务器代码在尝试从Stripe接收Webhook时抛出502错误? - Why is my Java server code throwing a 502 error when attempting to receive a webhook from stripe? 在 Java 中验证 Paypal Restful Webhook 签名 - Verify Paypal Restful Webhook Signature in Java 错误警告:PackageInfo 中的 [deprecation] 签名已被弃用 (Signature signature:info.signatures) - Error warning: [deprecation] signatures in PackageInfo has been deprecated for(Signature signature:info.signatures) 在Java中使用标头,有效负载和签名创建JWT - creating JWT with header, payload and signature in java 创建 bean 时出错:没有符合条件的 bean,预期单个匹配 bean 但找到了 3 - error creating bean: No qualifying bean, expected single matching bean but found 3 具有Java错误的Apache Zeppelin:“;” 预期但找到“班级” - Apache Zeppelin with Java error: ';' expected but 'class' found Java错误:找到了接口......但是预期了类 - Java error: Found interface … but class was expected
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM