Firstly, why are you echoing out the return url? The process_button function is called to create the process button. The return here should be a bunch of hidden variables, so that when the containing form is submitted, these are submitted with it. If you need to send the CC number, name, and amount to the gateway, you can eitehr do this here, as hidden variables, or send them by CURL In a later function. You should never need to reirect from this function, as it is loaded half-way down a page.
Secondly, with the $messageStack, have you included the line: global $messageStack within the function, as $messageStack is a global variable, and so it's not normally available within functions due to its scope.
Absolute
Bookmarks