A general perturbative treatment of potential barriers