#moses-webhooks

1 messages · Page 1 of 1 (latest)

abstract canyon
#

hi, regardless of your framework, webhooks only needs a valid HTTP Post Endpoint

wild tendon
#

Yes, I know. What request should I use to receive it? Have a demo?

#

If I use HttpServletRequest, I don't receive any request.

abstract canyon
#

Can you please provide your webhook endpoint id we_xxx

#

Here's a sample code for a Spring Webhook Endpoint

@RequestMapping("/webhook")
class WebhookController {

    def secret = "whsec_xxx"

    @RequestMapping(method=RequestMethod.POST)
    public @ResponseBody String getEvent(@RequestBody String request, @RequestHeader(value="Stripe-Signature") String signature){
        Event event = Webhook.constructEvent(request, signature, secret)
        System.out.println(event.type)
    //... 
    //...
    }
 //...
}```
wild tendon
#

I tested it with localhost

abstract canyon
#

let me know if you need any more help

wild tendon
#

No more questions, thank you.