Rebasely Beta: data may be purged

examples/storefront Public

Markdown · 1.2 KiB · at e83464e

id: 0009-cancel-unpaid-orders-after-30-minutes
type: decision
owner: justin
status: accepted
reviewed: 2026-10-09

0009 Cancel unpaid orders after 30 minutes

Context

Checkout takes stock ([[0004-take-stock-at-checkout]]), and an order that is never paid keeps it. Shoppers abandon the payment step often: a card is declined, a bank's confirmation page times out, a tab is closed. Stripe leaves those PaymentIntents open indefinitely.

Decision

Orders still pending_payment 30 minutes after checkout are cancelled by a cron trigger on storefront-api that runs every five minutes. The PaymentIntent is cancelled at Stripe first, and an order whose intent can no longer be cancelled is left for the webhook ([[payment-webhook]]).

Consequences

  • Stock held by an abandoned checkout comes back within 35 minutes.
  • A shopper who comes back after the window has to check out again; the old client secret no longer works because the intent is cancelled.
  • Bank redirects and 3D Secure fit comfortably in 30 minutes. Delayed payment methods (bank debits, which take days) would not. They are off in the Stripe dashboard, and turning one on needs a different rule.