You probably can't just copy-paste the code blindly. You need to understand the parts of the webpage and then copy-paste them into your template system. It's fairly straightforward. You have the header and the body. Just transfer those to your existing system in a way that works.
I know that's vague, but the payment.php file is pretty easy to understand. There's a bit of javascript. There's a bit of css. And there's a bit of HTML. You just need to move all these bits to your existing system. Then if anything breaks you can refer to the original.