Fixed error printing in pay route. Fixed if else order in pay api