The short answer
Four habits make a payment integration last:
- Keep card data out of your systems with the provider's hosted page, hosted fields or tokenization, shrinking your security scope.
- Treat payment events as records: store every authorization, capture, refund and chargeback; process webhooks reliably.
- Reconcile daily across gateway, bank deposits and accounting or ERP.
- Add an internal payments layer so you can add methods or change providers without rewriting every system.
Integration patterns
Agree early on who does what (the terms are used loosely). Many providers bundle gateway, processing and merchant account in one contract: simpler, but harder to switch unless your integration is designed for it.
Who does what: gateway, processor, acquirer
| Role | What it does |
|---|---|
| Payment gateway | Securely captures payment details and passes transactions to be processed |
| Payment processor | Routes transactions through the card networks or payment systems |
| Acquirer (merchant bank) | Holds the merchant account and settles funds to you |
| Payment service provider or facilitator | Bundles several of these roles, often with simplified onboarding |
| Pattern | How it works | Effect on your security scope |
|---|---|---|
| Hosted payment page | Customer uses the provider's page | Smallest; card data never touches your servers |
| Hosted fields or embedded components | Provider-controlled fields inside your page | Small; your page scripts still need protection |
| Direct API with your own form | Your systems receive card data and send it on | Largest; you handle card data directly |
| In-person terminals | Card-present payments through certified terminals | Depends on setup and the link to your POS |
The PCI Data Security Standard applies to entities that store, process or transmit cardholder data, or that could affect the security of the cardholder data environment (PCI SSC). A hosted pattern does not remove your obligations but usually reduces them considerably; confirm the validation requirements that apply with your acquirer.
Designing for reliability
Payments fail untidily: timeouts, duplicate submissions, delayed notifications, partial captures. Build for it.
Idempotency keys
On every request, so a retried payment is never charged twice.
Verified webhooks
Check signatures, store, acknowledge fast, process later; handle duplicates and out-of-order events.
A state machine
Pending, authorized, captured, partly or fully refunded, disputed; moves only on confirmed events.
Status checks
After a timeout, ask the gateway for the real outcome instead of guessing.
Honest messages
Never tell customers a payment failed when its outcome is unknown.
Reconciliation and accounting
Checkout is the visible part; reconciliation is where problems surface.
- ImportSettlement reports from the gateway or acquirer, every day.
- MatchTo orders or invoices and bank deposits, with fees, refunds, chargebacks, currency.
- PostTo your ERP or accounting system automatically; exceptions go to finance.
- TraceThe gateway's transaction ID on every order, invoice and refund.
US payment methods and modernization
Organizations often need more than cards:
- PIN debit (in person)
- ACH debit or credit (recurring billing, some business payments)
- Wires (larger B2B payments)
Check which each provider supports and how funds and reports reach you. Real-time rails now run alongside ACH and wires, including the RTP network and the Federal Reserve's FedNow service, and ISO 20022 messaging is being adopted across wire and other systems. What your bank and customers can use varies, so check current availability. A payments layer makes new real-time options easier to adopt as they are offered.
Future-proofing with a payments layer
Have your website, apps, POS and billing call one thin internal service instead of the gateway. You get:
- One place to add methods or a second provider
- Consistent logging, reconciliation and reporting
- Routing by type, currency or amount
Switching providers also gets easier, especially if stored card tokens can be transferred: confirm that in the contract before you sign.
Example: a distributor with two gateways
A hypothetical distributor takes web store cards through one gateway, recurring payments through another, and invoices by check and bank transfer. It adds a payments service both gateways connect to, stores every payment event against the matching ERP invoice and imports daily settlement files for automatic matching. When it later adds a real-time bank payment option, only the payments service changes; the web store and ERP integration stay the same.
Integration checklist
Provider and scope
- Payment methods needed, by channel, listed
- Integration pattern chosen and security scope confirmed with the acquirer
- Token portability and exit terms checked in the contract
Reliability
- Idempotency, webhook verification and duplicate handling designed
- Payment state model defined, including partial refunds and disputes
Finance
- Settlement report format and import schedule agreed
- Matching rules, fees and chargebacks mapped to accounts
- Exception handling owned by finance
Future changes
- Internal payments layer scoped
- Regulatory questions (for example money transmitter rules) reviewed with advisers
Limitations
Provider features, fees and methods change often: check current documentation and contracts, not general comparisons. Connecting payments to an ERP, CRM or custom application is integration work; our business system integration service covers the design and build.
Sources and further reading
Product capabilities and guidance change. These are the primary sources this article relies on, checked on the review date above.
- PCI Data Security Standard (PCI DSS), PCI Security Standards Council
- Financial Crimes Enforcement Network (FinCEN), US Department of the Treasury
This article is general information, not legal, accounting or security advice for your specific situation. Examples are hypothetical unless stated otherwise.