Code:
Content visible to verified customers only.
I dont see what could be wrong here we code it properly here and it works when I test it. In payment.tmpl is this return url so
<input type="hidden" name="return" value="{$Globals['maindir']}/payment.php?action=paid&ad=$transcode">
That is the url that the user returns upon payment to the program so it will work
If they pay you and go closing the window or using the back button etc then this is the issue and not one of the program