examples/storefront Public
title: Expiring an unpaid orderdescription: >- Every five minutes the cron trigger on storefront-api looks for orders still waiting for payment after 30 minutes. It cancels each one's PaymentIntent through the payments Worker first, so a late payment cannot land on a cancelled order, then cancels the order and puts its stock back.actors: [cron]steps: - { from: cron, to: storefront-api, label: "scheduled(), every five minutes" } - { from: storefront-api, to: db, label: "orders pending_payment for over 30 minutes, 50 at most" } - { from: storefront-api, to: payments, label: PaymentsService.cancelIntent(intent) } - { from: payments, to: stripe, label: cancel the PaymentIntent } - { from: payments, to: storefront-api, label: "true, or false if it already succeeded" } - { from: storefront-api, to: db, label: "one batch: put the stock back, cancel the order" } - { from: storefront-api, to: order-events, label: send order.cancelled }