September 4, 2026

Payment gateway

A payment gateway is the secure conduit that carries payment data between a customer and the systems that authorize a charge. It tokenizes the customer's card details, passes them to the payment processor, which routes the request through the card network to the issuing bank for a decision, and returns the approval or decline. It is the layer that lets a subscription business accept a card online without ever handling the raw card number itself.

In a subscription business, the gateway is what stands between a stored payment method and money actually moving. Every renewal, upgrade, add-on, or one-time charge has to pass through it, which makes the gateway both the entry point for revenue and a common point of failure when a charge does not go through. A subscription platform such as Recurly routes transactions through a connected gateway rather than processing payments directly, and it can work with a range of payment gateways so a business is not locked to a single one.

Why payment gateway matters for subscription businesses

The gateway is the checkpoint every recurring charge has to clear, so its behavior shapes how much revenue a business actually collects. A gateway that is slow, misconfigured, or poorly matched to where customers are billed turns healthy subscriptions into failed payments, and those failures land straight in Dunning and Collections to be recovered after the fact. Authorization outcomes at the gateway are the raw signal behind Involuntary churn: a decline that is never recovered is a customer lost to a payment problem rather than a real cancellation. The gateway also feeds the record that Invoicing and downstream reporting depend on, since whether a charge succeeded or declined is what marks an invoice paid or failed in the first place.

Before any of this happens, the customer's card details need to be tokenized, exchanged for a token that stands in for the raw card number, so that neither Recurly nor the merchant's own systems ever handle or store the actual card number. Tokenization is performed either by Recurly directly or by the connected gateway, depending on how the integration is set up.

How to use a payment gateway to authorize a transaction

A gateway's job is to take a payment request from the billing system, get a yes or no from the issuing bank, and return that result cleanly so the billing system knows what to do next.

Card transactions can be processed as a single step that combines authorization and capture into one request, or as two separate steps: an authorization that reserves funds, followed later by a separate capture that actually claims them. Fuel, travel, and general e-commerce often rely on the two-step model because the final amount or the delivery timing is not known at the moment of authorization. A fuel pump authorizes an estimated hold before the actual pumped amount is known, a hotel authorizes at booking and captures at checkout, and an online order may authorize at checkout but only capture once it ships. A subscription charge does not carry that uncertainty, since the amount is known up front and the subscription is delivered the moment the charge succeeds, so gateways process subscription transactions as a single-step authorization and capture together.

  1. Capture: the customer's payment details are collected through a hosted field or token so the raw card number is never exposed to the merchant's own systems.

  2. Encryption: the gateway encrypts the payment data and packages it into an authorization request for the processor.

  3. Request: the billing system sends a payment request to the gateway, specifying the amount to charge and the tokenized payment method to use, which kicks off the transaction.

  4. Routing: the gateway sends the request to the payment processor, which forwards it through the card network to the issuing bank.

  5. Authorization: the issuing bank checks the account for available funds, fraud signals, and validity, then sends a response code back through the network to the processor, approving or declining the charge.

  6. Response: the processor passes that response to the gateway, which relays the approval or decline back to the billing system that originally requested the charge, including a reason code that explains a decline (for example insufficient funds, an expired card, or a suspected-fraud block).

  7. Settlement: for an approved charge, the card network clears the transaction between the issuing bank and the merchant's acquiring bank, moving the reserved funds into the merchant's account. Because a subscription charge authorizes and captures in the same step, settlement simply pays out what that single transaction already reserved, with no separate capture step waiting to happen first.

Payment gateway vs payment processor

These two are often treated as the same thing, but they play different roles in a single transaction. The gateway is the front door: it tokenizes and encrypts the payment data, hands it off, and returns the result to the merchant. The processor is the machinery behind that door: it carries the transaction between the card networks and the issuing and acquiring banks, and it is what actually moves and settles the funds. In practice a customer only ever interacts with the gateway, while the processor works out of sight. Some providers offer both roles in one product, which is why the line blurs, but the functions are distinct: the gateway transmits and translates, the processor clears and settles.

Common mistakes with payment gateways

  • Locking into a single gateway with no fallback, so an outage or a region the gateway serves poorly takes down collections with no way to route around it.

  • Ignoring decline reason codes and retrying every failure the same way, instead of treating a hard decline (closed account, stolen card) differently from a soft one (insufficient funds, temporary hold).

  • Letting the gateway configuration drift out of sync with the currencies, card types, or regions customers are actually billed in, so valid cards are declined before the bank ever sees them.

  • Not passing full transaction and customer detail with the authorization request, which lowers approval rates and can raise the effective cost of each transaction.

  • Treating a gateway decline as a lost customer rather than routing it into a recovery flow, when much of that traffic is recoverable through retries and updated payment details.

Benefits and examples

  • Lets a business accept cards online without touching raw card data, which reduces its own security and compliance exposure.

  • Returns a clear approval or decline for every recurring charge, giving the billing system the signal it needs to mark an invoice paid or route it into recovery.

  • Supports higher approval rates on renewals when it is well matched to the customer's region, currency, and card type.

  • Keeps a subscription business flexible when it can connect to more than one gateway, so it can route by region, add redundancy, or renegotiate without re-platforming.

  • Feeds accurate payment outcomes into Invoicing, Dunning, and churn reporting so finance and growth teams are working from the same record.

Frequently asked questions

What is a payment gateway in subscription billing? It is the secure layer that tokenizes a customer's payment details, sends them for authorization, and returns an approval or decline for each charge, including every recurring renewal on a subscription.

How is a payment gateway different from a payment processor? The gateway is the customer-facing conduit that tokenizes and transmits payment data and returns the result. The processor is the back-end system that carries the transaction between the card networks and banks and settles the funds. Some providers do both, but the roles are distinct.

Does a subscription platform process payments itself? Not necessarily. A platform like Recurly routes transactions through a connected gateway rather than processing payments directly, so the gateway and its processor are what actually authorize and settle each charge.

Why do payments fail at the gateway? A charge can be declined for many reasons, including insufficient funds, an expired or replaced card, a suspected-fraud block, or a mismatch between the gateway's configuration and where the customer is billed. The decline reason code tells the billing system how to respond.

Can a business use more than one payment gateway? Yes. Connecting to more than one gateway lets a business route transactions by region, add redundancy against outages, and avoid being locked to a single provider, which can improve approval rates and resilience.