From 808b552b8efbc01192c5d877f933d76c88aa4d24 Mon Sep 17 00:00:00 2001 From: Jeff Emmett Date: Fri, 13 Feb 2026 12:48:08 -0700 Subject: [PATCH] Mark task-5 (shop page) as Done with checkout/shipping/payment notes Co-Authored-By: Claude Opus 4.6 --- .../task-5 - Build-purchaser-shop-page.md | 41 +++++++++++++++++-- 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/backlog/tasks/task-5 - Build-purchaser-shop-page.md b/backlog/tasks/task-5 - Build-purchaser-shop-page.md index aa5ab50..68b9789 100644 --- a/backlog/tasks/task-5 - Build-purchaser-shop-page.md +++ b/backlog/tasks/task-5 - Build-purchaser-shop-page.md @@ -1,10 +1,10 @@ --- id: task-5 title: Build purchaser/shop page -status: In Progress +status: Done assignee: [] created_date: '2026-01-12 15:29' -updated_date: '2026-02-04 23:31' +updated_date: '2026-02-13 19:47' labels: [] dependencies: [] priority: medium @@ -22,8 +22,8 @@ Implement the purchaser page that displays products and allows customers to brow - [x] #2 Create product listing component - [x] #3 Create product detail view - [x] #4 Integrate Zettle/Airtable product data -- [ ] #5 Implement shopping cart functionality -- [ ] #6 Integrate payment processing +- [x] #5 Implement shopping cart functionality +- [x] #6 Integrate payment processing ## Implementation Notes @@ -43,4 +43,37 @@ Connected to Directus CMS at https://katheryn-cms.jeffemmett.com - 1700+ artwork images rendering correctly on store - Field mapping in place: Directus `name` -> frontend `title`, `price_gbp`/`price_usd` -> `price` - Cart functionality working with add-to-cart on artwork cards + +## 2026-02-13 - Checkout, Shipping & Payment Complete + +### Implemented: +- **Flat-rate shipping** by region: UK £10, Europe £25, International £40 + - New `/src/lib/shipping.ts` utility (single source of truth for rates) + - Checkout page shows shipping cost dynamically based on country selection + - Server-side recalculation prevents tampering +- **PayPal integration** fully wired: + - PayPal sandbox credentials configured + - Order creation API verifies prices against Directus, creates PayPal order with item_total + shipping breakdown + - Capture API marks artworks as sold, updates order status +- **Order confirmation emails** via SMTP: + - Created `orders@katheryntrenshaw.com` mailbox on Mailcow + - Customer receives HTML confirmation with order breakdown + - Katheryn receives notification email with customer/shipping details + - Subtotal + shipping + total shown in both emails +- **Order confirmation page** shows full breakdown (subtotal, shipping, total) +- **Secret management**: Moved all credentials to `/opt/secrets/katheryn-website/.env`, docker-compose uses `env_file:` directive + +### Files added/modified: +- `src/lib/shipping.ts` (new) +- `src/lib/paypal.ts`, `src/lib/email.ts`, `src/lib/directus-admin.ts` +- `src/app/api/orders/create/route.ts`, `src/app/api/orders/capture/route.ts` +- `src/components/paypal-checkout.tsx` +- `src/app/checkout/page.tsx`, `src/app/order-confirmation/page.tsx` +- `docker-compose.yml` (security hardening + env_file) + +### Commits: +- 2b5f2cf Add flat-rate shipping, PayPal checkout, and order confirmation emails +- 2196cad Move secrets to env_file, add security hardening to docker-compose +- f90b35d Update env_file path to /opt/secrets/katheryn-website/.env +- 2966e3e Add PayPal/nodemailer deps and Order/OrderItem types