EN
19.10.2026

Connecting a payment provider is a few days of work. The decisions around it — refunds, failures, reconciliation, security — are what determine whether it causes problems for years.

Accepting payment on a website is one of the few features that looks small and touches almost everything. The connection itself is straightforward and usually quick. What surrounds it — what happens when a payment half-succeeds, how refunds are issued, how the money is reconciled at month end — is where the real work sits.

Businesses that treat it as a technical integration find the technical part easy and the following six months difficult. This article covers the decisions worth making before the work starts.

Choosing a provider

The comparison is usually made on commission rate alone, which is the least important of the factors that will affect you.

FactorWhy it matters
Settlement timingWhen money actually reaches your account
Refund handlingPartial refunds, and how long they take
Failure reportingWhether you learn why a payment failed
Reconciliation dataMatching payouts to orders at month end
Recurring paymentsNeeded if you ever bill on a schedule
Support responsivenessMatters the day payments stop working
CommissionReal, but rarely the deciding difference

Settlement timing deserves particular attention because it is a cash flow question rather than a technical one. A provider that pays out weekly rather than daily changes how much working capital you need, and that difference frequently exceeds the commission gap that drove the choice.

Choose a payment provider the way you would choose a bank, not the way you would choose a library. You will be living with the operational consequences long after the integration is forgotten.

It is also worth checking what the provider requires of you before they will accept payments at all. Most need company registration documents, a description of what you sell, and published terms, refund and delivery pages on the site itself. These are ordinary requirements, but they take days rather than minutes to satisfy, and a project planned without them discovers at the end that the technical work finished a fortnight before the account was approved.

Hosted or embedded checkout

The second decision is whether the customer enters their card details on the provider's page or on yours.

A hosted page redirects the customer to the provider, who handles the card entirely. This is simpler to build, considerably reduces your security obligations, and costs some control over the experience — the customer sees a page that is not quite your site at the most sensitive moment of the transaction.

An embedded form keeps the customer on your site, with the card fields supplied by the provider inside your page. The experience is better, the build is more involved, and your obligations increase because the payment now happens within your own checkout flow.

For most businesses starting out, hosted is the right answer. The conversion difference is smaller than commonly claimed, and the reduction in security scope is substantial. Embedded is worth it when checkout volume is high enough that a small conversion improvement is worth the additional work and responsibility.

Card data: the rule that has no exceptions

Full card numbers never touch your servers, are never written to your logs, and are never stored in your database.

This is not a recommendation. Storing card data brings a set of compliance obligations that no ordinary business wants, and a breach involving card numbers is a different category of incident from a breach involving names and addresses.

Every modern provider offers a token: a reference that lets you charge the same card again without ever holding the number. For saved cards and repeat billing, that token is what you store, and it is worthless to anyone who steals it.

Worth checking one detail specifically: that card numbers cannot appear in your error logs. A failed request logged with its full body is the most common way this rule gets broken accidentally.

Two further considerations belong with that choice. Most customers now pay on a phone, so whichever route you take must work properly on a small screen with an intermittent connection, which rules out any flow that assumes the browser stays open and connected throughout. And if you sell abroad, the payment methods customers expect differ by market: an option that is standard in one country is unknown in another, and offering only cards will quietly lose sales you never see.

The states a payment can be in

The single most common source of payment bugs is treating payment as a two-state affair. It is not.

  1. Initiated — the customer has started but not completed
  2. Pending — submitted, awaiting confirmation
  3. Succeeded — money confirmed
  4. Failed — declined, with a reason
  5. Refunded, wholly or partly
  6. Disputed — the customer has challenged it with their bank

Each state needs defined behaviour. What does the customer see? Is stock reserved? Does the order exist? Does anyone get notified? Skipping these questions produces the familiar failure where a customer is charged but no order appears, or an order is created and never paid for.

The pending state causes the most trouble because it can persist. A payment awaiting confirmation for two hours must not leave the customer staring at a spinner, and must not be quietly treated as failed while the money is in fact moving.

Notifications, and why they arrive twice

Providers confirm payments by sending a notification to your server, and this is the mechanism that determines whether your order records stay correct.

Two properties are essential. The notification must be verified, so that only the provider can tell you a payment succeeded. And processing must be idempotent, meaning that receiving the same notification twice produces the same result as receiving it once.

That second point is not theoretical. Providers routinely retry notifications, and a system that creates an order each time will produce duplicates at exactly the moment you least want them. Recording the notification identifier and ignoring repeats is a few lines of code that prevents a whole class of problem.

Never rely on the customer returning to your success page as confirmation. They close the tab, lose signal, or navigate away, and the payment succeeds regardless.

Failed payments deserve a plan of their own rather than an error message. A decline is frequently temporary — a limit reached, a bank check, a mistyped digit — and a customer who is told clearly what happened and invited to try another method completes the purchase more often than one who sees a generic failure and leaves. Keeping the basket intact and the order recoverable is a small piece of work that pays for itself quickly.

Refunds are part of the build

Refunds are consistently left out of the initial scope and consistently needed within the first month.

Decide who may issue one, up to what value without approval, and whether partial refunds are supported. Decide what happens to the order and to stock when a refund is issued. And make it possible from your own admin, because a process that requires logging into the provider's dashboard will produce refunds nobody records.

The record matters as much as the money. A refund issued outside your system is invisible to your reporting, and it will surface as an unexplained discrepancy at month end.

Reconciliation: the part nobody plans for

At the end of each month, the money that arrived in your bank account must match the orders in your system, and it never does on the first attempt.

The gaps come from commission deducted before payout, refunds processed in a different period, payments that succeeded after the order was cancelled, and disputes. None of these are errors; they are ordinary differences that someone has to explain.

Making this easy is mostly a matter of recording the provider's transaction identifier against every order, so that any line in a payout report can be traced back to what it was for. Without that, reconciliation is a manual exercise every month, and it is the cost nobody includes in the estimate.

The same discipline applies here as in any system-to-system connection, which we cover more broadly in our article on integrating your systems.

Before going live

Test the unhappy paths, not the happy one. A successful payment on a test card proves very little.

Test a declined card, a payment abandoned at the provider's page, a notification that arrives twice, a notification that arrives after the customer has already left, a partial refund, and a payment that succeeds while your own server is unreachable. Each of these will happen in the first month, and each has a right answer that is easier to build now than to repair later.

In summary

Online payments are an operational commitment rather than a feature. Choose the provider on settlement and support rather than commission, prefer a hosted page unless volume justifies otherwise, never store card numbers, handle all six payment states, verify and de-duplicate notifications, build refunds from the start, and record the transaction reference so reconciliation is possible.

You can see our approach to payment and checkout systems, e-commerce platform development and the wider automation and integrations area on the service pages. If you would like your own payment flow reviewed first, request a free consultation.