order} -> order {:error, cs} -> Repo.rollback(cs) end end) end def do_process_checkout(order) do # Everything here returns a Ecto.Changeset with {:ok, order} <- update_order(order), {:ok, order} <- capture_payment(order), {:ok, order} <- send_notification_email(order), {:ok, order} <- update_stock_levels(order), do: {:ok, order} end