refactored 3-D secure payment code into a helper method like the rest of the code