Zend certified PHP/Magento developer

Call external voucher API and add discount before checkout

I’m new to Magento development and I need to integrate our Vouchers API to give discounts to our customers.

Our customers have a card with a number and PIN. I need to get this data from checkout form, request API, get current card balance, give Magento checkout discount based on current card balance, and request API again to subtract balance. Basically this module needs to work as a second payment gateway.

Not sure about the steps to do it. I just created a module in app/code but I don’t know what to do. All the tutorials and forum answers I’ve found help with creating a gateway, but it’s not what I need. I just need to add a few steps between cart and checkout, and give current balance as discount.