A payment gateway is the technology that handles online transactions on your website. When a customer enters their card details during checkout, the payment gateway securely transmits that information to the bank or card network, processes the transaction, and sends back a confirmation (or a decline) to your website.
Think of it as the online equivalent of a card terminal in a physical shop. You never see the card data yourself. The gateway handles the sensitive bits securely so you don't have to.
Popular payment gateways include Stripe, PayPal, Square, Worldpay, and SagePay. Each has different features, pricing structures, and levels of customisation. Some are simple plug-and-play solutions, while others give developers more control over the experience.
Most payment gateways charge a small percentage fee per transaction (typically around 1.4% to 2.9% plus a fixed fee), rather than a large upfront cost.