Added payment creation; fixed errors in script.