Potential scattering with field discontinuities at the boundaries