payment method in commerce
This page has everything you need to know, including example payment method modules you can use as reference implementations:

http://www.drupalcommerce.org/developer-guide/utilizing-core-apis/writing-payment-method-module