add Printful webhook endpoint with token verification

New POST /webhooks/printful route with VerifyPrintfulWebhook plug
(shared secret token via header or query param). Handles package_shipped,
order_failed, order_canceled, product_updated, product_synced, and
product_deleted events. Webhook registration via Printful v2 API with
token appended to URL. 19 new tests (819 total).

Also marks task #28 as done — Printful sync products already include
preview mockup images handled by the existing ImageDownloadWorker
pipeline.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
jamey
2026-02-15 09:32:14 +00:00
parent 0cfcb2448e
commit 24d61f7a9e
8 changed files with 519 additions and 8 deletions

View File

@@ -52,12 +52,12 @@ Plans: [admin-redesign.md](docs/plans/admin-redesign.md) | [setup-wizard.md](doc
| 16 | Variant refinement with live data | — | 2-3h | |
| ~~18~~ | ~~Shipping costs at checkout~~ | 17 | 4h | done |
| | **Printful integration** | | | |
| 24 | Printful HTTP client | — | 1.5h | |
| 25 | Printful provider (sync + orders) | 24 | 3h | |
| 26 | Multi-provider order routing | 25 | 1h | |
| 27 | Printful shipping rates | 25 | 1.5h | |
| 28 | Printful mockup generation worker | 25 | 2h | |
| 29 | Printful webhooks | 25 | 1.5h | |
| ~~24~~ | ~~Printful HTTP client~~ | — | 1.5h | done |
| ~~25~~ | ~~Printful provider (sync + orders)~~ | 24 | 3h | done |
| ~~26~~ | ~~Multi-provider order routing~~ | 25 | 1h | done |
| ~~27~~ | ~~Printful shipping rates~~ | 25 | 1.5h | done |
| ~~28~~ | ~~Printful mockup generation worker~~ | 25 | — | done (existing pipeline) |
| ~~29~~ | ~~Printful webhooks~~ | 25 | 1.5h | done |
| 30 | Admin UI tweaks for Printful | 25 | 1h | |
| 31 | Printful tests + integration testing | 24-30 | 4.5h | |
| | **CSS migration (after admin stable)** | | | |