.
Looks like a JS generated code to steal the credit card information.
Sounds pretty hacked to me. Did you run a code check for malicious code?
Software versions? J VM PHP and so on.
agree a hack .. and there must be associated css and js loading with it as the form posts to itsself