---
issue: 065
title: "Backend: RN webhook advances PurchaseRequest to non-existent 'funded' status"
severity: high
domain: Payment
labels: [bug, backend, state-machine]
status: open
created: 2026-05-30
source: Full Codebase Audit 2026-05-30
---

# Backend: RN webhook advances PurchaseRequest to non-existent 'funded' status

**Severity:** high
**Domain:** Payment
**Labels:** bug, backend, state-machine

## Description

`src/services/payment/request-network/requestNetworkWebhook.ts:123` sets `PurchaseRequest.status = 'funded'` when a payment is confirmed. `'funded'` does not exist in `STATUS_PROGRESSION_ORDER` or the status enum. The update is silently dropped by Mongoose, leaving the purchase request in its old status and breaking downstream state transitions.

## Options

1. Use the canonical `'processing'` status that exists in `STATUS_PROGRESSION_ORDER`.
2. Add `'funded'` as a real status across progression and transition maps.
3. Route through the same `propagatePaymentCompletion` path the new flow uses.

## Recommendation

Replace `'funded'` with the canonical status used by the current completion flow (likely `'processing'`), keeping the `escrow.funded` flag if needed. This is a state-machine decision — verify the intended state after on-chain funding confirmation.

## Affected Files

- `backend/src/services/payment/request-network/requestNetworkWebhook.ts:123`

## References

- [Full Codebase Audit 2026-05-30](../09%20-%20Audits/Full%20Codebase%20Audit%20-%202026-05-30.md) — DEC-31
