feat: operator settings, guest booking list, card checkout #22
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/fiat-checkout"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Three slices, stacked:
policy) and accept_fiat move off the instance row onto
chatelet.operator_settings keyed by user id. Public room views and the
kind:30402 listing carry house_rules / payment_methods so a generic Nostr
client can render them without our RPC. GET/PUT /api/v1/operator plus RPC
twins; admin UI gets a per-operator card.
stays, newest check-in first, minus the Lightning/Nostr plumbing.
opted in, the room is fiat-priced and core has a provider for that user
(settings.get_fiat_providers_for_user — the seam lnbits#67 plugs into;
chatelet stores no credentials). Both rails go through
create_payment_request; the Stripe webhook settles onto the same invoice
queue so on_invoice_paid confirms card bookings unchanged. frontend_url is
allow-listed against trusted origins, ported from events.
min_lnbits_version → 1.4.1. docs/data-model.md and event-flow.md updated.
The webapp's chatelet my-bookings slice depends on this.
GET /api/v1/bookings/mine (LNbits account auth; identity = the account's Nostr pubkey, the same value the booking request carried) and RPC twin chatelet_booking_list_mine (scoped by the signed sender_pubkey). Rows come back newest check-in first via the m003 guest index, as guest_booking_dict: the guest's own contact and counts, minus the Lightning/Nostr plumbing. Declared ahead of /bookings/{booking_id} so 'mine' is not read as an id. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>A guest may pay a fiat-priced room by card when its owner has opted in and LNbits core has a fiat provider for that user — resolved through settings.get_fiat_providers_for_user(owner), the seam lnbits#67's per-user Stripe Connect credentials will plug into; chatelet stores no credentials. Both rails now go through create_payment_request: Lightning unchanged (sats, deposit_sat), card charges the same deposit share of the fiat price in the room's currency with extra.checkout parameterising the hosted Stripe page — success/cancel return to {frontend}/chatelet/{room}?checkout=… &booking=<id>, customer_email, line item, metadata. frontend_url is allow-listed against the instance's trusted origins (ported from events) and resolved before the hold so a refused rail never leaves a dead hold. Core settles the Stripe webhook onto the same invoice queue, so tasks.on_invoice_paid confirms card bookings unchanged. BookingRequestData gains payment_method / fiat_provider / frontend_url; BookingQuote gains fiat_payment_request / fiat_provider / is_fiat and a nullable payment_request. RPC chatelet_booking_request passes the fields through. min_lnbits_version → 1.4.1 (events' floor for these APIs). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>