From 75c26ac8033f1a199ab303681629d88cc3738448 Mon Sep 17 00:00:00 2001 From: Alisina Bahadori Date: Sat, 4 Nov 2023 23:58:49 -0400 Subject: [PATCH] Use conn token from read_body result --- lib/stripe/webhook_plug.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/stripe/webhook_plug.ex b/lib/stripe/webhook_plug.ex index 6bdf63fd..8b80b808 100644 --- a/lib/stripe/webhook_plug.ex +++ b/lib/stripe/webhook_plug.ex @@ -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()