copying code from one page to another is always problematic at best.
the error means that the script ends unexpectedly. I'm guessing the line 239 is the last line on the PayNowGolf.php. one possible cause would be an if statement on the page that is not closed. a properly formatted if statement would look like:
if(condtion) {
do something
}
if the closing } where removed, it would cause the error you are getting since the script ends before closing the if statement.
it can also happen with functions missing the closing } or even if there is a missing closing php tag among others.