A payment gateway is a technology that securely captures a customer’s payment details and transmits them to the relevant parties for authorization. It also notifies the customer whether their payment was successful or declined.Â
In an online setting, the payment gateway functions like a POS terminal in a physical store, facilitating ecommerce transactions.
This guide breaks down everything you need to know about payment gateways, from their core function to the different types available.
We’ll also explore how they compare to payment service providers (PSPs), why they’re essential for online businesses, and what to consider when selecting one.
For businesses looking to simplify payment integrations and management, we’ll highlight a payment solution that removes the complexity so you can focus on growth instead: Primer.
Are you looking to add payment gateways and PSPs without complex and long integrations? Consider Primer. Book a call to learn how we can help.
What is a payment gateway?
A payment gateway is a key part of how online payments work. It sits at the beginning of a transaction, allowing customers to submit their payment details. The gateway then encrypts these and passes them on to the payment processor as an authorization request.
The payment gateway will also inform a merchant whether the cardholder’s bank has approved the transaction before submitting it for settlement.
How does a payment gateway work?
Here’s a walk-through to show the online payment gateway's job within the payment flow.
- The customer initiates a payment: Frankie is shopping online. She selects her items and proceeds to checkout.
- Data encryption: Frankie enters her payment details (such as card information). The payment gateway encrypts this sensitive data to protect it before securely transmitting it. Some payment gateways host the payment page, while others process payments directly on the merchant’s website.
- Authorization request: The payment gateway forwards the encrypted payment details to the payment processor, which then sends an authorization request to Frankie’s issuing bank (her card provider).
- Bank verification: Frankie’s issuing bank checks if she has enough funds, verifies the transaction for fraud risks, and either approves or declines the payment. If approved, an authorization code is sent back through the payment chain.
- Payment confirmation: The payment gateway receives the approval and notifies the merchant and Frankie that the payment was successful. However, Frankie’s account isn’t debited immediately—her bank holds the amount until the transaction is settled (typically within a day or two).
What is a merchant account, and do I need one?
There is often confusion between a merchant account and a payment gateway, with some mistakenly using these terms interchangeably. However, it's crucial to note that online businesses require a merchant account and a payment gateway to accept payments through online credit and debit card transactions.
A merchant account is a type of business bank account that temporarily holds funds from customer payments before transferring them to the merchant’s regular bank account. It is set up by a PSP or acquiring bank and acts as an intermediary between the payment gateway and the business’s bank.
You need a merchant account to accept credit or debit card payments online. However, some PSPs offer aggregated merchant accounts, meaning businesses don’t need to open one separately. Instead, funds are processed through the PSP’s merchant account before settling into the business’s bank account.
What are the different types of payment gateways?
Integrating a payment gateway into your online business can be done differently, depending on how much control you want over the payment experience and your compliance responsibilities.Â
Here are the most common types of payment gateway integrations:
Hosted payment gateway
A hosted payment gateway redirects customers to a third-party checkout page to enter payment details. Once the transaction is complete, they are returned to the merchant’s website.
As an out-of-the-box solution, the hosted payment gateway eliminates the need to integrate and maintain a payment gateway within the merchant’s site. It also handles merchant PCI-DSS compliance.
The main drawback of this approach is the loss of control over the checkout experience. Redirecting customers to a third-party site can create friction, potentially leading to higher cart abandonment rates—especially if customers feel uncertain or confused about why they’re being taken away from the merchant’s website to complete their payment.
Native or non-hosted payment gateway
A non-hosted payment gateway, also called a direct or server-to-server integration, keeps the entire payment process on the merchant’s website. This requires direct integration with the payment gateway, giving businesses full control over the checkout experience.
This approach offers a seamless user experience, keeping customers on the merchant’s website throughout the transaction. This allows businesses to maintain full control and customization over the payment process, ensuring a consistent brand experience. However, it requires developer resources for integration and ongoing maintenance.
Tip: Using a non-hosted payment gateway typically places the responsibility for PCI compliance on the merchant.
API-based payment gateway
An API-based payment gateway is integrated into a website or app via an API, offering flexibility and customization. It allows businesses to design a branded checkout experience while simplifying compliance requirements.
This approach provides a fully customizable checkout experience, allowing businesses to tailor the payment process to match their brand. Many providers offer built-in PCI compliance tools, helping to reduce security and regulatory burdens. Additionally, merchants can use plugins or SDKs to simplify integration.Â
What providers offer a payment gateway?
Here are some of the key players when it comes to payment gateways.
- Adyen
- Cybersource
- Checkout.com
- Braintree
- Stripe
- Worldpay
Payment gateway services vary, with providers having slightly different security, UX, and transaction speed offerings.
What is the difference between a payment gateway and a payment service provider?
Payment gateways primarily concentrate on securely transmitting and validating payment data during online transactions. They gather payment details and subsequently share them with the PSPs
On the other hand, a PSP offers a more comprehensive range of services. While encompassing payment gateway functionality, PSPs typically extend their services to include additional features such as facilitating merchant accounts, implementing fraud prevention measures, and aiding businesses in accepting various alternative payment methods (APMs).
Discover more: Payment service providers (PSPs): Everything you need to know.
What you should consider when choosing a payment gateway
When choosing a payment gateway, considering these factors will help you find the right one for your business model.
- Gateway type: Decide which payment gateway type will work best for your business: hosted, non-hosted, or API-based.
- Security: Check what’s on offer, from PCI DSS compliance to fraud prevention and encryption. Some gateways have more robust security measures than others.
- Ease of integration: Can the payment gateway integrate with your ecommerce platform or website?
- Payment methods: Consider which payment methods you want to accept now and in the future. What about alternative payment methods?
- Cost: Fee structures can vary. Compare pricing options and decide what best suits your business. Consider transaction fees, monthly costs, and any extra charges.
- Customer support: Check the available support, when it is available, and any additional fees. Payment outages are costly, so it’s crucial to have access to responsive support to resolve issues swiftly.
Is Primer a payment gateway?
It’s a good question, but no, Primer isn’t a payment gateway.
Primer is a Unified Payments Infrastructure. We act as a layer of technology for merchants to build their payment stack in a better, faster, more scalable way. We’re not involved in the flow of funds. Instead, we integrate with payment gateways to route payment instructions to them (and vice versa).
There is some overlap in the payment services that Primer and gateway providers offer, including:
However, Primer offers several unique advantages by sitting above a merchant’s payment gateways and processors. It allows merchants to connect to multiple PSPs and gateways and orchestrate payments using conditional logic.
Here are a few examples of what Primer can do:Â
Integrate with PSPs and payment gateways without any code
Integrating with a PSP or payment gateway is complex and resource-intensive. Beyond lengthy contract negotiations, the real challenge is the technical work. Businesses spend months building and maintaining multiple integrations, each with its own setup, requirements, and ongoing updates. And as you scale, the complexity only increases.
With Primer, you eliminate the heavy lifting. Our unified API lets you integrate once and connect to global and local PSPs and payment gateways, including Adyen, Stripe, Worldpay, and Braintree. We remove the hassle of managing multiple integrations so you can focus on running your business and not maintaining a complex payment infrastructure.
Adding a new PSP or payment gateway is simple. You can enable a provider in just a few clicks:
- Select the PSP or payment gateway you want to use in the Primer Dashboard
- Allow Primer access to your account
- Turn on alternative payment methods (such as Apple Pay or Google Pay) for the provider
- Modify your Universal Checkout to dynamically display the right payment options for customers without coding.

By centralizing your payment infrastructure, Primer makes it easy to scale, optimize, and future-proof your payment strategy without adding additional technical overheads.
Reclaim up to 20% of failed payments with Fallbacks
Relying on a single payment processor puts your revenue at risk. Even a brief outage can mean lost sales and frustrated customers. However, setting up a backup processor is often complex, requiring ongoing engineering effort just to implement and maintain.
Primer makes this simple with Fallbacks. When a payment fails, it’s automatically rerouted to a backup processor (based on logic you’ve set up), ensuring transactions go through instead of being declined. There’s no need for manual intervention or custom development—Fallbacks work instantly to recover failed payments and protect your revenue.
Banxa, a global payments provider, saw the impact firsthand. By enabling Fallbacks, they recovered 17% of all failed payments, improving conversion rates without requiring engineering effort.
You can also streamline payment routing with Workflows, our no-code automation tool that gives you full control over how payments are processed. Easily set up advanced routing strategies to optimize for cost, approval rates, or customer location—all without writing a single line of code.

Read more: A guide to payment routing: Everything you need to know
Analyze all of your payment data in one place with Observability
Managing multiple PSPs and payment gateway providers comes with a major challenge: staying on top of your payment data. Each provider typically has its own dashboard, with different formats, reporting standards, and levels of detail. This creates fragmented data silos, making it difficult to analyze performance and optimize your strategy.
With Primer’s Unified Mapping Standard, all payment data—regardless of provider—is automatically standardized into a single, consistent format. This means you can track, compare, and analyze all your payment services in one place: the Observability Dashboard.

Observability provides over 100 visualizations and 30+ filters, allowing you to drill into key performance metrics across multiple PSPs and gateways in real time. For example, you can easily compare two payment providers side by side, track authorization rates, or identify where transactions are failing—without manually compiling reports from multiple sources.
With a single source of truth for all payment data, Observability helps you make informed decisions, optimize performance, and uncover new revenue-generating opportunities.
How Pelago simplifies payments across multiple markets with Primer
.jpg)
Pelago, a travel experiences platform by Singapore Airlines, connects travelers with activities across 150+ countries. As the company expands, delivering seamless, localized payment experiences has become a priority.
Pelago initially relied on a single global payment processor. While this worked in Singapore, expansion across APAC exposed gaps. Processor performance varies greatly across different markets, making it difficult for a single provider to meet all needs. Adding more PSPs could improve reliability and performance but would introduce significant technical complexity—something the team wanted to avoid.Â
So, instead of integrating multiple providers directly, Pelago turned to Primer. Primer acts as an infrastructure layer, allowing Pelago to connect with multiple PSPs and gateways without additional engineering effort. Through Primer, the company can:
- Easily enable new PSPs as they expand into new markets
- Optimize payment routing based on currency, cost, and approval rates
- Recover failed transactions using Fallbacks
- Dynamically tailor checkout to highlight the most cost-effective and conversion-friendly payment methods
Read the full case study: Pelago creates new horizons for travel and payments with Primer.
Use Primer to simplify payment gateway integration
With Primer, you don’t have to choose a single payment gateway. Our Unified Payments Infrastructure allows you to integrate multiple PSPs and gateways effortlessly, without complex integrations or ongoing maintenance. Whether you want to optimize for cost, reliability, or regional performance, Primer makes it easy to build a flexible and scalable payment stack that grows with your business.
Learn more about how to streamline your checkout experience with Primer.Â