From 84c2acaecaced240eed7414890da00481c147c41 Mon Sep 17 00:00:00 2001 From: elsirion Date: Tue, 19 Aug 2025 15:37:24 +0200 Subject: [PATCH] Add long-held HTTP request support to LUD21 verify Polling is an antipattern in most cases, it increases latency for clients and server load. When e.g. building a PoS using LUD21 one has to poll at least every second to achieve reasonably low latency. Long-polling fixes this. --- 21.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/21.md b/21.md index eb6da25..c3a70ef 100644 --- a/21.md +++ b/21.md @@ -52,4 +52,9 @@ or "status": "ERROR", "reason": "Not found" } -``` \ No newline at end of file +``` + +## Optional Long-Held HTTP Mode + +Services MAY support keeping the HTTP connection open until payment completion by accepting a `wait` parameter without a value, e.g. in the above example the URL would become `https://example.com/verify/894e7f7e...?wait`. The request should return the response when the payment is settled or expires whichever comes first. Clients specifying the `?wait` flag MUST be able to gracefully deal with earlier, non-final responses where `"settled": false` if the server doesn't support the long-held HTTP mode or closed connections due to server timeouts. +