Compare over 20 of the best card processors

It takes just 30 seconds...

What is a Payment Gateway and How Does It Work?

Stephen Hart

Stephen Hart

Founder - Cardswitcher

Former - Chief Financial Officer @ Worldpay

Payment gateway - there’s another payment industry term to wrap your head around. You’re keen to start taking card payments online as quickly as possible, but it’s been a struggle so far to work out what you need to get in order.

In this post, we’ll discuss what a payment gateway is, how it works, the different types of gateway, costs, safety, and more. You’ll be a payment gateway expert in no time!


What is a payment gateway?

A payment gateway is a piece of software technology that authenticates and securely passes on card payment information between all the players in the payment process.

Basically, when you make a card payment online, you are entering your card details into a payment gateway. This payment gateway checks your details are legitimate and then forwards them to the next step in the payment process.

They are also integrated into physical card readers for in-person transactions, but you’ll usually hear about them in reference to online payments.

Here is a nice short summary video of how it works:


How does a payment gateway work?

A payment gateway plays 3 main roles: 

  • Authenticating card details.
  • Encrypting card details.
  • Transmitting card details.

Here is how a payment gateway works:

  1. The customer enters their card details - the payment gateway authenticates that the card details match a card in circulation. It carries out fraud checks too.
  2. The gateway encrypts the card data and sends it to the acquirer.
  3. The acquirer requests the funds from the issuing bank who decides whether to authorise the transaction. 
  4. The acquirer lets the payment gateway know if the transaction has been approved, and it then lets the customer know if it was successful.
  5. The settlement process begins.


Do I need a payment gateway?

If you plan to take card payments online, you’ll need a payment gateway.

person buying something on mobile phone with their card

Are there different types of payment gateway?

There are different types of payment gateway to suit your needs. 


Hosted payment gateway

A hosted gateway is hosted on the payment service provider’s own site, rather than your website. Your customers are directed away from your site temporarily while they checkout. An example of this would be PayPal.


  • PCI compliance and fraud protection are taken care of for you.
  • Easy to set up.


  • Less control over your customer’s checkout experience.
  • Not as customisable.


Self-hosted payment gateway

A self-hosted gateway is hosted on your own website. Customers input their card information on your website and it’s then transmitted securely to a third-party gateway to be authorised. This goes on in the background without the customer knowing.


  • Quicker checkout experience.
  • More control over the customer’s checkout experience.


  • Less technical support than with a hosted gateway.
  • Bit more complicated to set up than a hosted gateway.


API-hosted payment gateway

This is for merchants who want complete control over the customer journey on their site. Every part of the checkout process is carried out on your own website.


  • The most customisable option.
  • Offers most control over the customer's checkout experience.


  • You are responsible for security and following PCI DSS compliance protocols.
  • The most complicated option to set up.

Are payment gateways safe?

Payment gateways from legitimate providers are very safe.

A good payment gateway is equipped with loads of security measures to keep customer card details safe. They use encryption or tokenisation to scramble up the card details so they are unreadable by hackers. Gateway providers also follow strict PCI DSS compliance standards, and have to complete annual audits and undergo recertification frequently.

woman looking concerned when buying online

How much does a payment gateway cost?

The cost of a payment gateway depends on the provider and the additional services you choose. In our roundup of the best payment gateways in the UK, we compare costs of some of the top providers.

You can expect some or all of the following charges:

  • Set up fee.
  • Monthly fee.
  • Card processing fee (can change depending on the payment method).
  • Minimum monthly transaction.
  • Chargeback and refund fees.


What is the difference between a payment gateway and a payment processor?

A payment gateway is what you input your card details into and it authenticates them and carries out fraud checks. It then passes your details to the payment processor.

A payment processor passes information between the customer’s bank and the merchant’s bank. Sometimes it’s referred to as an acquirer or payment service provider.

We’ve done a post which looks at the differences between payment gateway and payment processors in more detail.


What is the difference between a payment gateway and payment terminal?

A payment gateway is virtual - you input your card details (usually online) and then your card information is transmitted behind-the-scenes to the other players in the payment process.

A payment terminal is physical - it is the physical card reader that you insert/tap/swipe your card on.

happy man buying online

Benefits of payment gateways

There are loads of benefits to using a payment gateway:

  • It’s convenient - your customers can buy your products online, at any time from anywhere in the world.
  • It’s fast - the checkout process is super quick. No need to trek into a store or coordinate bank transfers online.
  • It’s user-friendly - consumers are very familiar with how online checkouts work these days. Payment gateways are designed to be intuitive for customers.
  • It’s safe - there are layers of security measures applied to payment gateways to reduce fraud.
  • It opens you up to wider markets - you can reach a much wider base of customers with a payment gateway. You’re not restricted to those who stumble across your physical shop anymore!


Can I make my own payment gateway?

You could but it’s unlikely to be worth it. It’s very expensive, requires development know-how and you can already get custom payment gateways from providers that blend seamlessly into your website.


How do I choose a payment gateway?

When choosing a payment gateway, you should consider:

  • Your business goals (growth in the next few years).
  • Your turnover.
  • The type of goods you sell.
  • The seasonality of your business.
  • Where you sell your goods online (website, app, both).
  • Your access to developers to set it up and maintain.

We’ve done an in-depth look at the best payment gateways in the UK so you can easily see which providers suit the needs of your business best.

Here at CardSwitcher, we compare card processing fees - click the link below to see how much you could save.

Compare over 20 of the best card processors

It takes just 30 seconds...

Written by:
Stephen Hart

Stephen Hart

Founder - Cardswitcher

Former - Chief Financial Officer @ Worldpay

Stephen brings a wealth of experience honed through years in the financial sector, particularly in the card processing payments industry. His illustrious career spans key roles at PwC, Natwest, and the role of CFO at WorldPay, before going on to found card processing comparison site, CardSwitcher. He is passionate about helping growing businesses to understand the card processing landscape so they can make savvy financial decisions.