Add goal progress bar to donate form and [streamgoals_progress] shortcode
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
353f7ca5be
commit
b80010f422
7 files changed
+397
-9
No files matched your search
@@ -47,6 +47,8 @@ Rule `config` examples (`max_total_seconds` caps what one rule has added over ti
|
||||
## Public REST (namespace `streamgoals/v1`)
|
||||
- `POST /orders` (create order; server computes total incl. optional fee cover), `POST /orders/{id}/capture`
|
||||
- `POST /webhook` (PayPal signature verified; deduped by capture id)
|
||||
- `GET /progress?goal=ID` — public, read-only, rate limited (60/min per visitor). Returns `Overlay\Progress::payload()` only: `goal_id,title,currency,raised_minor,target_minor,percent,raised_display,target_display,reached,tier|null` (`tier` = `{index,count,title,target_minor,target_display}`). No donor data. 404 unless goal status is active/complete. `Cache-Control: public, max-age=10`.
|
||||
Shortcodes `[streamgoals_donate show_progress="yes|no"]` (default yes) and `[streamgoals_progress goal=""]` server-render `Progress::html()` (role=progressbar); `donate.js` updates it in place (after a donation, every 30 s while the tab is visible, and once on load for cached pages). Numbers come from `Payloads::goal()`, so they match the overlay; reached = closed at target, all tiers reached, or raised >= target.
|
||||
- `GET /overlay/{token}/{widget}` — ETag'd JSON, polled every 2–3 s; widgets: `goal`, `timer`, `counter`, `alerts`
|
||||
|
||||
## Fee cover
|
||||
|
||||
Reference in new issue
Block a user