When you add crypto checkout to a store or SaaS app, the gateway confirms payments asynchronously. Blockchain confirmations take time, so your backend learns about a completed payment later, either because the gateway calls you (webhook) or because you ask (polling). Most production setups use both. Here is why, with a minimal Express example.
Webhooks: fast but not guaranteed
A webhook arrives seconds after the gateway sees the payment reach the required confirmations. It is the fastest way to mark an order paid. But webhooks can be delayed, retried, delivered out of order or blocked by your firewall during a deploy. If your only signal is the webhook, a missed delivery means a paid customer with an unpaid order.
Polling: slow but reliable
A scheduled job that asks the gateway for the status of every pending invoice catches anything the webhook missed.…