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
public String stripeWebhookEndpoint(@RequestBody String json, HttpServletRequest request) {
String header = request.getHeader("Stripe-Signature");
String endpointSecret = "your stripe webhook secret";
try {
event = Webhook.constructEvent(json, header, endpointSecret);
System.err.println(event);
} catch (SignatureVerificationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
//
enter code here
return "";
}