implementing payments logic