A general method for pricing European exotic options under Lévy processes