Header redirect on successful form submit http://www.php.net/manual/en/function.header.php - at the point in the PHP where the thanks message is generated.
Not as elegant, but you could also echo a meta refresh into the page at the same point as above;
echo "<meta http-equiv='refresh' content='=3;payment.php' />";
Or echo a redirect with pause (3 seconds example);
echo "<script>top.location = 'payment.php';</script>";
If you need more help, please post a copy of the MailHandler.php script.
echo "<script>setTimeout('top.location = \'payment.php\'', 3000);</script>";