First note $|\phi\rangle$ on the right is a canard: you might as well skip it. You are merely understanding the ineffable power of Dirac notation in momentum space.
Secondly, and crucially, your evaluations are nonsense, to the extent you are using $ \mathbf{p}$ both as a free state label, and as a dummy integration variable, when you insert a complete set of states. The correct evaluation should have been, instead,
$$\langle \mathbf{p} |XP_y = \langle\mathbf{p}| \int_{\mathbb{R}^3}\!\! d^3x |\mathbf{x}\rangle \langle\mathbf{x}|\ XP_y \ \int_{\mathbb{R}^3} \!\!d^3p' |\mathbf{p'}\rangle \langle \mathbf{p'}| \\ = \int_{\mathbb{R}^3}\!\! d^3x \int_{\mathbb{R}^3}\!\! d^3p' ~x \langle\mathbf{p}|\mathbf{x}\rangle p'_y \langle\mathbf{x}|\mathbf{p'}\rangle \langle\mathbf{p'}| \\
= \frac{1}{(2\pi\hbar)^3}\int_{\mathbb{R}^3}\!\! d^3x \int_{\mathbb{R}^3}\!\! d^3p' ~ x p'_y ~ e^{i\mathbf{x} \cdot (\mathbf{p'}-\mathbf{p})/\hbar} \langle\mathbf{p'}| \\
= \int_{\mathbb{R}^3}\!\! d^3p' ~ p'_y ~ i\hbar \frac{\partial}{\partial p_x }~ \delta( \mathbf{p'}-\mathbf{p}) \langle\mathbf{p'}| = i\hbar p_y \frac{\partial}{\partial p_x }~ \langle\mathbf{p}| ~,$$
where the last line is gotten by supplanting the conjugate gradient for x before performing the integral in x to obtain the delta function in p.
You may now evaluate your second term, mutatis mutandis.
The physics CCR group is the Heisenberg group.
I'd follow WP, to fix concepts and notation, as you seem to confuse representations with the Lie algebras they represent.
The three-dimensional Lie algebra $\mathfrak h$ of the Heisenberg group H (over the real numbers) is known as the Heisenberg algebra. (Three generators, so three parameters, a,b,c.)
It may be represented using the space of 3×3 upper-triangular matrices of the form
$$\begin{pmatrix}
0 & a & c\\
0 & 0 & b\\
0 & 0 & 0\\
\end{pmatrix} , $$
with $a, b, c\in\mathbb R $; its exponential is the generic group element,
$$\begin{pmatrix}
1 & a & c+ab/2\\
0 & 1 & b\\
0 & 0 & 1\\
\end{pmatrix} , $$
Note that, in this (defining) representation, the algebra basis elements are not hermitean, and hence the group elements are not unitary. You'd be very wrong if you imagined the group is U(3).
The following three elements form a basis for $\mathfrak h$,
$$
X = \begin{pmatrix}
0 & 1 & 0\\
0 & 0 & 0\\
0 & 0 & 0\\
\end{pmatrix};\quad
Y = \begin{pmatrix}
0 & 0 & 0\\
0 & 0 & 1\\
0 & 0 & 0\\
\end{pmatrix};\quad
Z = \begin{pmatrix}
0 & 0 & 1\\
0 & 0 & 0\\
0 & 0 & 0\\
\end{pmatrix}. $$
The basis elements satisfy the commutation relations,
$$
[X, Y] = Z;\quad [X, Z] = 0;\quad [Y, Z] = 0. $$
In physics, it is also represented by infinite-dimensional hermitean matrices/operators,
$$\left[\hat x, \hat p\right] = i\hbar I;\quad \left[\hat x, \hbar I\right] = 0;\quad \left[\hat p, \hbar I\right] = 0. $$
Note the obligatory physics i upon transition to the hermitean basis! The group elements result from exponentiation with an i and a parameter, resulting into unitary infinite-dimensional matrices.
Further note in this rep that the trace of the central element Z, proportional to the infinite-dimensional identity here, is not zero, even though it amounts to a commutator. This is a standard famously frequent question on the PSE, with a subtle limit resolution.
The unitarity of the representations or not is not a feature of the Group, but, instead a feature of the representation.
Finally, the identity is never a feature of the Lie algebra, but of the universal enveloping algebra. In this representation, it coincides with the center Z.
Best Answer
The center of the Weyl algebra (the algebra generated by $X, Y, P_X, P_Y$) consists of scalar multiples of the identity, so the answer is that you can recover $L$ up to a scalar multiple of the identity; in other words, the general solution is $X P_Y - Y P_X + c I$ for some scalar $c$. The argument is very similar to the argument here which shows that the Weyl algebra is simple by repeatedly applying commutators.