common code with multiple merchant support and handling exceptions