A payment gateway is an e-commerce application service provider that authorizes payments for e-businesses, on-line retailers, bricks and clicks, or traditional brick and mortar. It is the equivalent of a physical point of sale terminal located in most retail outlets. Payment gateway protects credit cards details encrypting sensitive information, such as credit card numbers, to ensure that information passes securely between the customer and the merchant and also between merchant and payment processor.
Workflow
A payment gateway facilitates the transfer of information between a payment portal and the Front End Processor or acquiring bank. When a customer orders a product from a payment gateway enabled merchant, the payment gateway performs a variety of tasks to process the transaction:
1 customer swipe the credit card and the device reads the information stored in the card.
2. The merchant sends the transaction details to their payment gateway, this is done via SSL encryption.
3. The payment gateway forwards the transaction information to the processor used by the merchant's acquiring bank.
4. The processor forwards the transaction information to the card association (i.e., Visa/MasterCard).
5. The card association routes the transaction to the correct card issuing bank.
6. The credit card issuing bank receives the authorization request and sends a response back to the processor with a response code.
7. The processor forwards the response to the payment gateway.
8. The payment gateway receives the response, and forwards it on to the interface used to process the payment where it is interpreted and a relevant response then relayed back to the cardholder and the merchant.



