Skip to content

Commit

Permalink
Use conn token from read_body result (#821)
Browse files Browse the repository at this point in the history
  • Loading branch information
alisinabh authored Nov 5, 2023
1 parent f68fc4d commit 18397fa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/stripe/webhook_plug.ex
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ if Code.ensure_loaded?(Plug) do
secret = parse_secret!(secret)

with [signature] <- get_req_header(conn, "stripe-signature"),
{:ok, payload, _} = Conn.read_body(conn),
{:ok, payload, conn} = Conn.read_body(conn),
{:ok, %Stripe.Event{} = event} <- construct_event(payload, signature, secret, opts),
:ok <- handle_event!(handler, event) do
send_resp(conn, 200, "Webhook received.") |> halt()
Expand Down

0 comments on commit 18397fa

Please sign in to comment.