payment logic