Glossary

Payment Gateway

Software that securely transmits payment data from a merchant's checkout to the payment processor for authorization.

Key Takeaways

  • A payment gateway is the technology layer that encrypts and routes transaction data from a merchant's checkout to the payment processor for authorization: it never holds funds itself, but controls whether a payment proceeds or is declined.
  • Gateway integration models range from hosted (redirecting to a third-party page) to API-based (handling card data directly), and each model carries different PCI DSS compliance requirements.
  • Bitcoin payment gateways like BTCPay Server and OpenNode mirror the traditional model by generating invoices, monitoring blockchain confirmations, and notifying merchants of settlement: all without intermediary custody of funds.

What Is a Payment Gateway?

A payment gateway is a technology service that acts as the secure bridge between a merchant's checkout interface and the financial networks that authorize and process payments. When a customer enters their card details on an e-commerce site or taps their phone at a point-of-sale terminal, the payment gateway encrypts that sensitive data, transmits it to the appropriate payment processor, and relays the authorization response back to the merchant: all within two to three seconds.

Think of the payment gateway as a digital equivalent of a card terminal in a physical store. The terminal does not hold money or make lending decisions. It reads the card, securely sends the data to the bank, and displays "approved" or "declined." An online payment gateway performs the same function for digital transactions, adding encryption and fraud screening along the way.

Payment gateways are distinct from payment processors, which handle the actual movement of funds between banks. Some providers bundle both roles into a single service (often called a payment service provider or PSP), but the gateway and processor functions remain conceptually separate.

How It Works

The payment gateway sits at the center of a multi-party authorization flow. Here is the step-by-step process for a typical card transaction:

  1. The customer submits payment details at checkout (card number, expiration, CVV, or a digital wallet token).
  2. The gateway encrypts the data using TLS and transmits it to the payment processor.
  3. The processor formats the transaction and routes an authorization request through the card network (Visa, Mastercard) to the customer's issuing bank.
  4. The issuing bank verifies available funds, checks for fraud indicators, and applies any required authentication (such as 3D Secure). It returns an approval or decline code.
  5. The card network passes the response back through the processor to the gateway, which relays it to the merchant's checkout.
  6. If approved, the transaction is batched for settlement. The processor facilitates the transfer of funds from the issuing bank to the acquiring bank, and eventually into the merchant's account.

Authorization does not mean funds have moved. It confirms the issuing bank approved the transaction and placed a hold. The actual fund transfer happens during settlement, which can take one to three business days on traditional card networks.

Gateway Integration Types

Merchants can integrate payment gateways in three primary ways, each with different tradeoffs between customization, development effort, and PCI DSS compliance scope:

TypeHow It WorksPCI LevelCustomization
HostedRedirects the customer to the gateway provider's checkout pageSAQ A (lightest)Limited
Integrated (iFrame/SDK)Embeds payment fields from the provider within the merchant's pageSAQ A-EP (moderate)Moderate
API-based (direct)Merchant's server collects and transmits card data via APISAQ D (heaviest)Full

Hosted Gateways

A hosted gateway redirects the customer away from the merchant's site to complete payment on the provider's secure page. Because card data never touches the merchant's servers, PCI compliance is minimal (SAQ A, roughly 22 requirements). This is the fastest path to accepting payments, but the redirect can reduce conversion rates due to the interruption in checkout flow.

Integrated Gateways

Integrated gateways use iFrames or JavaScript SDKs to embed payment fields directly in the merchant's checkout page. The customer never leaves the site, but sensitive card data is captured by the provider's embedded component rather than the merchant's code. This approach requires SAQ A-EP compliance: more involved than hosted, but far less burdensome than handling raw card data.

API-Based Gateways

Direct API integration gives merchants full control over the payment experience. The merchant's server collects card details and transmits them to the gateway via API. This demands SAQ D compliance: up to 300+ security controls, quarterly vulnerability scans, and potentially annual audits by a Qualified Security Assessor. API-based integration is typical for large enterprises with dedicated security teams.

A simplified API-based checkout flow looks like this:

// Merchant server creates a payment intent
const response = await fetch('https://api.gateway.com/v1/charges', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer sk_live_...',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    amount: 4999,          // Amount in cents
    currency: 'usd',
    payment_method: 'pm_card_...', // Tokenized card reference
    description: 'Order #1234'
  })
});

// Gateway returns authorization result
const charge = await response.json();
// charge.status: "succeeded" | "failed" | "pending"

In practice, most modern API gateways encourage tokenization: the client-side SDK captures card details and returns a token, so the merchant's server never handles raw card numbers. This reduces PCI scope while preserving API-level control.

PCI DSS and Security

The Payment Card Industry Data Security Standard (PCI DSS) is a set of mandatory security standards established by the PCI Security Standards Council. Any entity that stores, processes, or transmits cardholder data must comply. The choice of gateway integration model directly determines the merchant's PCI compliance scope:

  • Hosted gateways minimize scope because card data stays on the provider's infrastructure. Annual compliance costs typically range from $0 to $3,000.
  • Integrated gateways require enhanced self-assessment questionnaires and quarterly vulnerability scans, costing $2,000 to $10,000 annually.
  • API-based gateways carry the full compliance burden, with costs ranging from $5,000 for smaller merchants to $300,000+ for Level 1 merchants processing over 6 million transactions per year.

Beyond PCI DSS, modern gateways implement additional security layers: TLS encryption for data in transit, 3D Secure authentication (required under PSD2 in Europe), AI-driven fraud scoring, and address verification services (AVS).

Bitcoin Payment Gateways

Bitcoin payment gateways adapt the traditional gateway model for cryptocurrency transactions. Instead of routing card data to card networks, they generate Bitcoin invoices, monitor the blockchain (or Layer 2 networks like Lightning) for confirmations, and notify merchants when payment has settled.

Two prominent approaches have emerged:

Self-Hosted: BTCPay Server

BTCPay Server is a free, open-source, self-hosted Bitcoin payment gateway. It runs on the merchant's own infrastructure (or a cloud server), connects to a full Bitcoin node, and processes payments directly into the merchant's wallet with no intermediary and no transaction fees.

  • Payments go directly to the merchant's wallet: self-custody by default
  • No KYC requirements or third-party account needed
  • Supports on-chain Bitcoin and Lightning Network payments
  • Integrates with WooCommerce, Shopify, and other e-commerce platforms
  • Requires technical knowledge to deploy and maintain (a full Bitcoin node uses 600GB+ of storage, though pruned nodes reduce this to around 60GB)

Cloud-Hosted: OpenNode

OpenNode is a managed Bitcoin payment processor that offers hosted checkouts, e-commerce plugins, and API integration. It supports both on-chain and Lightning Network payments, with automatic conversion to USD at the time of transaction.

  • Turnkey integration with as few as 10 lines of code
  • Automatic fiat conversion eliminates Bitcoin price volatility for merchants
  • No chargebacks (a fundamental property of Bitcoin transactions)
  • Available in 160+ countries
  • Requires KYC and charges per-transaction fees (custodial model)

Comparing Traditional and Bitcoin Gateways

FeatureTraditional GatewayBitcoin Gateway
Settlement time1 to 3 business daysMinutes (on-chain) to seconds (Lightning)
ChargebacksYes (merchant bears risk)No (transactions are irreversible)
IntermediariesCard network, issuing bank, acquiring bankNone (peer-to-peer) or single provider
Geographic restrictionsVaries by card network coverageGlobal by default
CompliancePCI DSS mandatoryNo PCI DSS (no card data)

For a deeper look at how Bitcoin payment infrastructure works for merchants, see the Bitcoin merchant payments guide.

Use Cases

E-Commerce and Online Retail

Payment gateways are foundational to online commerce. Every checkout page that accepts card payments relies on a gateway to encrypt, transmit, and receive authorization for transactions. Hosted gateways let small businesses start accepting payments in hours, while API-based integrations give large retailers full control over the customer experience.

Subscription and Recurring Billing

Gateways that support tokenization enable merchants to store token references for customer cards and charge them on a recurring schedule without re-collecting payment details. This powers SaaS billing, membership sites, and any subscription-based business model.

Cross-Border Payments

Modern gateways support multi-currency processing, allowing merchants to accept payments in the customer's local currency while settling in their own. Bitcoin gateways take this further: because Bitcoin has no geographic boundaries, a merchant can accept payment from any country without needing local acquiring bank relationships or dealing with SWIFT transfer delays.

In-Person and Point-of-Sale

Payment gateways are not limited to online transactions. Many providers offer hardware terminals or mobile card readers that connect to the same gateway infrastructure. BTCPay Server includes a built-in point-of-sale app that lets brick-and-mortar stores accept Bitcoin through a web interface or dedicated device.

Why It Matters

Payment gateways are the entry point for every digital transaction. Choosing the right gateway model affects security posture, compliance costs, checkout conversion rates, and settlement speed. As businesses increasingly accept both traditional and cryptocurrency payments, the gateway layer becomes the integration point where these payment rails converge.

For businesses building on Bitcoin infrastructure, platforms like Spark provide a Layer 2 network that enables fast, low-cost Bitcoin and dollar-denominated payments with self-custodial settlement. This creates opportunities for payment gateway providers to offer Bitcoin-native checkout experiences with the speed and cost profile that merchants expect from traditional card networks.

Risks and Considerations

Security and Data Breaches

Any system handling payment data is a target for attackers. Merchants using API-based gateways assume significant responsibility for securing cardholder data. Even with hosted gateways, vulnerabilities in the merchant's site (such as XSS attacks injecting malicious scripts) can compromise payment flows.

Vendor Lock-In

Switching gateway providers can be disruptive, especially for merchants with stored payment tokens. Tokens generated by one gateway are typically not portable to another, meaning a migration may require customers to re-enter their payment details.

Fee Structures

Gateway fees typically combine a per-transaction percentage (1.5% to 3.5% for card payments) with a fixed per-transaction fee ($0.20 to $0.30). International transactions, currency conversion, and chargebacks incur additional costs. Bitcoin gateways generally charge lower per-transaction fees, though self-hosted solutions like BTCPay Server require infrastructure costs instead.

Regulatory Complexity

Payment gateways must comply with regulations that vary by jurisdiction: PCI DSS globally, PSD2 and Strong Customer Authentication in Europe, and various data protection laws. Bitcoin gateways face a different regulatory landscape, with requirements varying based on whether the provider takes custody of funds and the jurisdictions they operate in.

Single Point of Failure

A gateway outage means no transactions can be processed. Merchants relying on a single gateway provider risk downtime-driven revenue loss. Some businesses mitigate this through payment orchestration: routing transactions through multiple gateways based on availability, cost, and approval rates.

This glossary entry is for informational purposes only and does not constitute financial or investment advice. Always do your own research before using any protocol or technology.