That looks neat. But it also looks to me like your error variant has the wrong arity.
def charge_customer({:error, err}), do: {:error, err}
def charge_customer({:ok, cart}, card) do
The first one takes a single argument {:error, err}, but the second one takes two arguments, {:ok, cart} and card.Same issue with the keyword list version, your error function doesn't take a keyword list at all, just the {:error, err} argument.