Payment gateways differ from country to country and they are agencies who can enable payment processing in your applications.
For example. in UK BT has it payment gateway. They call it BTBuynet . In India ICICI is one of the major payment gateway providers. You can also check out paypal.
Each of them have their own way of implementation. Usually every payment gateways have 2 modes for payment processing.
- Payment page : This is one of the most commonly used. Sites usually redirect the user to the pay page hosted by the payment gateway. This type has some advantages and disadvantages.
Advantages
We dont have to worry about validating or storing cards details as everything is taken care by their pay page.
Disadvantages
Since we redirect the user to a different site the look and feel of the site will be different.
- Payment service : This is the second type in which usually a component or API is used. ard details are collected by the merchant (The application owner) and sent for payment processing.
Hope this gives yo some idea about payment gateways. You can also check out some related questions in the RHS.