The equation you have to solve for p^{n+1} is a Laplace equation with non homogeneous Neumann boundary condition. You can look at this post
From “We are thus led to the problem…”