Commit Graph
3288 Commits
Author SHA1 Message Date
erio bfcc487a6b feat(payment): add EasyPay dual-mode support (redirect + API)
- Backend: EasyPay provider supports paymentMode config (redirect/api)
  - redirect: builds submit.php signed URL, browser redirects to hosted page
  - api: calls mapi.php, returns payurl/qrcode (existing behavior)
- Add TypeEasyPay payment type constant
- Fix notify/return URL fallback to instance config
- Handle empty TradeNo for redirect mode (SetNillable)
- Frontend: add paymentMode dropdown in EasyPay provider config
- Auto-update supported_types when paymentMode changes
- Add easypay icon/color in PaymentMethodSelector
- Add i18n for easypay, paymentMode labels
- Rename "启用的支付方式" to "服务商"
- Migration 098: clean easypay from ENABLED_PAYMENT_TYPES
2026-04-06 20:57:45 +08:00
erio 76193ee3c9 chore: bump version to 0.1.108.24 2026-04-06 20:12:45 +08:00
erio 8637ea9563 fix: migration 097 — use FOR loop instead of WITH ORDINALITY for PG compat 2026-04-06 20:12:45 +08:00
erio 9f98284382 chore: bump version to 0.1.108.23 2026-04-06 20:06:39 +08:00
erio 6e083c7ac2 fix: migration 097 — fix purchase menu label and icon from migration 096
Migration 096 created a custom_menu_items entry with hardcoded English
label "Purchase" and empty icon_svg. This migration updates existing
records where id='migrated_purchase_subscription':
- label: "Purchase" → "充值/订阅"
- icon_svg: "" → CreditCard SVG (Heroicons outline)
2026-04-06 20:06:39 +08:00
erio 2cb9d73fa5 chore: bump version to 0.1.108.22 2026-04-06 19:57:42 +08:00
erio d8f2fd3c94 fix(frontend): unify purchase icon with subscriptions (CreditCardIcon)
Use the same CreditCardIcon for both "我的订阅" and "充值/订阅" sidebar
items. Remove unused RechargeSubscriptionIcon.
2026-04-06 19:57:42 +08:00
erio fc6514c18b chore: bump version to 0.1.108.21 2026-04-06 19:43:50 +08:00
erio 32907268f9 fix(frontend): mark provider config fields required/optional correctly
- apiBase, notifyUrl, returnUrl: remove optional flag (required — backend
  relies on these in provider config, no fallback)
- Only wxpay publicKeyId + certSerial remain optional
- Show red * for required fields, (可选) for optional fields
2026-04-06 19:43:50 +08:00
erio 3ba667d5c0 chore: bump version to 0.1.108.20 2026-04-06 19:31:26 +08:00
erio 91413cf410 feat(payment): order safety protection for provider/plan CRUD
Backend (matching sub2apipay behavior):
- UpdateProviderInstance: block credential changes (key/secret/password
  fields) when instance has PENDING/PAID/RECHARGING orders (409 Conflict)
- DeleteProviderInstance: block deletion when pending orders exist (409)
- DeletePlan: block deletion when pending orders exist (409)
- Non-credential changes (name/enabled/sort) still allowed with pending orders

Frontend:
- Filter empty config values before sending (avoid overwriting existing
  credentials when editing a provider without re-entering all secrets)
2026-04-06 19:31:26 +08:00
erio b0025ed25d chore: bump version to 0.1.108.19 2026-04-06 19:04:01 +08:00
erio f69293c998 fix(frontend): provider creation — fix JSON field names, i18n, remove extra fields
Root cause: frontend sent snake_case (provider_key, supported_types) but
backend expects camelCase (providerKey, supportedTypes) → internal error.

Changes:
- Fix handleSaveProvider to send camelCase payload matching Go struct
- Remove CID/CID Alipay/CID Wxpay fields (not in sub2apipay reference)
- Data-driven config fields: PROVIDER_CONFIG_FIELDS per provider type
  (matches sub2apipay exactly: easypay=5 fields, alipay=5, wxpay=8, stripe=3)
- Full i18n for all config field labels (zh: 异步通知地址/私钥/商户号/etc)
- Dynamic providerConfig as Record<string,string> instead of hardcoded reactive
2026-04-06 19:04:01 +08:00
erio b7367c5b31 chore: bump version to 0.1.108.18 2026-04-06 18:28:17 +08:00
erio 515f4aa0ce fix(frontend): remove balance-disabled checkbox, disable provider add when no types enabled
- Remove redundant "禁用余额充值" checkbox
- Disable "添加服务商" button when no payment types are enabled
- Show hint "请先在上方启用至少一种支付方式" when empty + no types
2026-04-06 18:28:17 +08:00
erio f8a07d59c4 chore: bump version to 0.1.108.17 2026-04-06 18:15:15 +08:00
erio 6503583162 fix(frontend): order timeout field — required marker + unit hint 2026-04-06 18:15:15 +08:00
erio f90d0f86fd chore: bump version to 0.1.108.16 2026-04-06 18:06:36 +08:00
erio 4b15704d8e fix(frontend): provider list respects enabled payment types
- Create provider dialog: only show provider types whose payment types
  are enabled (e.g. no Stripe option if stripe not enabled above)
- Provider cards: grey out + disable edit when their type is disabled
- Show "(类型已禁用)" warning on greyed-out provider cards
- Delete still allowed on disabled providers (cleanup)
2026-04-06 18:06:36 +08:00
erio d68479d4af chore: bump version to 0.1.108.15 2026-04-06 17:51:07 +08:00
erio b6757a831f fix(frontend): payment settings UI — layout, i18n, image upload
- Fix layout: 5-col grid -> 4-col + flex, no more truncated labels
- Add easypay to payment type toggles (易支付)
- Internationalize provider key options (易支付/支付宝官方/微信官方/Stripe)
- Help image: URL input -> ImageUpload component (supports upload)
- Help text: input -> textarea (multi-line)
- Add i18n keys: providerEasypay/Alipay/Wxpay/Stripe, helpImage, placeholders
2026-04-06 17:51:06 +08:00
erio c577595f50 chore: bump version to 0.1.108.14 2026-04-06 17:40:05 +08:00
erio 335aaa733b fix(frontend): fix purchase page icon and title i18n
- Replace fill-based 1024x1024 icon with stroke-based Heroicons banknotes
  icon (24x24) matching sidebar style
- Change titleKey from purchase.title to nav.buySubscription for consistency
2026-04-06 17:40:05 +08:00
erio 5f64f744de chore: bump version to 0.1.108.13 2026-04-06 17:16:59 +08:00
erio f8990f39f8 style(frontend): compact payment settings layout
- Merge amount fields, toggles and limits into fewer rows
- Put payment types + load balance strategy on same line
- Compact provider cards (single-line info, inline edit/delete buttons)
- Reduce padding and gaps throughout
2026-04-06 17:16:59 +08:00
erio 86204170d9 chore: bump version to 0.1.108.12 2026-04-06 16:44:21 +08:00
erio 2f41c71957 feat(payment): prefix order ID with sub2_ for third-party providers
Add formatOrderID/parseOrderID helpers to prepend "sub2_" prefix to
order IDs sent to EasyPay, Alipay, Wxpay, and Stripe. This makes our
orders identifiable in third-party dashboards and prevents ID collision.

Callback handlers strip the prefix before looking up the DB record.
Internal audit logs keep using raw DB IDs.
2026-04-06 16:43:59 +08:00
erio d25669ab52 chore: bump version to 0.1.108.11 2026-04-06 16:19:19 +08:00
erio 611dcb8ccd cleanup: remove duplicate AdminPaymentConfigView, fix group display
- Delete AdminPaymentConfigView.vue (duplicated in SettingsView Payment tab)
- Remove /admin/orders/config route
- Plans table: show red "缺失/Missing" badge for deleted groups
- Plans table: group_id column shows group name or missing indicator
2026-04-06 16:19:19 +08:00
erio 9b8317fc66 chore: bump version to 0.1.108.10 2026-04-06 16:04:20 +08:00
erio 97a9949085 fix(frontend): 7 payment UI issues
1. Remove duplicate page titles (AppLayout bar already shows them)
2. Fix daily_limit empty value causing Go unmarshal error (NaN -> 0)
3. Enabled payment types: text input -> toggle badges
4. Provider dialog: supported types -> toggle badges per provider key
5. Auto-derive supported types when changing provider key
6. Fix ¥ symbol showing as literal \u00A5 in Vue templates
7. Show payment method selector when >= 1 method (was > 1)
2026-04-06 16:03:58 +08:00
erio 1984a19285 chore: bump version to 0.1.108.9 2026-04-06 15:37:39 +08:00
erio 0215b2a1ca refactor(frontend): unify user orders page with DataTable + Pagination
Replace custom table and pill-style filters with project-standard
DataTable, Select, and Pagination components for consistent UI.
2026-04-06 15:37:39 +08:00
erio f72f79f48f chore: bump version to 0.1.108.8 2026-04-06 15:21:25 +08:00
erio 6798de6333 fix(frontend): centralize API error handling with extractApiErrorMessage
- Create utils/apiError.ts with extractApiErrorMessage() utility
- Replace all raw err.message/String(err) patterns in payment views
- Fix error display for API client interceptor's plain object errors
- Update CLAUDE.md with API error handling convention (section 13)
- Copy CLAUDE.md to AGENTS.md
2026-04-06 15:21:05 +08:00
erio 329d3445fa chore: bump version to 0.1.108.7 2026-04-06 15:03:19 +08:00
erio 4cfcbfabe6 fix(frontend): i18n table headers + remove redundant user subscriptions tab
- Plans page: remove user subscriptions sub-tab (already in subscription mgmt)
- Plans page: internationalize all table column headers
- Orders page: internationalize table column headers
- Add missing i18n key: colUser
2026-04-06 15:02:49 +08:00
erio fdc9c6d8b8 chore: bump version to 0.1.108.6 2026-04-06 14:52:16 +08:00
erio a6cd294ab6 feat(frontend): enrich payment settings with provider management inline
- Move payment config out of orders submenu (now 3 items: dashboard, orders, plans)
- Embed provider management directly in SettingsView Payment tab
- Add missing fields: product name prefix/suffix with preview, load balance strategy
- Add full provider CRUD dialog (EasyPay/Alipay/Wxpay/Stripe config fields)
2026-04-06 14:51:14 +08:00
erio 22a3931984 chore: bump version to 0.1.108.5 2026-04-06 14:40:53 +08:00
erio f2b3cf628e feat(frontend): collapsible payment submenu in sidebar
Group the 4 payment admin pages under a single "订单管理" parent menu
item that expands/collapses to show sub-items with indented tree line.
2026-04-06 14:40:37 +08:00
erio fa00ad06d2 chore: bump version to 0.1.108.4 2026-04-06 14:27:10 +08:00
erio 94585c3c21 refactor(frontend): split payment admin into 4 independent pages
Replace the single AdminOrdersView with 4-tab layout with separate pages:
- /admin/orders/dashboard — payment dashboard with 7/30/90 day switcher
- /admin/orders — pure order list (removed channels/plans tabs)
- /admin/orders/config — payment config + provider management
- /admin/orders/plans — subscription plans (group dropdown) + user subscriptions

Delete AdminProvidersView (merged into config page).
Update sidebar to show 4 menu items instead of 1.
2026-04-06 14:26:28 +08:00
erio 26a2c7a364 cleanup: remove Go migration code, rely solely on SQL migration 096 2026-04-06 02:52:20 +08:00
erio 05224be249 fix: use SQL migration for legacy purchase_subscription_url migration
Replace Go startup code with SQL migration 096 to migrate
purchase_subscription_url to custom_menu_items. Database migrations
run exactly once and are tracked by the migration system.
2026-04-06 02:49:46 +08:00
erio acf79ff832 fix: resolve frontend TypeScript build errors
- Remove unused ReceiptIcon/SoraIcon and sora_client_enabled references
- Fix AdminOrdersView pagination response property (data → items)
- Fix PaymentView null safety for amount (use validAmount computed)
- Add missing @stripe/stripe-js dependency
2026-04-06 02:39:07 +08:00
erio 225e8aaa97 fix: resolve golangci-lint errors — errcheck, gofmt, deprecated stripe API, unused func 2026-04-06 02:30:14 +08:00
erio 485b843637 fix: add PaymentOrderExpiryService param to provideCleanup test 2026-04-06 02:17:42 +08:00
erio 7a77ab2d09 chore: bump version to 0.1.108.3 2026-04-06 02:12:39 +08:00
erio 3703b5c08b refactor: migrate legacy purchase subscription to custom menu item
- Restore MigrateLegacyPurchaseURL auto-call on startup: converts old
  purchase_subscription_url into a custom menu item (id: migrated_purchase_subscription)
  and clears the legacy settings
- Delete PurchaseRouter.vue and PurchaseSubscriptionView.vue (replaced
  by existing CustomPageView.vue via custom menu system)
- /purchase route now exclusively serves the new built-in payment system
- Remove purchase_subscription_enabled from sidebar, router, settings UI,
  TypeScript types, and i18n keys
- Legacy purchase URL users will see their link as a custom menu entry
  after upgrade, editable in admin custom menu settings
2026-04-06 02:09:26 +08:00