BlogMay 6, 2026Tutorials

Payment processors and billing: what to wire up first

Before you chase every local rail, get webhooks, idempotency, and invoice state mapping right—so finance never argues with the gateway about what was actually collected.

Pick coverage and settlement currency before you pick a logo. B2B buyers still pay by bank transfer in many corridors; cards and wallets matter for speed and cash application, not for every segment.

Model the minimum events you need: authorized, captured, partially captured, failed, refunded, disputed. Your billing record should reflect those transitions with timestamps, not a single “paid” checkbox someone toggles by hand.

Run sandbox scenarios that mirror messy reality: retries with the same idempotency key, partial captures against one invoice, split allocation across two documents, and deliberate payout-to-ledger mismatches you practice resolving. Fewer surprises in production.