Skip to main content
DBB Software logo

Payment Gateway Integration: How to Choose Providers and Integrate Them

Product development

FinTech

Updated: December 4, 2026 | Published: December 3, 2026

Choose a payment provider that fits your product model and markets, then build the integration to confirm payments and handle refunds, disputes and payouts.

Key Takeaways

  • Choose payment providers by how money moves through your product: one-off sales, subscriptions and marketplace payouts need different features and leave different work with your team.

  • Hosted pages and the provider's embedded fields shrink your PCI DSS scope by keeping card numbers off your servers, and your provider or acquiring bank confirms which questionnaire you file.

  • Mark an order paid only when a signed webhook or the provider's API confirms the payment succeeded, never because the customer reached your success page.

  • When you're the seller, your product still owns refunds, disputes, payout reconciliation and the records finance relies on, so give each one an owner before launch.

  • If you'll store customers' cards, ask before signing whether the provider will hand that card data to a new provider, since saved cards can't simply be charged elsewhere.

If a payment that succeeds today is disputed in 3 months, can your product still prove the sale? Visa's rules give cardholders 120 days to raise most disputes, so a payment gateway integration has to keep handling each payment long after the first charge.

Your integration is finished when your product can handle a payment's whole life, from refunds to payouts, and your team knows what it would take to leave the provider. Getting there takes 6 steps.

This guide is for the product, engineering, finance and operations teams that build and run payments. It draws on DBB Software's work on Bookis's book marketplace, Choo Choo's rail-ticketing apps, creator payouts for a live-streaming app and part of the billing for Tie.

What Payment Gateway Integration Is and How It Works

Payment gateway integration connects your product to a payment provider so it can take payments, then follow each one through authorization, capture, refunds and payouts in your own records.

Payment Gateway vs Merchant Account vs Payment Processor

A payment gateway, a payment processor and a merchant account do different jobs in each card payment, and a payment service provider usually sells all 3 in one contract:

  • Payment gateway: passes the payment details from your checkout to the processor.

  • Payment processor: handles the transaction with the card networks, such as Visa and Mastercard.

  • Merchant account: holds the money from your card sales at an acquirer, usually a bank, which pays it out to you.

When a customer pays, the card network carries the details to the customer's bank, the issuer, which approves or declines while the customer waits. The money moves later.

The Life of One Payment, From Authorization to Payout

A card payment moves from authorized to captured, settled and paid out. An authorization works like a reservation: the customer's bank sets the money aside, but nothing moves until you capture it. Adyen's lifecycle documentation notes that settled doesn't mean paid out, because the money waits with your provider until a payout.

A few branches leave that path:

  • Void: releases an authorization before the money moves.

  • Refund: returns captured money, in full or in part.

  • Dispute: a chargeback the cardholder's bank opens, usually after settlement.

  • Pending: bank debits can take days to succeed or fail, and can still be returned or disputed weeks or months later.

Any request can also be declined, fail or time out, so your product records each state as it happens.

A payment's main path from authorization to payout, with branches for voids, refunds, disputes and payments that confirm later.

How to Integrate a Payment Gateway in 6 Steps

To integrate a payment gateway into a website or app, follow these 6 steps:

  1. Map how money moves through your product: who pays whom, for what, and where.

  2. Choose payment providers for your product model, check their exit terms and open the account.

  3. Choose the type of payment integration and check the PCI DSS scope it brings.

  4. Build the payment API flow from checkout to confirmation, with safe retries and webhooks.

  5. Decide who handles refunds, disputes and payouts.

  6. Test payment declines, timeouts and refunds, then go live in stages.

Later, 2 decisions usually follow: adding a second provider and switching providers. On Shopify, WooCommerce and similar platforms, the provider's plugin covers Steps 3 and 4, except Step 3's PCI DSS work on a site you host yourself. Steps 1, 2, 5 and 6 still apply.

Step 1: Map How Money Moves Through Your Product

Before you compare providers, write down who pays whom, for what, how often and where:

  • one-off or recurring charges, and payouts to sellers, creators or partners;

  • the markets, currencies and payment methods your customers expect;

  • digital goods sold inside a mobile app;

  • your refund and cancellation policy;

  • expected volume, the average payment and the share of foreign cards;

  • the systems that already record payments, such as accounting, ERP or CRM.

That list is your set of payment gateway integration requirements, and Step 2 compares providers against it. If payments are one part of a fintech product you're scoping, our guide on how to build a fintech app covers the wider build, SCA and PCI DSS included.

Step 2: Choose Payment Providers for Your Product Model

To choose a payment gateway, start from your product model before you compare fees. One-off payments, subscriptions and a marketplace that pays out sellers need different things from a provider:

Model

Provider gives

You still own

Check first

One-off payments

Card and wallet payments

Payment states, refunds, receipts

The methods and markets you need

Subscriptions

Stored cards, recurring charges, retry tools

Plan logic, failed renewals, cancellations

Whether stored cards can leave with you

Marketplace or platform

Seller onboarding and checks, split payments, payouts

Payout rules, seller support

Who carries a dispute a seller can't pay

On a platform, the provider's seller checks can keep identity documents out of your product. When DBB built creator payouts for a live-streaming app, "Each creator had a Stripe Express account and completed identity checks on Stripe-hosted pages, so the app never handled ID documents." If your platform holds money for others, settle the licensing question with qualified advisers before the architecture is final.

For any model, 3 conditions can change the choice:

  • Several markets: compare approval rates and the local payment methods customers expect, such as iDEAL | Wero in the Netherlands, Pix in Brazil or UPI in India. Bank payments, such as pay by bank and direct debits, change refund and settlement timing. For Bookis, DBB integrated Stripe and Vipps, a Norwegian payment app.

  • Digital goods in a mobile app: Apple and Google Play require store billing by default for digital goods used in the app, with exceptions by storefront. Physical goods, and services used outside the app, go through your own provider.

  • Software sold into many tax jurisdictions: a merchant-of-record service charges your customers in its own name and handles sales tax and VAT. You usually still bear the cost of refunds and lost disputes, and some such services cover only digital products.

Compare Payment Providers for Your Product Model

To choose a payment processor or gateway for your product model, work through the choice in this order:

  1. Shortlist: drop any provider that won't accept your type of business or misses a must-have from your money map.

  2. Compare costs and reports: price a typical month at each provider's published or quoted rates, with your volume, average payment and share of foreign cards. Check when funds settle and whether each payout breaks down into payments, refunds and fees.

  3. Test before you commit: make a test payment and a refund in each provider's sandbox, its test environment.

  4. Let exit and risk terms decide: when 2 providers still fit, compare their exit terms and what can trigger reserves, payout holds or a suspension.

Check a Payment Provider's Exit Terms Before You Sign

Before you sign with a payment provider, check the terms that decide how hard a switch will be:

  • For every product: termination fees and auto-renewals.

  • Stored cards: whether the provider must send card data to another PCI DSS-compliant provider on request, how fast and by when. Stripe's Payments Terms, for example, allow the request only for a set period after the contract ends.

  • Direct debits: whether the mandates, your customers' permissions to debit their accounts, sit under your own SEPA creditor ID or Bacs service user number, or the provider's.

  • Network tokens: whose token requestor ID they sit under, since tokens under the provider's ID stay with the provider, as EMVCo's tokenization model sets out.

Cards saved with one provider can't simply be charged through another. The exceptions are an independent card vault, or a provider that forwards cards, as Stripe's Vault and Forward API does for businesses with a dedicated account team.

Open a Payment Provider Account and Get API Keys

Open your payment provider account as soon as you've chosen a provider. You can build with test keys while verification runs, and get live keys once the provider approves the account:

  • Verification: expect to provide the company's registration, its owners' identity, what it sells and how it delivers, its website and the payout bank account. Stripe asks you to allow 3–5 business days for a document review.

  • Credentials: keep test and live keys and webhook secrets apart, store server keys in a secrets vault rather than in your code, and limit who can refund in the dashboard.

  • Risk terms: Stripe's Payments Terms, for example, let it delay payouts, set a reserve or suspend payments when it sees too much risk. Describe your business accurately, and warn the provider before a launch or a volume spike.

Planning payments for a product that moves money?

Describe how money moves through your product, and get a free preliminary scope covering requirements, architecture decisions, the data model, risks and milestones.

Get a free fintech scope document

Step 3: Choose a Payment Integration Type and Check Its PCI DSS Scope

Choose the payment integration that gives you the checkout control you need with the smallest PCI DSS scope. The 4 usual types are a hosted payment page, embedded fields or drop-in, mobile SDK components and the direct card API.

Your scope under the Payment Card Industry Data Security Standard (PCI DSS) follows where card details travel. Merchant guidance from the PCI Security Standards Council (PCI SSC) covers any system that handles card data or could affect its security. With the provider's page, fields or SDK, your server usually sees only a payment ID or a token, which stands for the card without revealing its number.

The types differ in where card data is entered, how much control you get and which Self-Assessment Questionnaire (SAQ) you file:

Type

Card data

Your control

PCI scope

Hosted payment page

Entered on the provider's page

Low

Smallest; SAQ A may apply

Embedded fields or drop-in

Entered in the provider's fields, or in a form your page builds

Medium to high

Small; SAQ A may apply to the provider's fields, A-EP to a form your page builds

Mobile SDK components

Entered in the provider's SDK

High

Small; often SAQ A, per the provider's guidance

Direct card API

Collected by your form and sent by your servers

Full

Largest; SAQ D

A hosted page takes the customer to the provider's page, usually with your logo and colors. Embedded fields or a drop-in form keep them on your page, and mobile SDK components add the provider's screens to your app. With the direct card API, you design every screen.

The table follows the eligibility criteria in PCI SSC's self-assessment questionnaires and, for mobile SDKs, providers' guidance such as Stripe's PCI guide.

For most web products, DBB starts from the provider's embedded fields or hosted page, and for apps from its mobile SDK. Choose embedded fields when checkout must stay on your page and match your product. Choose the hosted page when the quickest build and the least PCI work matter more.

Choose the direct card API only when card data must pass through your servers, since providers such as Adyen require full PCI DSS compliance first. Choo Choo's rail-ticketing apps took the lighter route: "Payment runs client-side through Stripe, so card data never touches DBB's backend."

A smaller scope still leaves PCI DSS work:

  • The questionnaire: your acquirer or provider confirms which SAQ you file, usually every year.

  • Scripts around an embedded form: SAQ A asks you to confirm your page isn't open to script attacks. Your own controls can back that, or the provider's confirmation, which PCI SSC accepts when its form is set up as instructed. A full redirect avoids this condition.

  • Scans: even with a redirect, an Approved Scanning Vendor (ASV) must scan your e-commerce pages regularly, as PCI SSC confirms.

Step 4: Build the Payment API Integration From Checkout to Confirmation

In a typical payment gateway API integration, your server creates the payment and the customer pays through the provider's page, fields or SDK. Your product marks the order paid only after the provider confirms it:

  1. Create the payment on your server. Record the order first, so every payment has your own ID. Then create the payment through the provider's API with server-side credentials, taking the amount and currency from your order record, never from the browser. Include your order ID and, where supported, an idempotency key, a unique value that stops a retried request from charging twice.

  2. Show the provider's form and handle authentication. Redirect to the hosted page or load the provider's fields or SDK. If the customer's bank asks for authentication, the payment waits until the customer completes it. In the EU and UK, that's usually 3-D Secure, the way online card payments meet strong customer authentication (SCA): the customer confirms the payment with their bank.

  3. Confirm the payment through a verified webhook. The provider sends your server a webhook, a message, when a payment's status changes. Check its signature so a forged event can't mark an order paid. Then store it, acknowledge it at once and process it from a queue, since Stripe's webhook guide explains that unacknowledged events are resent.

  4. Check the status on return, and catch missing events. When the customer reaches the success page or returns to your app, ask the provider's API for the status, since the webhook may come later, as Stripe's fulfillment guide notes. Both paths call one fulfillment function that's safe to run twice, even if both calls arrive at the same time. A scheduled check also asks about orders still unconfirmed after a set time, so a missing event surfaces within minutes.

  5. Fulfill on the status that confirms the payment for its method. Ship, grant access or issue the ticket only then.

That status depends on how and when the money moves:

  • Delivered at once: capture at once, and fulfill on the provider's status for a successful payment.

  • Shipped later: authorize at checkout, ship on the confirmed authorization and capture at shipment, as Visa's and Mastercard's rules expect. Advance payments for custom-made goods or travel are the exception. Capture before the authorization expires, on the date your provider reports. Mark the order paid only when the provider confirms the capture, since a capture can still fail.

  • Bank debits: hold the order while the debit is pending, as Stripe advises, since even a successful debit can be returned or disputed later. If your billing tool activates a subscription during that wait, as Stripe Billing can, decide whether that grants access.

One payment's flow between a customer, a product's front end and server, and a payment provider, ending with the provider's confirmation.

Save Cards for Renewals and Other Later Charges

Save a card for later charges only with the customer's agreement, then flag each renewal as a charge you start:

  • The agreement: the customer accepts terms on when and how you'll charge the card, and in the EU and UK authenticates when saving it, as Stripe's guide to saving cards shows.

  • Renewals: flag each one as a charge you start, which Stripe calls off-session. In the EU and UK, such renewals fall outside SCA, according to the European Commission's answer published by the EBA and the FCA. A purchase the customer starts with a saved card still needs SCA, and the issuer can still ask for authentication, so give the customer a way back.

  • Declines: some, such as a closed account or a card reported stolen, mean you must never charge the card again. The rest allow a limited number of retries under the card networks' rules, and a card updater or network tokens keep saved cards current.

Make Payment Retries and Webhooks Safe

Make payment retries and webhooks safe by giving each customer action one identifier and processing each provider event once:

  • Timeouts: retry with the same idempotency key while the provider keeps it, and check the payment before you create another, since a new key can start a second charge.

  • Duplicates: skip events you've already processed, and take the current status from the provider's API rather than from the order events arrive in.

Our guide on keeping API integrations working covers retries and webhooks in more depth.

Keep Payment Provider Details Out of Your Core Logic

Give each order your own ID, store the provider's payment ID alongside it and map the provider's statuses to your own payment states. Your records then keep their meaning when the provider adds or changes a status. On Tie's creator-commerce platform, where DBB designed and built a part of the new billing and payment subsystems, "The architecture now isolates plan logic from payment movement, so pricing changes don't ripple into payment-processor code."

Payment API Details Your Engineers Will Need

Your engineers will also need a few provider-specific payment API details:

  • Formats and keys: send amounts in the provider's format, often the currency's smallest unit, as Stripe's currency table shows. Give the front end only a public key or a one-payment secret.

  • Failures: show fraud-related declines as generic ones, as Stripe's decline codes advise, and retry with backoff only errors the provider marks as safe to retry.

  • Cancellations: if you can't fulfill an order, release an uncaptured authorization, which Visa's rules require within 24 hours of a cancellation. If you've already captured the payment, refund it.

  • Mobile: set the return link the provider's SDK asks for, and show the order's status from your server when the app reopens, as Stripe's iOS guide advises.

  • Renewal retries: follow each decline code and Mastercard's merchant advice codes. Visa's rules allow up to 20 attempts in 30 days for declines that may later be approved.

Step 5: Decide Who Handles Refunds, Disputes and Payouts

When your business is the merchant of record, the business the customer pays, the provider moves the money and your product tracks payments and starts refunds. Finance and support handle exceptions, dispute decisions and payout reconciliation, so give each task an owner before launch:

Task

Provider

Your product

Finance/support

Refunds

Returns the money to the card or account

Starts refunds, tracks status, retries safely

Approves exceptions, answers customers

Disputes

Notifies you, debits the amount and a fee, forwards your evidence (cards)

Collects and sends evidence on time

Decides whether to contest

Failed renewals

Retries and updates cards, if you use its tools

Otherwise retries within the networks' rules, sets the grace period, tells the customer

Tracks recovered and lost renewals

Payouts

Pays out on a schedule, may hold funds

Records what each payout covers

Matches payouts to bank deposits

Fees and currency

Deducts fees, converts currency

Records fees per payment

Books fees and conversion

Reconciliation

Supplies reports and events

Keeps the record of each payment

Closes the books, chases gaps

Tax

Calculates and collects it through its tax tool, if you use one, where you've registered

Applies the right tax at checkout

Registers where you owe tax, then files and pays it, unless a filing service does

A merchant-of-record service changes this split. On a marketplace, the charge setup and who covers sellers' negative balances decide whether the platform or the seller carries refunds and disputes.

Handle Refunds and Disputes Through the Original Payment Provider

Handle refunds and disputes through the provider that took the payment, and track each one to its final status:

Reconcile Payouts and Reports With Your Records

Reconcile each payout by matching the bank deposit to its payments, refunds and fees, and run daily payment reconciliation against the provider's reports. It catches gaps such as an order you show as paid that the provider shows as refunded, or a dashboard refund that skipped your product's logic.

Post every payout, fee and refund to your accounting system against the provider's transaction ID. Whether you run QuickBooks, Xero or NetSuite, that ID lets your payment gateway integration put each item on the right sale.

Design for failed payouts too. In DBB's payout work for the live-streaming app, "A payout locked the creator's balance, withdrew the amount and sent a Stripe transfer. A failed transfer reversed the withdrawal."

Step 6: Test Payment Declines, Timeouts and Refunds, Then Go Live in Stages

Test your payment integration for declines, timeouts and refunds, then launch to a small group and widen only when approval rates, error rates and settlements look right.

What a Payment Sandbox Can't Show

A payment sandbox can't show live issuer decisions, settlement timing or the provider's full webhook retry schedule, so the staged launch has to. Before launch, trigger these failures on purpose, with the provider's test scenarios or your own setup for timeouts and missing webhooks:

  • declines and abandoned authentication;

  • timeouts, and duplicate or missing webhooks;

  • refunds and disputes;

  • a bank debit that fails late or is disputed after it succeeded.

Automate these tests, and rerun them before each payment release and provider upgrade. Keep them in the sandbox: Stripe's testing guide, for example, prohibits live-mode tests with real card details.

Set Up Fraud Checks and 3-D Secure Before Launch

Set up fraud checks and 3-D Secure rules in the provider's settings before launch, starting with protection against card testing, where fraudsters try stolen card numbers on your checkout. Stripe's card-testing guide covers the defenses, such as a CAPTCHA on payment requests and limits on the cards one account can add. Check which ones your provider's ready-made checkout already applies, and who owns the rest.

Switch to Live API Keys and Roll Out Payments in Stages

Before the first live payment, switch to live API keys and register the production webhook endpoint, as Stripe's go-live checklist sets out. Give the endpoint its own signing secret and finish the wallets' production setup. Then roll out by market, method or customer group, and follow the first real customer payments through confirmation and reconciliation before you widen.

Monitor Payments After Launch

After launch, set alerts on the signals that show money going wrong, each with a named owner:

  • approval rates and decline reasons by market and method;

  • webhook delivery failures and backlog;

  • payments stuck processing or waiting for authentication;

  • failed refunds, failed payouts and reconciliation gaps.

Keep card numbers out of your logs, and pin the provider's API version.

What Drives Payment Gateway Integration Cost and Timeline

Payment gateway integration cost depends on the type of integration, the build scope and the provider's fees on every payment, and a few outside steps set the timeline.

One-time costs cover the build, where a hosted page is quickest and a direct card API or a second provider takes longest. Each extra market, payment method, payout flow and connected system adds to it, and so does setting up the PCI scope.

Ongoing costs cover the provider's fees, app store fees on in-app digital goods, yearly PCI validation, API upkeep and your team's time on refunds, disputes and reconciliation. Most providers publish a blended rate: at Stripe's standard US rate of 2.9% + 30¢ for domestic cards, fees come to 5.9% of a $10 payment but 3.2% of a $100 one. Others pass the card networks' and banks' fees through and add a margin, as Adyen's pricing does.

Timeline dependencies your team can't speed up:

  • the provider's verification, from hours to several business days per step;

  • the wallets' production setup, such as Google's review before Google Pay goes live;

  • app store review: Apple typically reviews 90% of submissions within 48 hours, and Google Play can take up to 7 days or longer;

  • a card data transfer, if you switch providers with saved cards: the old provider's export alone can take months.

For scale, here's how long 2 DBB builds with payments took:

  • Choo Choo: the mobile-first rail-ticketing MVP launched on iOS and Android in 12 weeks. Its checkout now takes card, Apple Pay and Google Pay through Stripe.

  • Metechi: the commercial real estate finance app, with subscriptions billed through both app stores, launched on iOS and Android in about 3 months, built by one engineer.

If payments are one part of a larger build, our guide to what drives the cost of a whole fintech app covers the rest.

Payment Gateway Integration Checklist

A payment gateway integration is ready to launch when it passes these 12 checks:

Area

Ready when

Providers

They fit your product model and markets

Account

It's verified, the reserve terms are known, and test and live keys are kept apart

Exit terms

If you store cards, you know how card data leaves, the deadline to request it and how long the export can take

PCI scope

Your acquirer or provider has confirmed the validation and scans your card-data flow requires

Payment states

Fulfillment waits for each method's confirmed status

Retries

A retry or a timeout can't create a second charge

Webhooks

Events are verified, queued and processed once, and a scheduled check finds missing ones

Failed renewals

If you bill renewals, there's a retry plan, a customer message and an owner

Refunds and disputes

Each has an owner, a status and a deadline

Reconciliation

Each payout traces to its payments and fees, and reaches the accounting system

Testing

Declines, timeouts, duplicate events and a sandbox refund pass

Launch and alerts

A small group goes first, its first payments are followed through reconciliation, and each alert has an owner

When a Second Payment Provider Pays Off

Multiple payment gateway integration pays off when a second provider solves a measurable problem, such as weak coverage in a market or the sales you'd lose during an account suspension. Before adding one, estimate the margin it could add in an underserved market, or the sales you'd lose for each day your account was suspended. Compare that with the work of running and reconciling 2 providers, and name who will own it.

A second provider means another integration to maintain and more reports to reconcile, and it can't take over what the first one holds. Saved cards stay with the provider that took them unless a vault can send them to both, so failover helps new cards more than saved ones. Refunds still go through the original provider, and money it holds in a reserve stays under its terms.

Payment Orchestration vs a Payment Gateway, or Your Own Routing

A payment gateway connects you to one provider, while a payment orchestration platform sits between your product and several providers and routes each payment among them. For 2 providers and simple rules, a small payment routing layer in your own product is usually enough.

How to Switch Payment Processors and Protect Renewals

A payment processor migration keeps payments and renewals running when you run both providers in stages and keep the old account open for refunds and disputes. Whether you switch payment gateways for coverage, cost or account risk, the plan runs in this order:

  1. If you're transferring saved cards, request the export early: the old provider's export can take days to months, and Stripe's import guide says its imports typically complete within 10 business days of receiving valid data. Move direct debit mandates under each scheme's rules.

  2. Set a rollback trigger before any traffic moves, and watch at least the first payouts and one renewal cycle.

  3. Move new payments first, then stored cards in small batches: a new merchant account can see more declines at first, so Stripe recommends one-time payments before recurring ones. With a few dozen recurring customers, re-entering cards can be simpler than an export. When DBB moved Tie from Chargify to Salesbricks, a switch of billing platforms, billing continued without disruption. Its customers re-entered their payment details themselves, in batches of 3–5 a month, while the team watched how each batch went.

  4. Check each imported card before it renews: confirm that it belongs to the right customer, since a wrong match fails silently at the next renewal.

  5. Reconcile both providers daily during the overlap.

  6. Keep the old account open until its dispute windows close: disputes can arrive months later, and closing a Stripe account doesn't end your liability for them.

If the billing platform changes too, as it did for Tie, subscription plans and renewal dates move separately from saved cards, so plan that move on its own.

[Diagram placeholder: "A provider switch overlaps the old account for months". Replace this block with the diagram image, then type this caption under it as body text: "Dispute windows per Visa's rules (October 2026). Source: DBB Software, December 2026." The data, highlight and alt text are in payment-gateway-integration-short.md.]

Where to Start With Your Payment Integration

Where you start depends on the decision in front of you:

  • If this is your first integration: start with the money map, apply for the account while you build, and make the provider's confirmation, safe retries and daily reconciliation part of version one.

  • If you're adding a market or a second provider, put a number on what the second provider would add, and check whether your stored cards could move.

  • If you're switching providers with saved cards: request the card data transfer before you set a date.

DBB usually recommends using a provider to process payments and building the logic that tracks payment states, reconciles payouts and keeps a switch possible. If you'd like a team that has built payment flows like these to plan yours, see how DBB builds fintech and payment software.

FAQ

Markiian Reshetivskyi

Content Marketing Manager, Researcher