I wouldn't start building the payment path tomorrow. The core of the checkout flow (steps 3–6) can charge customers twice or charge them without recording an order. The fixes are standard and not much work, but they change the flow, so make them before you write code that depends on it.

## Blockers

**1. Retrying the charge after a timeout can charge the customer twice (step 4).**
A timeout doesn't mean the charge failed. It often means it worked and the response got lost. Retrying up to 3 times without an idempotency key means one order can be charged up to 4 times.
*Fix:* send an idempotency key based on the order id with every charge attempt. Most providers support this. When retries run out, the result is **unknown**, not failed. Look it up with the provider rather than assuming.

**2. The database transaction stays open during the payment call (steps 3–6).**
The `PENDING` row isn't committed until the charge comes back, which can take 20+ seconds with retries. This causes three problems:
- If the process crashes, or the commit fails after a successful charge, the customer has paid and you have **no record of the order**. The rollback in step 6 deletes your only evidence.
- Each checkout holds a connection and locks for the whole call, so a slow payment provider can use up your connection pool.
- If the charge succeeded but the timed-out attempt is treated as a failure, the rollback erases the order while the money has been taken.

*Fix:* commit `PENDING` in its own short transaction, call the payment provider with no transaction open, then update to `PAID`, `FAILED` or `PAYMENT_UNKNOWN` in a second transaction. Add a small reconciliation job that finds orders stuck in `PENDING` or `PAYMENT_UNKNOWN` and checks their status with the provider. At 2,000 orders a day this can be a simple cron job.

**3. A retried `POST /orders` creates a duplicate order and charge.**
With up to 20 seconds of internal retries, the client or a load balancer will often time out and send the request again.
*Fix:* have the client send an idempotency key, store it on the order with a unique constraint, and return the existing order when the key repeats.

## Should fix before launch

**4. The stock check doesn't reserve anything (step 2).** Checking a cache that can be 5 minutes old, with no decrement, means two customers can buy the last item. Skipping the 800 ms warehouse call is a fair tradeoff at your volume, but the design needs to say what happens on an oversell: who finds out, and whether you refund or backorder. Also decide whether anything reserves stock at all, even just an "in-flight orders" count in your own database.

**5. The confirmation email is sent inside the request path (step 5).** If it fails or the process dies after commit, the email is lost. If it raises an error, you might show an error to a customer who has paid. Write an "email pending" row (an outbox) in the same transaction that marks the order `PAID`, and send emails from a worker.

**6. The only integration test is the happy path.** The bugs above are all in the failure paths. At minimum, test:
- a charge that times out and then succeeds
- a timeout on every attempt
- a crash between the charge and the commit
- a duplicate `POST`

Use a fake payment provider you can script.

**7. Nightly backups can lose up to 24 hours of paid orders.** For a service that takes money, turn on WAL archiving / point-in-time recovery. Your provider can probably do this for you, so it's cheap. A single Postgres instance is otherwise fine at this scale.

## What's fine
- The module boundaries (no module reads another module's tables), thin routes and the `OrderCheckout` class are sensible for a team of four.
- Logging the order id on every line is good. Also log the payment idempotency key and the provider's charge id so reconciliation is possible.
- Nothing here needs queues, sagas or extra infrastructure at 2,000 orders a day. The fixes are a status column, two keys, an outbox table and a cron job.

## Suggested path
Rewrite steps 3–6 today: an order state machine (`PENDING → PAID / FAILED / PAYMENT_UNKNOWN`), both idempotency keys, no transaction open during the payment call, and reconciliation. Add the oversell policy. Tomorrow you can start on the module scaffolding, the inventory cache, routes and logging, since none of that depends on the payment flow. Build the payment path once the flow is updated.

VERDICT: NOT READY
