ApplicationsCheckout

Checkout app

The standalone hosted checkout application for payment processing with Redis session persistence.

apps/checkout is the hosted payment application. After the storefront places an order, the customer is redirected here to complete payment via Stripe, Easypay, or Ifthenpay.

Port: 3004 · Framework: Next.js 16 · Database: None (Upstash Redis for sessions)

Architecture

Drag to pan · Scroll to zoom

Key dependencies

PackageRole
@prood/checkout-hostSession create/load/persist, webhook forwarding
@prood/checkoutCheckoutSession state machine (used internally)
@prood/typesError response helpers
@prood/uiButton, skeleton, toast components
@stripe/react-stripe-jsStripe Payment Element

Routes

RoutePurpose
/payLanding / entry page
/pay/c/[id]Payment UI
/pay/confirm/[id]Post-3DS / async confirmation

The app is built with basePath: "/pay", so every route, asset and API call lives under /pay: https://prood.com/pay in production, http://localhost:3004/pay locally. The routes below are written relative to it.

See Sessions for API route details.

Configuration

VariableRequiredPurpose
KV_REST_API_URLYesRedis REST endpoint
KV_REST_API_TOKENYesRedis REST token
CHECKOUT_API_SECRETYesProtects session creation API
CHECKOUT_URLYesPublic checkout base URL including its path, https://prood.com/pay
COMMERCE_API_URLYesWebhook forwarding target

Security

  • Session creation requires x-checkout-secret header — only trusted callers (storefront) can create sessions
  • Webhook routes are org-scoped: /pay/api/webhooks/{provider}/{orgId}
  • Payment provider credentials loaded per tenant from encrypted integration config
  • No direct database access — all order updates go through the Commerce API