A method for calculating vertex-type Feynman integrals