Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def webHookReceiver(): Action[RawBuffer] = Action.async(parse.raw) { implicit request =>
- if (request.headers.get("User-Agent").equals(permittedUserAgent)) {
- val event = Try(
- Webhook.constructEvent(request.body.asBytes().get.utf8String,
- request.headers
- .get("Stripe-Signature")
- .getOrElse(throw notAuthenticatedException()),
- endpointSecret)) match {
- case Success(checked) => checked
- case Failure(_) =>
- new Event()
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement