An algorithmic method to determine integrability for polynomial planar vector fields