Axire Infotech Logo

Axire Infotech

© 2026 All Rights Reserved

Payment Gateway Integration – Avoid PSD2 Pitfalls | Axire

2026-08-23T07:40:07.612Z

Get the integration order wrong and your checkout will fail European customers before you even notice. To integrate a payment gateway into a web app, pick a provider that supports PSD2's Strong Customer Authentication out of the box, wire up server-side payment intents before touching the frontend, and verify webhooks with signatures, not response codes. Skip that order and you'll spend weeks debugging silent payment failures instead of building your product.

Key Takeaways

  • Server-first, not frontend-first: create the payment session or intent on your backend before rendering any card form, or you'll leak secret keys and lose idempotency control.
  • PSD2/SCA is mandatory in the EU and UK, not optional. Any card payment over roughly €30 (or outside an exemption) needs 3D Secure 2 authentication built into the flow.
  • Webhooks, not redirects, confirm payment status. Relying on the browser redirect alone causes "paid but not recorded" support tickets within the first month.
  • Stripe, Adyen, and Mollie each fit a different stage: Mollie for EU-first SMBs needing iDEAL and Bancontact, Stripe for global SaaS, Adyen for high-volume enterprise checkout.
  • Most integrations take 1-3 weeks for a single gateway with card and one local payment method, longer if you add subscriptions or multi-currency payouts.

Payment Gateway Integration at a Glance

GatewayPSD2/SCA SupportLocal Methods (EU/UK)Best FitTypical Integration Time
StripeBuilt-in via Payment IntentsiDEAL, Bancontact, Klarna, SEPASaaS, subscriptions, global startups1-2 weeks
AdyenBuilt-in, enterprise risk engineFull European method coverageHigh-volume e-commerce, marketplaces2-4 weeks
MollieBuilt-in, EU-focusediDEAL, Bancontact, SOFORT, KlarnaDutch/Belgian SMBs, simple checkout1 week
Hosted checkout pageHandled by providerDepends on gatewayFastest MVP launch2-5 days
Embedded Elements/ComponentsHandled by provider, custom UIDepends on gatewayBranded checkout, better conversion1-2 weeks

Founders searching for how to integrate a payment gateway into a web app usually land on this question after a first attempt breaks in production, often because a test-mode key made it live, or a webhook silently failed. This guide walks through the actual technical steps and the PSD2 checklist that prevents both.

1. Choose the Right Gateway for Your Market

Your target market decides the gateway more than your tech stack does. A SaaS selling to UK and US customers fits Stripe's subscription billing and Payment Intents API well. A Dutch e-commerce store needs iDEAL as the default option, which points toward Mollie or Stripe's iDEAL support rather than a US-centric gateway.

Close-up of a mobile phone showing a payment confirmation screen next to a laptop showing code. photorealistic photo of a smartphone displaying a simple payment success confirmation screen resting next to an open laptop with lines of code

Adyen makes sense once transaction volume justifies its enterprise pricing and you need a single contract covering dozens of local methods across markets like Germany, Sweden, and Ireland. Below roughly a few thousand transactions a month, that overhead rarely pays off compared to Stripe or Mollie.

If you're still scoping which markets to prioritize, our e-commerce payment integration guide for Sweden breaks down method preferences by country in more depth than we can cover here.

Local Payment Methods Matter More Than the Card Network

In the Netherlands, over half of online purchases use iDEAL, not a credit card. In Sweden and Germany, Klarna and SEPA direct debit dominate certain categories. Building a checkout that only accepts cards means losing a meaningful share of buyers before they even reach the payment step.

2. Understand PSD2 and Strong Customer Authentication (SCA)

PSD2 requires banks and payment providers operating in the EU and UK to apply Strong Customer Authentication to most electronic payments. In practice, that means a card payment needs two of three factors: something the customer knows, has, or is, verified through 3D Secure 2.

SCA doesn't apply to every transaction. Exemptions exist for low-value payments (typically under €30 with a cumulative cap), recurring merchant-initiated transactions after the first authenticated payment, and transactions where the customer's bank applies transaction risk analysis and decides authentication isn't needed.

The gateways covered here (Stripe, Adyen, Mollie) all implement 3DS2 and exemption logic natively. That's the actual reason to prefer them over a generic merchant account: you inherit their compliance work instead of building 3DS challenge flows yourself.

3. Pick an Integration Method: Hosted, Elements, or Direct API

The fastest path to a compliant checkout is a hosted payment page, while embedded Elements give you brand control at the cost of a bit more setup time. Direct raw API integration handling card numbers yourself is rarely justified for an SMB or startup because it pulls your app into a much heavier PCI DSS compliance scope.

Two developers reviewing API documentation and architecture diagram on a whiteboard. photorealistic photo of two software developers in a modern office reviewing a whiteboard covered with a system architecture diagram and API flow arrows

A hosted checkout page (Stripe Checkout, Mollie's hosted payment page) redirects the customer to a page the provider controls. You never touch card data, PCI scope stays minimal, and 3DS2 is handled entirely by the provider. This is the right call for most first launches and MVPs.

Embedded Elements or Components (Stripe Elements, Adyen Web Components) render the card form inside your own page using an iframe the provider controls behind the scenes. You get a fully branded checkout without ever seeing raw card numbers, which keeps you in the lightest PCI DSS self-assessment tier (SAQ A).

Direct API integration where your server touches card numbers moves you into SAQ D territory, the most demanding PCI compliance level. Unless you have a dedicated security team, this route isn't worth the operational overhead for most SMB or startup builds.

4. Build the Checkout Flow Step by Step

Start on the server, not the client. Your backend creates a Payment Intent (Stripe), Payment session (Mollie), or Payment object (Adyen) that specifies amount, currency, and any metadata tying it back to your order record.

  1. Server: Create the payment intent/session with an idempotency key so a retried network request never double-charges a customer.
  2. Frontend: Mount the gateway's Elements or Components with the client secret returned by your server, never expose your secret API key in browser code.
  3. 3DS challenge: Let the gateway's SDK handle the authentication popup or redirect automatically when SCA is required.
  4. Webhook: Listen for the payment succeeded (or failed) event server-side, verify the signature header, then update your order status.
  5. Confirmation page: Show the customer a success state based on the webhook-confirmed status, not just the browser redirect, since redirects can be interrupted or closed early.

This webhook-first pattern is the single most common thing missing from broken integrations we've reviewed. A customer closes the tab right after paying, the frontend never sees the "success" redirect, and your order stays marked as pending forever unless a webhook updates it independently.

5. Design Checkout UX That Doesn't Kill Conversion

Good checkout UX shows the customer's preferred local payment method first, keeps the form on one page, and surfaces errors inline instead of in a generic banner. Every extra redirect or unclear error message costs completed sales, particularly on mobile.

UX designer sketching a mobile checkout flow wireframe on a tablet. photorealistic photo of a UI/UX designer sketching a mobile app checkout wireframe with a stylus on a tablet, wireframe boxes visible showing form fields and a pay button

Detect the customer's country or let them pick it early, then reorder payment method icons so iDEAL appears before card entry for Dutch users, or Swish-style bank options rank higher for Nordic ones. Defaulting to a US-centric card-first layout for a European audience is a quiet conversion killer.

Keep form fields to a minimum. Auto-detect card type from the number, format expiry and CVC fields automatically, and never make the customer retype an amount or currency they already confirmed. If a 3DS challenge fails, explain what happened in plain language rather than a raw error code.

Our design team treats checkout screens the same way we treat any conversion-critical flow, testing real card and wallet inputs on mobile before launch. If your current checkout was bolted onto an existing site without this kind of review, a focused UI/UX design review often surfaces the exact friction points losing you sales.

6. Test and Handle Common Integration Failures

The most frequent production failure is a mismatched webhook secret between environments, so a test-mode signature check silently rejects live events. Always store separate signing secrets per environment and log every rejected webhook rather than failing silently.

Currency mismatches cause a second common failure class. If your product prices are stored in GBP but the gateway account defaults to EUR, transactions can succeed at the gateway while your books record the wrong amount. Lock the currency explicitly on every payment intent instead of relying on account defaults.

Test-mode and production-key mixups happen more often than teams admit, usually when a developer copies an environment variable into the wrong deployment. Build a startup check that refuses to boot if a test key is detected in a production environment variable.

Finally, plan the fallback UX for a failed SCA challenge. Some customers will abandon the 3DS popup or their bank will decline the authentication. Show a clear retry path and, where the gateway supports it, an alternative payment method rather than a dead end.

PSD2/SCA Compliance Checklist Before Launch

Run through this list before you take payments live in the EU or UK:

  • 3D Secure 2 is enabled for all card payments, not just a subset.
  • Exemption logic is configured for low-value and recurring transactions where applicable, so you aren't forcing unnecessary friction.
  • Webhook signature verification is implemented, with rejected events logged for review.
  • Secret keys live only server-side, never in frontend bundles or client-visible code.
  • Refund and dispute flows are tested end-to-end, including how a refund updates your order status via webhook.
  • Audit logging captures every payment state change with a timestamp for support and dispute resolution.
  • Data retention for card data follows PCI DSS scope rules for your chosen integration method (hosted, Elements, or direct API).

How Long Does Payment Gateway Integration Take?

A single gateway with card payments and one local method (like iDEAL) typically takes one to two weeks for an experienced team, covering server setup, frontend Elements, and webhook handling. Add subscription billing, multi-currency payouts, or a second gateway, and expect three to four weeks.

Before any of this begins, a short discovery step that maps your specific payment flows, currencies, and refund policy against the right gateway saves rework later. If you're earlier in planning, our MVP development FAQ covers how that discovery work fits into a broader build timeline.

Frequently Asked Questions

Does Stripe handle PSD2 automatically?

Yes, Stripe's Payment Intents API handles 3D Secure 2 authentication and exemption logic automatically for EU and UK transactions. You still need to use Payment Intents (not the older Charges API) and pass through the correct customer and billing details for exemptions to apply correctly.

Can I use Mollie and Stripe together in the same web app?

Yes, some businesses run Mollie for Dutch and Belgian local methods and Stripe for global card and subscription billing, routing by customer country. This adds integration complexity, since you need two webhook handlers and two reconciliation processes, so it's usually only worth it once volume in both regions justifies the overhead.

What is the app discovery phase and why does it matter before integration?

The discovery phase is the planning step where your development team maps out payment flows, target markets, currencies, and compliance requirements before writing integration code. Skipping it is the most common reason teams pick the wrong gateway or discover PSD2 requirements only after launch, when fixing them means reworking a live checkout.

If you want that discovery work done properly before a single line of integration code is written, our team at Axire Infotech maps out your gateway choice, PSD2 requirements, and checkout UX together, so nothing gets bolted on after the fact. For a deeper look at what these integrations cost across different use cases, see our development timeline and cost guide.

Ready to get your checkout live without the compliance guesswork? Contact our team for a technical scope of your payment integration, or browse our web development services to see how we approach full-stack builds end to end.

#payment gateway integration#PSD2 compliance#stripe integration#SCA authentication#web app development#checkout UX

Ready to Start Your Project?

Let's discuss your project and create something amazing together.

Payment Gateway Integration – Avoid PSD2 Pitfalls | Axire | Axire Infotech