erio
d9ab65ecf2
feat: integrate Stripe payment with bugfixes and active timeout cancellation
...
- Add Stripe payment provider with Checkout Session flow
- Payment provider abstraction layer (EasyPay + Stripe unified interface)
- Stripe webhook with proper raw body handling and signature verification
- Frontend: Stripe button with URL validation, anti-duplicate click, noopener
- Active timeout cancellation: query platform before expiring, recover paid orders
- Singleton Stripe client, idempotency keys, Math.round for amounts
- Handle async_payment events, return null for unknown webhook events
- Set Checkout Session expires_at aligned with order timeout
- Add cancelPayment to provider interface (Stripe: sessions.expire, EasyPay: no-op)
- Enable stripe in frontend payment type list
2026-03-01 17:58:08 +08:00
erio
2f45044073
refactor: extract pay page components and migrate zpay → easypay
...
Components:
- Add PayPageLayout, OrderFilterBar, MobileOrderList, OrderTable, OrderSummaryCards
- Extract shared pay-utils (types, constants, helper functions)
- Simplify pay/page.tsx and orders/page.tsx
EasyPay migration:
- Remove src/lib/zpay/, api/zpay/notify, zpay test, zpay.md
- Simplify config.ts: single envSchema, no ZPAY_* fallback
- Rename DB field zpay_trade_no → payment_trade_no (migration added)
- Update OrderDetail label: ZPAY订单号 → 支付单号
- Update CLAUDE.md project structure
2026-03-01 15:55:43 +08:00
erio
d2e856b89c
fix: align pay page header layout to match orders page
2026-03-01 15:00:27 +08:00
erio
04abbf1dd1
fix: add refresh+orders to header, remove 订单中心 card
2026-03-01 14:53:00 +08:00
erio
8656f1ab8f
fix: move refresh+orders buttons into 订单中心 card, remove from header
2026-03-01 14:41:05 +08:00
erio
3052886ca1
fix: add refresh button next to 我的订单 in desktop header
2026-03-01 14:36:56 +08:00
erio
dadf7b228f
fix: remove dead zpay/client, fix zpay notify route type imports
2026-03-01 14:27:49 +08:00
erio
9c80d519b1
fix: correct import name ZPayNotifyParams -> EasyPayNotifyParams
2026-03-01 14:25:12 +08:00
erio
07dfd06775
fix: suppress type error in pickRequired/pickOptional helpers
2026-03-01 14:23:42 +08:00
erio
75f521e2cd
fix: add dark prop to OrderStatus component
2026-03-01 14:22:17 +08:00
erio
e0ea57cfc3
fix: add qrcode dependency missing from package.json
2026-03-01 14:20:14 +08:00
erio
ceb09659f8
feat: add refresh button to orders panel and admin page
...
- Desktop orders card in pay/page.tsx: refresh button next to "订单中心"
- Admin orders page: refresh button next to the page title
2026-03-01 14:17:18 +08:00
erio
98f7912131
feat: add payment icons missing from master branch
...
Bring alipay and wxpay SVG icons from the main branch — these are
referenced by PaymentQRCode but were absent in master.
2026-03-01 13:55:06 +08:00
erio
d5719bf213
feat: migrate payment provider to easy-pay, add order history and refund support
...
- Replace zpay with easy-pay payment provider (new lib/easy-pay/ module)
- Add order history page for users (pay/orders)
- Add GET /api/orders/my endpoint to list user's own orders
- Add GET /api/users/[id] endpoint for sub2api user lookup
- Add order status tracking module (lib/order/status.ts)
- Update config to support easy-pay credentials (merchant ID, key, gateway)
- Update PaymentForm and PaymentQRCode components for easy-pay flow
- Update pay page and admin page with new order management UI
- Update order service to support easy-pay, cancellation, and refund
2026-03-01 03:04:24 +08:00