stripity_stripe v2.0.0-alpha.11 Stripe.Webhook
Creates a Stripe Event from webhook’s payload if signature is valid.
Use construct_event/3 to verify the authenticity of a webhook request and
convert its payload into a Stripe.Event struct.
case Stripe.Webhook.construct_event(payload, signature, secret) do
{:ok, %Stripe.Event{} = event} ->
# Return 200 to Stripe and handle event
{:error, reason} ->
# Reject webhook by responding with non-2XX
end