diff options
| author | Your Name <you@example.com> | 2026-05-15 22:27:14 +0530 |
|---|---|---|
| committer | Your Name <you@example.com> | 2026-05-15 22:27:14 +0530 |
| commit | 1263d86314fc0760d9be8eea415ccecbc047a5eb (patch) | |
| tree | 778130f0beb59d52f68e0e5f11388bf4b1470130 /main/tollgate_api.h | |
| parent | a7d0a672d59bf8985a6fc0e61b49015fabd96513 (diff) | |
Phase 2 WIP: Cashu payment endpoints, session tracking, updated checklist
- Add cashu.c/h: Cashu token decode (cashuA/base64url), proof state check via mint API, allotment calculator
- Add session.c/h: time-based session management with allotment/expiry, spent secret tracking
- Add tollgate_api.c/h: HTTP server on :2121 with GET / (kind=10021 discovery), POST / (payment processing), /usage, /whoami
- Update captive portal HTML: replace Grant Free Access with Cashu token paste form + Pay & Connect button
- Update tollgate_main.c: wire in session manager, TollGate API, 1s session tick loop
- Add tests/phase2.mjs: Phase 2 test suite (discovery, invalid token, wrong mint, valid payment)
- Update CHECKLIST.md: reflect Phase 1 complete, Phase 2 in progress with known bugs
Known issues (not yet flashed):
- Stack overflow crash in httpd POST handler (need stack_size=16384 + heap allocations)
- cashu_decode_token uses 2KB stack buffer (needs heap alloc)
- Mint URL should be testnut.cashu.space (nofee.testnut has API compat issues)
Diffstat (limited to 'main/tollgate_api.h')
| -rw-r--r-- | main/tollgate_api.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/main/tollgate_api.h b/main/tollgate_api.h new file mode 100644 index 0000000..23e0d75 --- /dev/null +++ b/main/tollgate_api.h | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | #ifndef TOLLGATE_API_H | ||
| 2 | #define TOLLGATE_API_H | ||
| 3 | |||
| 4 | #include "esp_err.h" | ||
| 5 | #include "esp_http_server.h" | ||
| 6 | |||
| 7 | esp_err_t tollgate_api_start(void); | ||
| 8 | void tollgate_api_stop(void); | ||
| 9 | |||
| 10 | #endif | ||