Payment Gateway Integration Cost: The Integration Is Not the Cost, the States Are

14 min read
Payment Gateway Integration Cost: The Integration Is Not the Cost, the States Are

You have decided you need to take payments. The question is what it costs in engineering time, and what it keeps costing after launch.

Published figures, read 2026-11-11: one development firm puts a basic custom integration at $5,000 to $15,000 and a complex one with split payments, recurring billing and multi-currency at $20,000 to $50,000 or more, estimating 100 to 300 development hours and four to twelve weeks. Another gives $5,000 to $30,000 for a standard integration and $50,000 to $200,000 and up across several processors, plus ongoing security and compliance maintenance at about 15 to 20 per cent of integration cost a year.

At our published band of $40 to $100 an hour by role, blending to $60 to $70 for a mixed team, that 100 to 300 hour figure is $6,000 to $21,000. The arithmetic is simple. The reason the published ranges span forty times is not.

Here is what the ranges are actually measuring, and what nobody quoting you will name: the integration is not the cost, the states are. Calling a provider's API and getting a successful charge back is a few days of work for a competent developer. Everything after that is the project.

Three questions set the price. Do you capture money at a different moment from when you authorise it? Can an order be partly fulfilled, partly refunded, or both? And do you need more than one currency or more than one provider? If the answer to all three is no, you want the hosted checkout described on our ecommerce app development page and little else.

The integration is a week, the states are the project

Integrating a payment gateway takes days. The cost is the states around it: authorisation, capture, partial capture, refund, partial refund, chargeback and reconciliation, plus a webhook that may arrive twice or never. Budget for a payment state machine you own and can replay, not for the API call.

Count the states a real product has to represent. A payment can be initiated, authorised, partly captured, fully captured, failed, expired before capture, refunded in part, refunded in full, disputed, disputed and won, disputed and lost, reversed, or stuck in a provider state you have never seen. Most can also arrive out of order.

That is not a status column. It is a state machine with money attached. The most expensive shortcut in this category is orders.payment_status, a string with four values, set by whichever code path ran last. It works until the first partial refund, then it is wrong in a way that takes a finance person weeks to unpick.

If you only remember one thing: the provider is authoritative on whether money moved, and you are authoritative on what your product did about it. Those are different questions, and the gap between them is where "payment succeeded but no order was created" lives.

Authorisation and capture are two events, and the gap is where money goes missing

Authorisation asks the card issuer to reserve funds. Capture tells it to move them. They can be the same API call, or they can be days apart, and that choice is a product decision with engineering consequences.

Immediate capture is right for anything delivered instantly: software, a subscription, a download. Authorise and capture in one call and the state machine is shorter by several branches.

Delayed capture is right for anything physical. You authorise when the customer orders and capture when you ship, which is standard practice in the retail flows our retail software development page covers. It introduces an obligation nobody budgets for: something has to watch the authorisations.

An authorisation does not last forever. How long depends on the card network, the provider and sometimes the issuing bank, and it is not a constant you can put in a config file and forget. Get the window for your provider and your methods in writing, then design to the shortest one. The failure it prevents is specific: you shipped goods against an authorisation that has since expired, nobody noticed, and the capture fails against a reservation that no longer exists.

So the authorisation state needs a deadline and an alarm. Scheduled work, a queue and an operational report, which is a day or two of engineering and a permanent responsibility, and the most common thing missing from a cheap integration quote.

Decide in advance what happens when a capture fails: retry on a schedule, ask for a new payment method, cancel, or ship anyway and chase. All four are valid. Choosing after the first occurrence is how products acquire a permanent manual spreadsheet.

Partial capture and partial refund break the one-payment-one-order assumption

A $100 order ships in two boxes a week apart. You capture $60, then $40. Or the second item is out of stock, so you capture $60 and release the rest. Any product with physical fulfilment hits this, which is why our ecommerce app development cost post treats payments and order state as one problem.

Whether you can do that at all is a provider capability, not a design choice. Some providers support several partial captures against one authorisation, some exactly one, some none. Confirm it before you design your order model, because the answer changes the model. It is the most useful question to ask during provider evaluation, and almost nobody asks it.

Refunds are worse, because they accumulate. Refund $20, then $15, then the customer disputes the remaining $65. How much of this payment is still refundable is a question you must answer from your own records, under a lock, in your own transaction. A sum assembled by fetching provider objects over an API is not a number you can lock, nor one you can answer with when the provider is down.

A refund is not the reverse of a payment, and it is not free. Stripe's pricing page, read 2026-11-11, states plainly that "The payment processing, Connect and currency conversion fees from the original transaction are not returned." Read that as a margin line, not a footnote: a business with a 20 per cent return rate pays the processing fee twice on a fifth of its revenue.

What this means for your schema: a payment is not a column on an order. It is its own object with children. Captures, refunds and disputes each get a row carrying its own provider identifier, amount, currency and state. Store amounts as integers in the currency's minor unit. Not floats. Too obvious to write down, and still the commonest bug in the category.

A diagram of a payment state machine showing authorisation, partial and full capture, partial and full refund, dispute and reversal as distinct rows under one payment object, with provider events moving the states.

The webhook arrives twice, or never

Everything asynchronous about payments reaches you as a webhook, and the providers are honest about what that guarantees. Stripe's webhook documentation, read 2026-11-11, says so directly.

Stripe's documentation is explicit on four points. An endpoint "might occasionally receive the same event more than once", so it advises logging the event IDs you have processed and skipping repeats. Delivery order is not guaranteed, and it warns against using created to infer order or to decide whether an event is already handled. Failed deliveries retry with exponential backoff for up to three days in live mode. And the endpoint must return a 2xx status before any logic slow enough to time out.

That is four separate pieces of engineering, and they are the reason a payments integration is not a week.

An event log table, written first. Keyed on the provider's event ID with a uniqueness constraint. You insert the event, then you act. A repeat delivery hits the constraint and becomes a no-op. Five lines of schema that prevent the worst bug in the category, which is shipping or refunding twice because a webhook was redelivered.

An asynchronous worker. Your endpoint verifies the signature, writes the event, returns 200. Fulfilment runs somewhere else. A handler doing real work inside the HTTP request will time out under load, the provider will retry, and you will process the same event three times while believing you processed it once.

Guarded transitions, because events arrive out of order. A "payment succeeded" event arriving after a "refund created" must not resurrect the payment. Every transition has to be legal from the state you are actually in, not the state the event assumes. Hence your own state machine rather than a column you overwrite.

A reconciler, because "never" is a real outcome. A three-day retry window means a weekend outage can hand you a thousand events at once, or drop ones you never see. So you need a scheduled job pulling the provider's own record for anything your side still thinks is unresolved, in the statement-and-variance shape our royalty management software cost post describes. Build it in week one.

And verify the events are real. Stripe's documentation is blunt: without verification, "an attacker could send fake webhook events to your endpoint to trigger actions like fulfilling orders, granting account access or modifying records." Signature verification and an IP allowlist, both.

Idempotency is a key, a store and a retry policy

Idempotency means sending the same request twice has the same effect as sending it once. In payments it is what stands between a flaky mobile connection and a double charge.

Stripe's idempotency documentation, read 2026-11-11, gives the mechanics. The client generates the key, with V4 UUIDs suggested, and the guidance is to "Avoid using sensitive data (for example, email addresses or personal identifiers) as idempotency keys." The saved response is returned on a retry with the same key, and the layer "compares incoming parameters to those of the original request and errors if they're not the same to prevent accidental misuse."

Then there is the line that matters commercially, and it is easy to skim past. For the v1 API, keys can be removed automatically "after they're at least 24 hours old", and, in the documentation's own words, "We generate a new request if a key is reused after the original is pruned."

Read that against a retry queue with exponential backoff. If your retry policy can still be retrying a payment creation more than twenty-four hours after the first attempt, your key has expired and the retry is a fresh charge. Your retry policy and the provider's key lifetime have to be set against each other deliberately. You find this in a support ticket about a customer charged twice a day later.

The key must come from your own record, not the call site. Generate it once when you create the payment attempt, store it there, and reuse it on every retry of that attempt. A key generated inside the retry loop is not an idempotency key. It is a fresh request wearing one.

Your own endpoints need the same treatment. A customer double-tapping a pay button on a slow connection creates two payment attempts, and the provider's key does not protect you, because the two attempts carry different keys. The fix is one level up: a uniqueness constraint permitting one open payment attempt per order, or a client-generated attempt identifier the browser reuses across submissions.

Why you store your own payment state instead of asking the provider

The tempting shortcut is to keep nothing and query the provider when you need to know. Less code on day one, and it fails on three counts.

You cannot take a lock on somebody else's API. Deciding whether to allow a refund means reading a balance and writing a decision atomically. That is a transaction in your database, and it needs the numbers in your database.

The provider is a dependency with a rate limit and an outage. Your order page cannot be down because their API is, and your support team cannot be unable to answer a customer because a third party is having a bad hour.

You will leave this provider, or add another. The only durable record of what your product did is the one you kept. A payment history that exists only in a provider's dashboard is one you are renting.

And store the raw payload. Every event body, as received, in a column nobody reads. It costs almost nothing, and every reconciliation you ever run will want the field you threw away.

If what you are building is itself a financial product, with a general ledger, balances held for users, lending or a wallet, that is a different and much larger build. Our fintech and banking software development page covers that territory and our fintech app development cost post prices it. Taking card payments for a product you sell is the smaller problem described here, and the two get conflated in quotes, usually upwards.

How long does payment gateway integration take?

Taking a card through a hosted checkout page and receiving a success event takes a few days. The full state model, with capture handling, partial refunds, idempotency, a webhook event log and a reconciler, takes weeks. Published estimates read 2026-11-11 give four to six weeks for a basic integration and eight to twelve for a complex one.

Days. A provider-hosted page, one currency, immediate capture, one webhook handler, a success and a failure screen. A real option, and for some products the right one.

Weeks. The state machine, the event log, idempotency from your own attempt records, a refund ledger, delayed capture with expiry monitoring, and the reconciler. This is what the published 100 to 300 hour figure measures, and the tier most products need before taking money at volume.

Permanent. Reconciliation, dispute responses, provider API upgrades, new payment methods, and regulatory change. The 15 to 20 per cent a year figure circulating in vendor estimates is a reasonable planning number for what is an operational commitment rather than a project.

Products with a spiky payment load have a fourth problem, which is what happens when payments fail at the worst possible moment. Our event ticketing app development cost post covers that case, and a sale completing while a payment is still authorising is covered in our auction app development cost post.

An invitation to discuss payment integration scoping with the Zyneto team.

Do I need PCI compliance if I never touch card data?

Yes, but the smallest version of it. If a compliant provider handles all card data and your own systems never store, process or transmit it, you qualify for PCI DSS Self-Assessment Questionnaire A, the shortest one. What it spares you is defined in that document rather than left to opinion.

The PCI Security Standards Council's Self-Assessment Questionnaire A, version 4.0 revision 2, July 2023, read directly on 2026-11-11, covers merchants who have outsourced all account data functions to a validated compliant third party and keep only paper records. Its criteria require card-not-present transactions only, no electronic storage, processing or transmission of account data on your own systems, and a review of the provider's Attestation of Compliance. For e-commerce there is one more, quoted exactly because it is the one people get wrong: "All elements of the payment page(s)/form(s) delivered to the customer's browser originate only and directly from a PCI DSS compliant TPSP/payment processor."

Now the part almost nobody tells you, and it is in the same document. A note under those criteria states that the requirements protecting computer systems, naming Requirements 2, 6, 8 and 11 as examples, still apply to merchants who redirect customers to a provider for payment, and to those embedding a provider's payment form in an iframe. Such sites "impact how the account data is transmitted, even though the websites themselves do not receive account data."

So the server holding your redirect, or serving the page your provider's iframe sits inside, is in scope. Not for card storage, but for secure configuration, patching, access control and vulnerability testing. Invisible in most integration quotes.

There is an architectural lever here. The same document says merchants with no redirect and no embedded form, and therefore no systems in scope, may treat those requirements as not applicable. A full redirect is the smallest scope available. An iframe is larger. Collecting the card in your own fields is a different questionnaire and a different budget.

And treat "we never touch card data" as an architectural commitment, not a policy. The moment anyone adds a card number field to a support form, or logs a request body containing one, the scope changes and the attestation you signed is no longer true.

Multi-currency and a second provider are not configuration

Both of these get described as settings. Both change the data model.

Multi-currency means three numbers for one payment. The currency you presented to the customer, the currency the provider settles to you in, and the currency your accounts are kept in. All three, plus the rate and the moment it applied, stored on the payment. And you have to decide whether a refund six months later goes out at the original rate or today's, because one costs you money and the other annoys the customer. No provider decides it for you. Products selling across borders, like the travel platforms our travel software development page covers, hit this on day one.

Providers price in different shapes, and the shape is what you reconcile against. Two examples, read 2026-11-11 and re-read 2026-11-13, chosen because their models differ rather than as recommendations. Adyen's pricing page describes its fee as "a fixed processing fee + a fee determined by the payment method", listing a $0.13 processing fee with Interchange++ on top for some card methods, so the fee arrives decomposed. Stripe's pricing page presents a per-transaction rate per card type with an additional charge where currency conversion is required, so the fee arrives blended. A decomposed fee cannot be reconstructed from a blended statement. If your finance team needs interchange visibility, that is a provider selection criterion, not something you add later.

A second provider means you own the abstraction. Two providers do not share a state vocabulary, so mapping one onto the other is a translation layer with its own bugs. You also acquire routing rules, by currency, method, cost or failover, with their own test matrix. And reconciliation doubles: two settlement files, two fee shapes, two dispute processes, two API version timelines.

Do it when you have a reason. Failover for a business that cannot stop taking money, a market one provider does not serve, or a locally important method. Not on day one because it seems prudent. Marketplaces splitting a payment between sellers are the common exception, and our multi-vendor marketplace development post covers why that case pushes you towards one provider's native split facility.

A chart comparing what a blended statement and a decomposed statement each let you read, showing that the total is visible on both while the processing fee, the payment-method component and cost by card type are visible only on the decomposed one.

What this costs, in the first year and after it

Our rate band is published: $40 to $100 an hour by role, blending to $60 to $70 for a mixed team. The assumptions behind the number below: roles from that published band, time and materials rather than fixed price, and a provider with current documentation and a working sandbox. How the band is composed is covered in our offshore software development company post.

Against the published 100 to 300 hour range for a complete integration, read 2026-11-11, the blended arithmetic gives $6,000 to $21,000. The low end buys the hosted page and the happy path. The high end buys the state machine, the event log, idempotency, the refund ledger and the reconciler. The gap between those numbers is not features. It is whether the thing is correct when something goes wrong.

An invitation to start a scoping conversation about payment integration work.

Three cost lines sit outside that and get left out of quotes. PCI scope on your own servers, meaning secure configuration, patching, access control and vulnerability testing on whatever hosts the redirect or the iframe. Dispute handling, because someone has to gather evidence and respond within a deadline every month. And provider API version upgrades, which arrive on the provider's schedule and which you budget the way you budget dependency upgrades elsewhere, as our saas development cost post describes.

What to build first, in order: the payment object with its own states and children; the webhook event log keyed on the provider's event ID; idempotency keys generated once and stored on your attempt record; the refund ledger; then the reconciler. The checkout screen comes last and takes an afternoon. Our MVP development post makes the general case for that order.

We do not quote a fixed total before a discovery that settles the three questions above: capture timing, partial fulfilment and refunds, and how many currencies and providers you need. What we will say for nothing is that if you only ever take one full payment for one whole order in one currency, delivered instantly, you are in the cheapest version of this product and you should buy the hosted page and move on. Every state above is one to add when the business actually has it, and not before.

Frequently asked questions

Published estimates read 2026-11-11 put a basic custom integration at $5,000 to $15,000 and a complex one with split payments, recurring billing and multi-currency at $20,000 to $50,000 or more, on 100 to 300 development hours. At our published band of $40 to $100 an hour by role, blending to $60 to $70, that hour range is $6,000 to $21,000. The variable that moves the total is not the provider you choose. It is whether you capture money at a different moment from authorising it, whether orders can be partly fulfilled or partly refunded, and how many currencies and providers you need.

A provider-hosted checkout page with immediate capture and one webhook handler takes a few days. The full state model, with delayed capture and expiry monitoring, partial refunds, idempotency, a webhook event log and a reconciliation job, takes weeks. Published figures read 2026-11-11 give four to six weeks for a basic integration and eight to twelve for a complex one, with two to four weeks for a standard single-provider case. Reconciliation, dispute responses and provider API upgrades then continue indefinitely, and vendor estimates commonly plan for 15 to 20 per cent of the integration cost per year.

Authorisation asks the card issuer to reserve funds. Capture tells it to move them. They can happen in one API call, which suits anything delivered instantly, or days apart, which suits anything physical where you charge on shipment. The gap is where money goes missing, because an authorisation expires after a window that depends on the card network, the provider and sometimes the issuing bank. If you use delayed capture, something has to monitor pending authorisations and alert before they lapse, which is scheduled work plus a report and a permanent operational responsibility.

Because a retried request must not charge the customer twice. An idempotency key is a unique value you send with a payment request so the provider recognises a retry and returns the saved response instead of creating a second charge. Two details decide whether it works. The key has to be generated once and stored on your payment attempt, then reused on every retry of that attempt, rather than generated inside the retry loop. And Stripe's documentation, read 2026-11-11, notes that keys may be removed automatically once they are at least twenty-four hours old, with a new request generated if a pruned key is reused, so your retry window and the provider's key lifetime must be set against each other.

You find out from a reconciliation job, or you find out from the customer. Stripe's documentation, read 2026-11-11, states that it attempts delivery for up to three days with exponential backoff in live mode, that events are not guaranteed to arrive in the order they were generated, and that an endpoint "might occasionally receive the same event more than once". So you need three things: an event log keyed on the provider's event ID so a duplicate is a no-op, guarded state transitions so a late event cannot undo a newer one, and a scheduled reconciler that pulls the provider's own record for anything your side still thinks is unresolved.

Yes, but the smallest version of it. PCI DSS v4.0 SAQ A, revision 2 dated July 2023, applies to merchants with account data functions completely outsourced to compliant third parties, who accept only card-not-present transactions and do not electronically store, process or transmit account data on their own systems. The part most people miss is in the same document: requirements covering the protection of computer systems, Requirements 2, 6, 8 and 11 among them, still apply to merchants who redirect customers to a provider or who embed a provider's payment form in an iframe, because those sites affect how account data is transmitted. A full redirect with no embedded form gives the smallest scope available. One thing to check against the current revision: SAQ A r1 under PCI DSS v4.0.1, which the Council published in January 2025 and made effective on 1 April 2025, moved requirements 6.4.3, 11.6.1 and 12.3.1 out of the questionnaire and added an eligibility criterion instead. In the Council's wording the merchant has to confirm that their site "is not susceptible to attacks from scripts", and the criterion reaches scripts that could affect the merchant's e-commerce systems. The underlying controls did not go away, so budget for them either way.

Only with a reason, because the second provider costs more than the first in proportion. Two providers do not share a state vocabulary, so you have to own an abstraction layer and a translation with its own bugs, plus routing rules by currency, method, cost or failover, and double the reconciliation: two settlement files, two fee shapes, two dispute processes, two API version timelines. Good reasons exist, including failover for a business that cannot stop taking money, a market one provider does not serve, and a locally important payment method. Prudence on day one is not one of them.

Vikas Choudhary

Vikas Choudhary

Vikas has around fifteen years of experience building software and now builds generative AI systems at Zyneto. His work covers retrieval augmented generation, agentic AI, knowledge graphs, AI memory, and the evaluation and guardrails that decide whether any of it is safe to put in front of customers. He has shipped enterprise copilots, document AI, chatbots and predictive analytics for e-commerce, fintech and marketing teams, and works day to day in Python, JavaScript and SQL. He follows multimodal models, business process automation and enterprise AI security closely, and mentors engineers moving into AI. He writes about architecture, inference cost and the failure modes that only show up at production scale.

Zyneto builds custom software, AI and automation

Tell us what you are building and we will reply with a clear next step.

Phone

We reply to every enquiry within one business day.

WhatsApp
Email
Book a Meeting