Store Wallet
Store-credit wallet: rolling balance, top-up amount chips with a loading key, a gift-card code field that formats and validates, recent credits and debits grouped by day from a fixed now, and an expiring-credit warning.
Preview
Store credit
$12.00 expires in 9 days (Nov 12). Use it at checkout first.
Recent activity
Today
- Order #20594debit −$38.50
Yesterday
- Refund · Order #20411credit +$22.00
Oct 29
- Top-upcredit +$50.00
Oct 27
- Order #20377debit −$64.20
Install
Pro source requires Pebble Pro. Try the full preview above.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| defaultBalance | number | — | Starting balance; rolls as credits and debits land. |
| transactions | { id; label; amount; at; kind?: "topup" | "refund" | "purchase" | "gift" }[] | [] | Newest first; positive amounts are credits. at is UTC "YYYY-MM-DDTHH:MM". |
| now | string | — | UTC time for Today / Yesterday, the expiry countdown and new entries; the clock is never read. |
| expiring | { amount: number; on: "YYYY-MM-DD" } | — | Credit about to lapse; shows a warning with days left. |
| topUpOptions | number[] | [10, 25, 50, 100] | Top-up amount chips. |
| onTopUp | (amount: number) => void | Promise<unknown> | — | Charge the top-up; the key shows loading, a rejection leaves the balance alone. |
| onRedeem | (code: string) => Promise<number> | — | Resolve with the credited amount or reject with an Error whose message is shown. |
| currency / locale | string | "USD" / "en-US" | Money and date formatting. |
| title | string | "Store credit" | Heading above the balance. |
Pro component
Try the full preview above. Editable source and build guides require Pebble Pro.
