Rebasely Beta: data may be purged

examplesstorefront Public

Search the catalog with D1 full text search #4

Changed files

21 files changed404 additions24 deletionssince main at f6403bb

Fulfilling a paid order

Not changed by this pull request.

  • Added
  • Rerouted, relabelled or moved
  • Removed

From Stripe's payment_intent.succeeded to a shipment at the warehouse. The webhook marks the order paid through OrdersService, which announces it on order-events. fulfilment picks the event up, reads the order, creates the shipment with the order id as idempotency key, and records it.

Fulfilling a paid order: 12 steps between 7 participants Step 1: stripe to stripe-webhook, payment_intent.succeeded, signedpayment_intent.succeeded, sig…Step 2: stripe-webhook to storefront-api, OrdersService.markPaid(order, intent)OrdersService.markPaid(order,…Step 3: storefront-api to db, mark the order paidmark the order paidStep 4: storefront-api to order-events, send order.paidsend order.paidStep 5: order-events to fulfilment, a batch of up to 10 eventsa batch of up to 10 eventsStep 6: fulfilment to storefront-api, OrdersService.forFulfilment(order)OrdersService.forFulfilment(order)Step 7: storefront-api to db, read the order and its linesread the order and its linesStep 8: fulfilment to warehouse, POST /v1/shipments, Idempotency-Key order-<id>POST /v1/shipments, Idempoten…Step 9: warehouse to fulfilment, the shipment idthe shipment idStep 10: fulfilment to storefront-api, OrdersService.recordShipment(order, shipment)OrdersService.recordShipment(order, shipment)Step 11: storefront-api to db, mark the order fulfilledmark the order fulfilledStep 12: fulfilment to order-events, ack, or retry with backoffack, or retry with backoffstripestripeExternalstripe-webhookstripe-webhookWorkerstorefront-apistorefront-apiWorkerdbdbD1 databaseorder-eventsorder-eventsQueuefulfilmentfulfilmentWorkerwarehousewarehouseActor

The flow order-fulfilment at the head of this pull request, numbered in its order, with the steps it adds, reroutes, relabels, moves and removes. A removed step has no number.

Steps

  1. Step 1: stripe → stripe-webhook payment_intent.succeeded, signed
  2. Step 2: stripe-webhook → storefront-api OrdersService.markPaid(order, intent)
  3. Step 3: storefront-api → db mark the order paid
  4. Step 4: storefront-api → order-events send order.paid
  5. Step 5: order-events → fulfilment a batch of up to 10 events
  6. Step 6: fulfilment → storefront-api OrdersService.forFulfilment(order)
  7. Step 7: storefront-api → db read the order and its lines
  8. Step 8: fulfilment → warehouse POST /v1/shipments, Idempotency-Key order-<id>
  9. Step 9: warehouse → fulfilment the shipment id
  10. Step 10: fulfilment → storefront-api OrdersService.recordShipment(order, shipment)
  11. Step 11: storefront-api → db mark the order fulfilled
  12. Step 12: fulfilment → order-events ack, or retry with backoff

Knowledge base

Back to the conversation