Improved the COD

This PR fix the undefined $wp variable issue and adds a method to verify if the order needs shipping in "order-pay" endpoint.