order instanceof Id ? $this->repo->ofId($cmd->order) : $cmd->order; $order->pay($cmd->gateway, $cmd->externalId); return $order; } }