Introduction
If your goal is a 100 % serverless storefront that deploys in one click from GitHub and handles digital goods with zero recurring fees, Cloudflare Pages is a strong candidate. However, the platforms default behavior is to serve static assets; dynamic payment logic must be externalized unless you adopt Cloudflare Workers for edge compute. This article outlines two concrete stacks:
Stack A: Cloudflare Pages + Cloudflare Workers KV + NOWPayments Checkout (custodial, no custody). Stack B: Cloudflare Pages + Cloudflare Workers + Bitfinex Pay (non-custodial, sub-second confirmations).
Both stacks store product catalog in Workers KV, terminate HTTPS at Cloudflare, and settle revenue directly to your wallet or bank. The contrast between fee percentage, settlement speed, and API surface area is intentional and measurable.
Choosing the Payment Backend: NOWPayments vs Bitfinex Pay
NOWPayments provides a hosted checkout widget with a 0.5 % processing fee for fiat-to-crypto swaps. The widget runs in an iframe and POSTs callbacks to a Workers endpoint you define. Latency is ~500 ms from user click to redirect. Geographic coverage is 250 countries with KYC-free limits under €1,000 per transaction. The custody model is custodial: NOWPayments holds the crypto until you withdraw, which adds an additional on-chain transaction fee (~$1–$3) and 10–30 minutes of settlement risk.
Bitfinex Pay is a non-custodial solution tied to Bitfinexs order-book matching engine. It exposes a simple REST API where you create an invoice and retrieve the on-chain address. Processing fee is 0.1 % with a 10,000 USDT daily volume cap before additional KYC. Latency between invoice creation and address generation is sub-100 ms. Settlement occurs as soon as the transaction is included in a block, typically under 60 seconds. You retain custody throughout, eliminating withdrawal fees and settlement risk. The API schema is flat and cache-friendly, returning minified JSON at ~1 KB per request.
Evaluate NOWPayments if you need rapid geographic coverage and are comfortable with custodial risk. Choose Bitfinex Pay if fee minimization and settlement speed are critical.
Static Asset Pipeline: Cloudflare Pages
Cloudflare Pages compiles your frontend from GitHub in under 60 seconds. The pipeline supports any static site generator: 11ty, Hugo, Astro, or plain HTML/CSS/JS. No runtime dependencies are installed on the edge; the entire bundle is served from Cloudflares edge cache with a global TTFB of <50 ms.
Product data is stored in Workers KV, keyed by SKU slug. KV provides 30 GB of storage, 10 ms reads globally, and 99.9 % availability SLA. Cache keys are invalidated via a Cloudflare Cache Purge API call triggered by a GitHub Action post-deploy. This ensures product updates propagate within 60 seconds without a full redeploy.
Build your static store with lightweight markup, pre-rendering all SKUs at build time. Client-side hydration is optional; a thin React or Preact bundle adds ~50 KB uncompressed, transparent to the user if cached correctly.
Edge Logic: Cloudflare Workers
Workers run on the same edge network as Pages, allowing you to colocate compute and cache. For Stack A, a single Worker handles three routes:
/products/{sku} – serves static JSON from KV. /pay/{sku} – returns NOWPayments checkout URL. /callback – receives POST from NOWPayments with transaction_id, amount, currency.
The Worker uses the fetch API to call NOWPayments and awaits the 302 redirect. KV writes are atomic; if the callback fails, you can replay using the transaction_id as idempotency key.
For Stack B, the Worker becomes the payment orchestrator:
/invoices – POST to create Bitfinex Pay invoice. /status/{invoiceId} – GET to poll confirmation status. /fulfill – POST from your Worker to mark order fulfilled.
Bitfinex Pays API is RESTful with short-lived JWT tokens scoped to your Bitfinex UID. Tokens rotate every 24 hours via a Workers KV secret. The Worker caches the token for 11 hours to reduce API calls, paying only one request every 20 minutes per active SKU.
Deployment Velocity and Observability
Both stacks deploy with wrangler pages publish. A GitHub Actions workflow runs npm ci, npm run build, and wrangler pages publish --project-name crypto-store. Total CI time is ~90 seconds. No Terraform or Pulumi is required; infrastructure is declared in wrangler.toml (51 lines) and GitHub secrets for NOWPayments API key or Bitfinex API key/secret.
Observability is built-in. Cloudflare Logs stream to an R2 bucket via Logpush. A second Worker aggregates errors and writes to