Every time a customer clicks "Pay Now," a chain of events fires behind the scenes. That chain—the payment workflow—determines whether the transaction succeeds, how long it takes, and what happens when something breaks. Yet many teams build their first payment integration by copying a quickstart example and never revisit the design. The result? Silent failures, double charges, and reconciliation nightmares.
This guide is for developers and product leads who want to compare payment workflow patterns before committing to one. We’ll look at the real-world trade-offs between synchronous and asynchronous flows, single-provider and multi-provider strategies, and how to handle edge cases that documentation often skips.
Who needs this and what goes wrong without it
If you’re building a payment system from scratch or migrating to a new processor, the workflow design you choose will ripple through every downstream system: accounting, fraud detection, customer support, and analytics. Teams that skip the comparison step often end up with workflows that work for the happy path but fail on day-one edge cases.
Consider a typical subscription service. The team implements a synchronous capture at checkout—charge the card immediately. That works fine for most customers. But what about a user whose card is declined due to a temporary bank hold? The synchronous flow returns an error, the user sees a failure message, and they might give up. An async flow that retries the charge later could salvage that sale. Without comparing these patterns, the team locks in a design that loses revenue.
Another common problem: reconciliation mismatches. A workflow that captures funds immediately but settles in batches can create a gap between your internal records and the processor’s statements. If you haven’t designed for that mismatch, your finance team spends hours each month hunting for phantom discrepancies. We’ve seen companies write off thousands of dollars in fees simply because their workflow didn’t align with the processor’s settlement cycle.
Then there’s the silent failure. A payment attempt times out, but the workflow treats it as a decline. The customer retries, and both attempts eventually succeed, resulting in a double charge. Without idempotency keys and proper timeout handling, this scenario is distressingly common. A well-compared workflow design anticipates these failures and builds in retry logic with idempotency from day one.
Who benefits most from reading this? Developers who own the payment integration, product managers deciding on checkout flows, and technical leads evaluating payment providers. If you’ve ever wondered why your payment success rate is lower than expected or why reconciliation takes forever, this comparison will give you the vocabulary and patterns to diagnose and fix it.
Prerequisites and context readers should settle first
Before diving into workflow patterns, you need a clear picture of your business model and constraints. The right workflow for a high-volume SaaS platform is different from the right one for a low-volume luxury goods store. Start by answering these questions:
What’s your transaction volume and value?
If you process thousands of transactions per minute, you need a workflow that minimizes latency and can handle retries without blocking. High-volume systems often prefer async flows to avoid timeouts. Low-volume, high-value transactions (like B2B invoices) might prioritize reliability over speed, using synchronous flows with manual review for failures.
What’s your refund and chargeback pattern?
Businesses with frequent refunds need a workflow that supports partial captures and voiding authorizations. For example, a hotel that charges a deposit at booking and the remainder at checkout needs a multi-step capture workflow. If you only ever do a single full capture, you can use a simpler design.
Are you using one provider or multiple?
Multi-provider setups add complexity: you need a routing layer, fallback logic, and separate reconciliation for each provider. But they also reduce downtime risk and can lower costs through competitive routing. Single-provider workflows are simpler but create a single point of failure. We’ll compare both later.
What’s your tolerance for latency?
Some workflows block the user until the payment is confirmed (synchronous). Others confirm the order immediately and process the payment in the background (async). For digital goods like software licenses, async is usually fine. For physical goods with limited inventory, you might want synchronous capture to reserve stock. Know your latency budget before you choose.
What compliance requirements apply?
PCI DSS, PSD2, and regional regulations affect workflow design. For example, PSD2’s Strong Customer Authentication (SCA) requires redirecting the user to their bank for verification, which forces a synchronous flow with a redirect step. If you’re building for Europe, your workflow must accommodate that. Similarly, storing card data requires PCI compliance, which may rule out certain local processing patterns.
Once you have these answers, you can evaluate the core workflow patterns with context. Without them, you’re choosing blindly.
Core workflow: sequential steps in prose
Every payment workflow, no matter how complex, follows a sequence of five core steps: authorization, capture, settlement, reconciliation, and reporting. Let’s walk through each in a typical synchronous flow, then note where async differs.
Authorization
The customer submits payment details. The system sends a request to the processor to reserve the funds. The processor contacts the issuing bank, which checks for fraud and sufficient balance. If approved, the bank places a hold on the funds and returns an authorization code. This step is nearly always synchronous—you need the result to proceed.
Capture
Once the order is confirmed (e.g., inventory allocated, fraud checks passed), the system requests capture of the authorized amount. Capture can be immediate or delayed. In a synchronous flow, capture happens right after authorization. In an async flow, you might authorize at checkout and capture later (e.g., when the item ships). Delayed capture gives you flexibility but risks the authorization expiring (typically 7–30 days depending on card scheme).
Settlement
The processor batches captured transactions and sends them to the card networks for settlement. Funds move from the issuing bank to the acquiring bank. Settlement is always asynchronous from your perspective—it happens on a schedule (often daily) and can take 1–3 business days. Your workflow should not depend on settlement timing for order fulfillment.
Reconciliation
Your system matches internal transaction records against the processor’s settlement report. This step is often manual or semi-automated. A well-designed workflow produces a unique identifier for each transaction that appears in both your logs and the processor’s report, making reconciliation straightforward. Without that, you’re guessing.
Reporting
Finally, the workflow updates dashboards, sends receipts, and triggers downstream actions (e.g., accounting entries). Reporting is often overlooked in workflow design, but it’s where most operational pain surfaces. If your workflow doesn’t log the right data (e.g., processor response codes, timestamps, IP addresses), you’ll struggle to diagnose failures later.
In an async flow, authorization and capture are split by a delay. The order is confirmed immediately after authorization, and capture happens later—sometimes hours or days. This pattern is common for subscription billing, where you authorize at signup but capture each billing cycle. The risk is that the authorization expires before capture, so you need a retry mechanism or a re-authorization step.
Tools, setup, and environment realities
Choosing the right tools for your workflow is as important as the workflow itself. Here are the key components you’ll need to set up, along with common pitfalls.
Payment gateway vs. processor vs. orchestrator
A gateway handles the front-end integration (hosted checkout, tokenization). A processor handles the back-end (authorization, capture, settlement). An orchestrator sits between them, routing transactions to multiple processors. If you’re using a single processor, you might not need an orchestrator. But if you have multiple processors, an orchestrator simplifies routing and fallback logic. Popular orchestrators include Spreedly and Zooz, but you can also build your own.
Webhooks and callbacks
Most processors send webhooks for async events (e.g., settlement completed, chargeback filed). Your workflow must handle these reliably. That means idempotent webhook processing (using a unique event ID), retry logic, and a dead-letter queue for failed events. Many teams underestimate the volume of webhooks—during peak hours, you might receive thousands per minute. Test your webhook handler under load.
Idempotency keys
Every payment request should include an idempotency key (a unique string generated by your system). If the request times out, you can retry with the same key, and the processor will return the original result instead of charging again. This is non-negotiable for any workflow that involves network calls. Without it, retries cause double charges.
Test environment
Set up a sandbox that mirrors your production workflow. Use test card numbers that simulate different outcomes: approval, decline, timeout, 3D Secure challenge. Automate tests for each failure mode. Don’t assume the happy path will hold—your workflow will break on edge cases, and the test environment is where you catch them.
Monitoring and alerting
Track key metrics: authorization success rate, capture rate, settlement lag, and webhook processing latency. Set alerts for anomalies, like a sudden drop in success rate or a spike in timeouts. Without monitoring, you won’t know your workflow is failing until customers complain.
Variations for different constraints
No single workflow fits all businesses. Here are three common variations, each suited to different constraints.
Single-provider synchronous flow
Best for: low volume, simple products, one region. You authorize and capture in one synchronous call. The user waits for confirmation. This is the simplest to implement and debug. But it has no fallback—if the provider is down, you can’t process payments. It also doesn’t handle delayed capture scenarios well.
Multi-provider async flow with fallback
Best for: high volume, multiple regions, critical uptime. You authorize with a primary provider, but if it fails (timeout or error), you route to a secondary provider. Capture happens asynchronously after order fulfillment. This requires an orchestrator and careful reconciliation across providers. The trade-off is complexity: you need to handle different response formats, settlement schedules, and fee structures.
Hybrid flow with local processing
Best for: businesses operating in countries with local payment methods (e.g., iDEAL in Netherlands, Boleto in Brazil). You use a local processor for region-specific methods and a global processor for cards. The workflow must route based on payment method and currency. This adds complexity but increases conversion rates in those markets.
When choosing a variation, consider your tolerance for complexity. A single-provider flow is easy to start with but hard to scale. A multi-provider flow is resilient but requires a dedicated team to maintain. Many businesses start with one provider and add a second only after experiencing downtime.
Pitfalls, debugging, and what to check when it fails
Even the best-designed workflow will encounter failures. Here are the most common pitfalls and how to debug them.
Silent failures
A payment attempt times out, but your system logs it as a decline. The customer retries, and both attempts succeed later. The result: double charge. To catch this, log every request with a unique idempotency key and compare the response status against the expected outcome. If you see a timeout, don’t treat it as a decline—treat it as unknown and investigate.
Authorization expiry
You authorize at checkout but capture days later. The authorization expires, and the capture fails. Your order is fulfilled but unpaid. To prevent this, capture within the authorization window (usually 7 days for Visa, 30 for Mastercard) or re-authorize before capture. Set alerts for capture attempts that are close to the expiry.
Reconciliation mismatches
Your internal records show a transaction as captured, but the processor’s settlement report doesn’t include it. This often happens when the capture request succeeds but the settlement batch fails. Check the processor’s settlement report daily and flag any transaction that appears in your system but not in the report. Use the processor’s transaction ID as the reconciliation key.
Webhook delivery failures
Your webhook endpoint is down, and the processor retries a few times then gives up. You miss a chargeback notification. To avoid this, implement a webhook health check and use a queue that can retry with exponential backoff. Also, maintain a fallback polling mechanism—periodically fetch the latest events from the processor’s API.
FAQ or checklist in prose
Here are the most common questions teams ask when designing payment workflows, answered in plain terms.
Should I authorize and capture together or separately? Separate if you need to delay capture (e.g., for physical goods that ship later). Together is simpler and works for digital goods or immediate delivery. The trade-off is flexibility vs. complexity.
How do I handle retries without double charging? Use idempotency keys. Generate a unique key per payment attempt and include it in every request. If you retry, send the same key. The processor will return the original result.
What’s the best way to handle 3D Secure? 3D Secure requires a redirect to the customer’s bank for authentication. Your workflow must support a redirect step and handle the callback. Use a gateway that manages the redirect flow for you, or implement it yourself with careful state management.
How many providers should I use? Start with one. Add a second only if you experience downtime or need a specific payment method. Multi-provider setups increase complexity significantly.
What should I monitor? Authorization success rate, capture rate, settlement lag, webhook processing time, and error rates by type (timeout, decline, chargeback). Set alerts for deviations from baseline.
How do I reconcile across multiple processors? Use a unified transaction ID that maps to each processor’s transaction ID. Store the mapping in your database. When reconciling, match your internal ID to the processor’s report. Automate as much as possible.
What to do next (specific)
Now that you’ve seen the landscape, here are concrete next steps to apply this to your own system.
First, map your current workflow. Document each step from checkout to settlement. Identify where you have synchronous vs. async calls, how you handle timeouts, and whether you use idempotency keys. This map will reveal gaps.
Second, run a failure mode analysis. For each step, ask: what happens if this call times out? What if the processor returns an unexpected response? What if the webhook doesn’t arrive? Write down the failure mode and how your workflow handles it. If the answer is "it breaks," that’s your priority fix.
Third, implement idempotency keys if you haven’t already. This is the single highest-impact change for preventing double charges. It’s straightforward to add and works with any provider.
Fourth, set up monitoring for the metrics we discussed. Start with authorization success rate and settlement lag. Use a simple dashboard or even a spreadsheet. The goal is to see trends before they become crises.
Finally, consider running an A/B test between two workflow patterns. For example, test synchronous capture vs. delayed capture for a subset of transactions. Measure success rate, refund rate, and customer complaints. Use the data to decide which pattern to roll out broadly.
Payment workflow design is not a set-it-and-forget-it task. As your business grows, your constraints change, and the workflow that worked at 100 transactions per day may fail at 10,000. Revisit your design every quarter, compare it against the patterns we’ve discussed, and adjust. That’s how you build a payment system that earns trust and revenue.
Comments (0)
Please sign in to post a comment.
Don't have an account? Create one
No comments yet. Be the first to comment!