Repository navigation
0.5.0 — 409 operation_in_flight
-
Added
latch.http(httpServer): a payment still in flight gets
409 operation_in_flight, not a 402. The proposed x402 recovery extension
(x402-foundation/x402#3848,
§5.1(6)–(7), control 9) says a copy that loses the claim, or a retry while a
settle is unresolved, MUST NOT get a payment challenge: a 402 invites a second
signature for one purchase. The SDK turns every hook refusal into a full 402,
and hooks cannot choose the status, solatch.http()wraps the SDK's
x402HTTPResourceServerand rewrites only the refusals Latch made as
"in flight". It also covers the SDK's own settlement-failure 402 when the
payment could still land. Every other answer is unchanged.app.use(paymentMiddlewareFromHTTPServer(latch.http(new x402HTTPResourceServer(server, routes))));
-
A
stuckpayment's retry is now refused aspayment_unresolved(409
withlatch.http()), notpayment_closed: its outcome is unknown, so the
purchase stays blocked and the caller is never invited to sign again. -
The demo uses
latch.http(); steps 3 and 4 now show the 409.
Also the first npm release of the 0.4.0 and 0.4.1 changes, which were never
published on their own:
journalReport(sql): a read-only, self-contained HTML dashboard of every
payment in a Postgres journal — where each one ended, activity over time,
recoveries, filters, CSV export, light and dark themes.journalReportData(sql): the same data as plain objects.npm run reportopens that page for the demo's payments.
Full details in CHANGELOG.md.
npm install latch402@0.5.0