Skip to content

Swft Checkout

Swft Checkout is the hosted edge-rendered checkout that replaces WooCommerce’s native checkout page.

The WordPress plugin intercepts the WooCommerce checkout URL via template_redirect (priority 1). When the cart is non-empty and Swft is enabled with a valid API key, the plugin looks up a pre-created session URL from a WordPress transient and redirects with wp_safe_redirect().

The checkout runs at checkout.swft.co.uk/{sessionId}. It is a React application rendered by a Cloudflare Worker. The Worker reads the session from Cloudflare KV and injects it as window.__SWFT_SESSION__ into the HTML before it reaches the browser — the app boots with full data, no loading state.

  • Express checkout (Apple Pay, Google Pay) rendered first
  • Email address
  • Shipping address (auto-filled for returning customers)
  • Shipping method (radio cards from WooCommerce rates)
  • Review strip summarising step 1 data with inline Edit links
  • Stripe Elements card input
  • Pay button showing exact total: Pay £[amount]
  • Order reference
  • Delivery address
  • Estimated delivery window
  • Interactive map (requires Google Maps API key)

Three checkout layout templates are available. Select in Settings → Swft Checkout → Checkout Layout. See Templates for details.

After payment, the Swft API creates a native WooCommerce order via the WooCommerce REST API with:

  • status: processing
  • payment_method: swft
  • payment_method_title: Card (Swft)
  • All line items and shipping line
  • Billing and shipping address
  • _swft_session_id and _swft_payment_intent order meta
  • All extension data as _swft_ext_{key} meta fields

This requires WooCommerce REST API credentials to be configured. See Installation.

StatusMeaning
pendingSession created, customer has not reached checkout yet
processingCustomer is on the checkout page
completePayment succeeded, order created
expiredSession TTL exceeded (28 minutes from creation)

Sessions expire 28 minutes from creation. The transient caching on the WordPress side matches this TTL. If a session expires while the customer is mid-checkout, they see “This checkout link has expired — please return to the store and try again.”