Payments
All payments go through LNbits. The extension creates Lightning invoices, listens for settlement, and handles bookkeeping.
Checkout flow
- Customer taps Checkout in the Mini App
- Buyer info is collected (email, address) depending on checkout mode
- Total is calculated: subtotal + tax + shipping - store credit
- If store credit covers everything, the order completes immediately
- Otherwise, a Lightning invoice is generated for the remaining amount
- Customer pays through the Mini App
- On settlement: order marked paid, stock deducted, admin notified with buyer info and order details
Fiat pricing
When your shop currency is a fiat code (e.g. USD), prices display in that currency. At checkout, the total converts to sats at the current exchange rate.
Both the fiat amount and sat amount are stored on the order, so you always know what the customer saw and what they paid.
Store credit
Customers get store credit when you issue credit refunds on returns. Tracked per customer by Telegram chat ID.
At checkout:
- Available credit is deducted automatically (oldest first)
- The invoice covers only what's left
- If credit covers the total, no invoice needed
Check balance anytime through the Mini App's Credits tab.
Credit doesn't expire.
Invoice expiry
Invoices follow your LNbits wallet's default expiry. Unpaid orders stay pending. The customer can start a new checkout.
What's stored per order
| Field | Source |
|---|---|
| Cart items (JSON) | Snapshot at checkout |
| Amount in sats | Calculated at checkout |
| Fiat amount | If using fiat pricing |
| Payment hash | From the Lightning invoice |
| Buyer name | If collected (address mode) |
| Buyer email | If collected |
| Buyer address | If collected |
| Customer identity | Telegram username + chat ID |
