tep_mail function only has 4 arguments (unless it is modified), and the line of code below is only for debug if there's any issues with a transaction.
STORE_OWNER/STORE_OWNER_EMAIL_ADDRESS are not defined in your system.
Therefore, change :
tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, "Square Debug Error", "Square has encountered some errors:\n\n".var_export($e, true)."n\n\n". "Customer ID: ".$customer_id . "r\n\r\n\r\n".var_export($order, true));
to
tep_mail("STORE_OWNER", "youremail@yourdomain.com", "Square Debug Error", "Square has encountered some errors:\n\n".var_export($e, true)."n\n\n". "Customer ID: ".$customer_id . "r\n\r\n\r\n".var_export($order, true));
and let us know if the issue was resolved.
** EDIT: if the issue is not resolved, can you pastebin your tep_mail function? Thank you.