Payment Gateway Integration — Architecture and PCI in 2026
Payment gateway integration is where checkout control meets PCI compliance. The hosted-vs-direct choice decides how much of the payment experience you own — and how much compliance burden you carry. Here’s how to choose.
Payment gateway integration is one of the highest-stakes parts of any ecommerce build, because it sits at the exact point where money changes hands and where security and compliance rules are strictest. The central decision in a payment gateway integration is architectural: do you use a hosted approach, where the gateway handles the sensitive payment step, or a direct/API approach, where payment happens on your own site? That choice shapes how much of the checkout experience you control and — critically — how much PCI DSS compliance burden falls on you. This guide walks the trade-off and how to choose well.
Search intent: informational/technical — merchants and developers planning how to integrate payments. We cover the hosted-versus-direct trade-off, each approach, PCI scope, tokenisation, and getting it right. It builds on our Magento 2 payment gateway guide and WooCommerce Stripe integration guide.
Payment Gateway Integration: The Core Trade-Off
Every payment gateway integration decision flows from one trade-off: control versus compliance burden. The more of the payment process that happens on your own site — giving you full control over the checkout experience — the more of the sensitive cardholder-data environment you are responsible for securing, and the wider your PCI DSS scope. The more you hand the sensitive step to the gateway, the less you control the exact experience, but the smaller your compliance burden. There is no option that maximises both; the art of a good payment gateway integration is choosing the right point on that spectrum for your business.
This is why “which gateway” is a less important question than “which integration model”. Most major gateways (Stripe, PayPal, Adyen, Braintree and others) support multiple integration models, so the strategic choice in a payment gateway integration is not usually the provider but the architecture: hosted, direct, or one of the hybrid approaches that have emerged precisely to balance control and compliance. Understanding that spectrum is the foundation of every other decision.
Payment Gateway Integration: The Hosted Approach
In a hosted payment gateway integration, the actual payment step happens on the gateway’s infrastructure, not yours. The classic form is a redirect: the customer clicks pay and is sent to the gateway’s hosted page to enter card details, then returned to your store afterwards. Modern variants keep the customer on your page visually but embed the sensitive fields from the gateway (via an iframe or hosted fields), so card data still never touches your servers. Either way, the defining trait is that the sensitive cardholder data goes directly to the gateway.
The huge advantage of the hosted approach to payment gateway integration is minimal PCI scope. Because card data never touches your systems, your PCI DSS compliance burden drops to its simplest level — you are not storing, processing or transmitting raw card data, so most of the demanding requirements do not apply to you. It is also faster and cheaper to integrate and to keep compliant. The trade-off is control: a redirect takes the customer off your site momentarily, and even embedded hosted fields give you less freedom over the exact checkout experience than a fully on-site flow. For many merchants, especially smaller ones, that trade is well worth it — the reduced compliance burden of a hosted payment gateway integration is a genuine, ongoing benefit.
Payment Gateway Integration: Direct/API and PCI Scope
A direct or API-based payment gateway integration takes the opposite approach: payment happens within your own checkout, on your site, giving you full control over the experience. Card data is captured on your page and — in any responsible modern implementation — immediately tokenised, so you exchange the raw card details for a token via the gateway rather than storing card numbers yourself. This on-site flow enables a seamless, fully branded checkout with no redirect and complete control over every step.
The cost of that control is a larger PCI DSS scope. Because card data passes through your environment (even momentarily, even if immediately tokenised), more of the PCI requirements apply to you, and the compliance effort and responsibility are greater. Tokenisation dramatically reduces the risk and scope compared with actually storing card numbers — it is essential, non-negotiable practice — but a direct payment gateway integration still carries more compliance weight than a hosted one. This approach suits merchants who need full checkout control and have the resources to meet the higher compliance bar; it is a deliberate trade of burden for control, not a default.
| Factor | Hosted / Redirect | Direct / API |
|---|---|---|
| Where card data goes | Straight to gateway | Through your site (tokenised) |
| Checkout control | Less | Full |
| PCI DSS scope | Minimal (simplest SAQ) | Larger |
| Integration effort | Lower | Higher |
| Experience | Redirect or embedded fields | Fully on-site, seamless |
| Best for | Most merchants, lower burden | Need full control + resources |
Tokenisation is non-negotiable — never store raw card data. Whatever payment gateway integration model you choose, raw card numbers should never be stored on your systems. Tokenisation — swapping card data for a gateway-issued token you can safely keep for reuse — is what makes recurring billing and saved cards possible without holding the actual numbers. Storing raw card data is both a massive PCI liability and simply unnecessary; the gateway’s tokenisation exists precisely so you never have to.
Payment Gateway Integration: Getting It Right
Choosing the right payment gateway integration comes down to weighing control against compliance honestly for your situation. If you want the simplest, lowest-burden path and can accept a hosted checkout, the hosted approach is often the pragmatic best choice — its minimal PCI scope is a real, ongoing saving, and modern embedded hosted fields keep the experience clean. If you genuinely need a fully bespoke, on-site checkout and have the resources to carry a larger PCI scope, a direct/API integration delivers that control. Many merchants land on a hybrid that captures most of the control with much of the scope reduction.
Whichever you choose, get the fundamentals right: always tokenise, never store raw card data; use your platform’s well-supported gateway integrations rather than building payment handling from scratch (our Magento and WooCommerce Stripe guides show the mature paths); and treat PCI compliance as an ongoing responsibility, not a one-off checkbox. A well-architected payment gateway integration is secure, compliant and appropriate to your control needs — and getting that balance right at the outset avoids both an over-complex compliance burden and a checkout that costs you conversions. Our team designs and builds payment integrations that match each merchant’s control needs to a sensible compliance posture.
How we approach payment gateway integration
We start from PCI scope, then work back to experience. The compliance burden is the part merchants underestimate, so we frame the choice around it: hosted keeps scope minimal, direct expands it. Only once a client understands that trade honestly do we discuss how much checkout control they actually need — because control taken on lightly can mean a compliance obligation they did not budget for.
We default to reducing PCI scope unless there is a real reason not to. For most merchants, a hosted or embedded-fields integration delivers a clean checkout with far less compliance weight, so that is our starting recommendation. We move to a full direct/API integration when a client genuinely needs bespoke on-site control and has the resources to carry the scope — not because it sounds more sophisticated.
We treat tokenisation and mature integrations as non-negotiable. We never store raw card data and never hand-roll payment handling when a platform’s well-supported gateway integration exists. Payments are too high-stakes for bespoke plumbing; using proven, maintained integrations and tokenising everything is how we keep a client secure and compliant rather than exposed.
Frequently Asked Questions About Payment Gateway Integration
What is payment gateway integration?
It is connecting your store to a payment gateway so customers can pay, and deciding the architecture for how that happens. The central choice is hosted (the gateway handles the sensitive payment step off your servers) versus direct/API (payment happens on your own site). That choice determines how much checkout experience you control and how much PCI DSS compliance burden falls on you.
What is the difference between hosted and direct payment integration?
In a hosted integration, card data goes straight to the gateway (via redirect or embedded hosted fields) and never touches your servers, minimising PCI scope but giving you less checkout control. In a direct/API integration, payment happens on your site with full control, but card data passes through your environment (tokenised immediately), which enlarges your PCI scope and compliance burden. It is control versus compliance.
Which payment integration has lower PCI scope?
Hosted, by a wide margin. Because card data never touches your systems in a hosted integration, you are not storing, processing or transmitting raw card data, so most demanding PCI DSS requirements do not apply and you qualify for the simplest compliance level. A direct/API integration, where card data passes through your environment, carries a larger scope even with tokenisation.
What is tokenisation and why does it matter?
Tokenisation swaps raw card data for a gateway-issued token that you can safely store and reuse — enabling saved cards and recurring billing without ever holding actual card numbers. It matters because storing raw card data is a major PCI liability and completely unnecessary. Whatever integration model you choose, you should always tokenise and never store raw card numbers on your own systems.
Which payment integration should I choose?
Weigh control against compliance for your situation. If you want the simplest, lowest-burden path and can accept a hosted checkout (modern embedded fields keep it clean), hosted is often the pragmatic best choice. If you genuinely need a fully bespoke on-site checkout and have resources for a larger PCI scope, direct/API delivers that control. Many merchants land on a hybrid balancing both.
Should I build payment handling myself?
No. Payments are too high-stakes for bespoke plumbing. Use your platform’s well-supported, maintained gateway integrations rather than hand-rolling payment handling, always tokenise, and never store raw card data. Building payment processing from scratch invites security and compliance risk that proven integrations already solve. Treat PCI compliance as an ongoing responsibility, not a one-off task, whichever model you use.
Planning a Payment Integration?
Our team matches your checkout-control needs to a sensible PCI posture — secure, compliant payments without unnecessary burden.