How to Receive Webhook from Stripe in Java

后端 未结 4 1803
眼角桃花
眼角桃花 2021-02-06 10:13

I am trying to receive a webhook via a post request from Stripe Payments. The java method to process it looks like this:

@ResponseBody
@RequestMapping(    consu         


        
4条回答
  •  天涯浪人
    2021-02-06 10:31

    I have been looking for the same answer, so after looking at their own code, here is how they actually do it:

    String rawJson = IOUtils.toString(request.getInputStream());
    Event event = APIResource.GSON.fromJson(rawJson, Event.class);
    

    APIResource comes from their library (I am using 1.6.5)

提交回复
热议问题