Virtually all e-commerce sites accept credit cards as their primary form of payment. To accept credit cards, you need a merchant account with a bank. A payment gateway is simply a service which connects your Web site with the bank. While there’s a bit more to it than that, in essence that’s all it is – a way to take payments online.
Typically, when a customer enters credit card details on your Web site, those details are sent to the payment gateway, which then does some hard work in the background and processes (or rejects) the transaction. It then tells your shopping cart whether the payment was accepted or rejected. All this happens in a few seconds while the customer is waiting. The money is then transferred to your bank account – when that happens depends on the terms of your service.
It’s a diverse industry and the description above is the most common scenario, but there are many variations on it.
There are three basic types of payment gateways ...
(more at e-commerceguide)