I don't see how that code could effect the payment status. I think it must have been something else causing the failure.
If you get it back to the point where it fails and let me know how to reproduce it then I can reproduce the error and debug it.
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
These out-of-the-box solutions provide you proven, tested applications that can be up and running now. Build a store, a gallery, or a web-based email solution.