How to create a custom payment method like the purchase order?

Hello,

I am trying to create new custom payment method like default purchase order method with three text fields. please let me know how to create that.

Thanks

Thanks Sandeep,
but I need three text fields too when i select this payment method.