Skip to content

Commit f89994e

Browse files
committed
proper on_behalf_of handling
1 parent f1415f4 commit f89994e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/algora_web/live/org/job_live.ex

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,8 +674,15 @@ defmodule AlgoraWeb.Org.JobLive do
674674

675675
@impl true
676676
def handle_event("process_payment", %{"payment" => %{"payment_type" => "stripe"}}, socket) do
677+
on_behalf_of =
678+
if socket.assigns.current_user_role in [:admin, :mod] do
679+
socket.assigns.current_org
680+
else
681+
socket.assigns.current_user
682+
end
683+
677684
case Jobs.create_payment_session(
678-
socket.assigns.current_user,
685+
on_behalf_of,
679686
socket.assigns.job,
680687
socket.assigns.current_org.subscription_price
681688
) do

0 commit comments

Comments
 (0)