Commit Graph
2428 Commits
Author SHA1 Message Date
erio ac00a0aeb3 fix(payment): full-replace config update + fix min/max defaults
- Payment config update is now full-replace (not patch): all fields sent every time
- 0 values for min/max/daily = clear (use default: min=1, max=unlimited)
- Payment page: provider-level limits override global, proper fallback chain
- Fix quick amounts disappearing when global min/max is empty
2026-04-07 01:11:20 +08:00
erio 6147e4c0ed fix(payment): return actual decrypted config values instead of masking
Admin API is authenticated; frontend handles visual masking via password
inputs + eye toggle. This allows the eye icon to reveal actual values.
2026-04-07 01:03:53 +08:00
erio ed03fbf7ba fix: add help_image_url/help_text to AdminPaymentConfig TypeScript types 2026-04-07 00:57:00 +08:00
erio a481724140 fix(payment): add missing help_image_url/help_text fields + fix config merge on update
- Add help_image_url and help_text to PaymentConfig, UpdateRequest, read/write logic
- Add these fields to frontend paymentPayload save and load
- Fix provider config update: merge new config with existing (preserves sensitive
  fields that frontend skips as ••••••••, prevents data loss on edit)
2026-04-07 00:55:13 +08:00
erio 8648950f44 fix(payment): card/link are Stripe sub-methods, not top-level providers
- Remove card/link from global allPaymentTypes (they belong inside Stripe provider)
- Resolve i18n labels for Stripe sub-methods in provider dialog and card
2026-04-07 00:46:11 +08:00
erio f906b5f1f3 feat(payment): add Link payment method for Stripe
- Add TypeLink payment type
- Stripe provider now supports card/alipay/wxpay/link
- Add Link i18n labels and PaymentMethodSelector styles
2026-04-07 00:32:25 +08:00
erio 55b526582b feat(payment): Stripe multi-method support + card type + hide single-type selector
- Add TypeCard payment type for bank card payments
- Stripe provider now supports card/alipay/wxpay payment methods
- Map payment types to Stripe payment_method_types (card, alipay, wechat_pay)
- Hide supported types selector for single-type providers (alipay/wxpay official)
- Add card i18n labels and PaymentMethodSelector styles
2026-04-07 00:23:54 +08:00
erio ec88ca6c57 fix(payment): add placeholder hint on per-provider limit inputs 2026-04-07 00:01:45 +08:00
erio b1a8252f25 feat(payment): independent callback URLs + sensitive field visibility toggle
- Split callback URLs into two independent inputs (notify/return each with own base URL + fixed path)
- Add eye icon toggle for sensitive fields (PKey etc.) to reveal/hide values
- Bump version to 0.1.108.35
2026-04-06 23:58:16 +08:00
erio adb6e64b5b chore: bump version to 0.1.108.34 2026-04-06 23:30:57 +08:00
erio 343b539261 chore: bump version to 0.1.108.33 2026-04-06 23:15:32 +08:00
erio 58e2c42754 chore: bump version to 0.1.108.32 2026-04-06 23:02:34 +08:00
erio a1d2babd7d chore: bump version to 0.1.108.31 2026-04-06 22:54:17 +08:00
erio eff86c9a72 fix(payment): return decrypted non-sensitive config on provider list
- Backend: add ListProviderInstancesWithConfig that decrypts config
  and masks sensitive fields (keys, secrets) as "••••••••"
- Frontend: pre-fill non-sensitive config values when editing provider
  (PID, API base URL, notify URL, return URL, channel IDs etc.)
- Sensitive fields left empty for user to re-enter if needed
2026-04-06 22:54:17 +08:00
erio d1fdb05d54 chore: bump version to 0.1.108.30 2026-04-06 22:34:27 +08:00
erio 072297fd08 chore: bump version to 0.1.108.29 2026-04-06 22:09:17 +08:00
erio c5864f5c19 chore: bump version to 0.1.108.28 2026-04-06 21:50:54 +08:00
erio 30943a9701 chore: bump version to 0.1.108.27 2026-04-06 21:37:46 +08:00
erio 4a10a31b34 chore: bump version to 0.1.108.26 2026-04-06 21:18:12 +08:00
erio 29c3670c62 fix(payment): remove paymentMode config, rename easypay to 跳转, add validation
Backend:
- Remove paymentMode config; determine mode by req.PaymentType directly
  (easypay=redirect/submit.php, alipay/wxpay=API/mapi.php)
- EasyPay.SupportedTypes() always returns [easypay, alipay, wxpay]
- Add validateProviderRequest() for create: name, providerKey, supportedTypes required

Frontend:
- Remove paymentMode dropdown from EasyPay config fields
- Show "跳转" label for easypay type in provider supported types toggle
- Add red * to required fields: provider name, provider key, supported types
- Add strict validation in handleSaveProvider before API call
- Add validation i18n keys for zh/en
2026-04-06 21:17:53 +08:00
erio 4e54d95645 chore: bump version to 0.1.108.25 2026-04-06 20:58:02 +08:00
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 fc6514c18b chore: bump version to 0.1.108.21 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 b7367c5b31 chore: bump version to 0.1.108.18 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 f90d0f86fd chore: bump version to 0.1.108.16 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 c577595f50 chore: bump version to 0.1.108.14 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 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 9b8317fc66 chore: bump version to 0.1.108.10 2026-04-06 16:04:20 +08:00
erio 1984a19285 chore: bump version to 0.1.108.9 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 329d3445fa chore: bump version to 0.1.108.7 2026-04-06 15:03:19 +08:00
erio fdc9c6d8b8 chore: bump version to 0.1.108.6 2026-04-06 14:52:16 +08:00
erio 22a3931984 chore: bump version to 0.1.108.5 2026-04-06 14:40:53 +08:00
erio fa00ad06d2 chore: bump version to 0.1.108.4 2026-04-06 14:27:10 +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 225e8aaa97 fix: resolve golangci-lint errors — errcheck, gofmt, deprecated stripe API, unused func 2026-04-06 02:30:14 +08:00