135 Commits

Author SHA1 Message Date
97524da74d fix(wechat): use Response instead of missing json_response in callback
ServerEnv().json_reponse does not exist, causing 'NoneType' object
is not callable. Align with alipay_notify pattern: use aiohttp Response
directly with JSON string body.
2026-07-15 17:43:06 +08:00
7e37b00672 fix(wechat): don't block init on missing WXP_API_V3_KEY
API v3 key is only needed for callback verification, not payment creation.
- Remove init-time validation (was blocking all wechat payments)
- Gracefully degrade: set api_v3_key=None if invalid, warn at startup
- Raise clear error at callback time if key still missing
2026-07-15 17:40:27 +08:00
bf916b98ff fix(wechat): validate WXP_API_V3_KEY at init time
AES-256-GCM requires 32-byte key. 'None' placeholder is only 4 bytes,
causing ValueError during callback decryption instead of at startup.
Now fails fast with clear error if key is missing/invalid.
2026-07-15 17:29:19 +08:00
cae22f84be fix(wechat): convert yuan to fen for WeChat amount (×100)
WeChat amount.total is in fen (分), but user enters yuan (元).
int(0.01) = 0 which fails WeChat's minimum 1 fen validation.
Fix: int(amount * 100)
2026-07-15 17:25:47 +08:00
1a2d8f8f2d feat(wechat): switch from H5 to Native payment (QR code scan)
- Change API endpoint from /v3/pay/transactions/h5 to /v3/pay/transactions/native
- Remove scene_info (not needed for native mode)
- Return code_url instead of h5_url
- recharge.dspy: display QR code image via api.qrserver.com
- user_recharge.dspy: return both code_url and qr_url
2026-07-15 17:22:40 +08:00
0266f9fb65 fix(wechat): handle API errors instead of silently returning null h5_url
- Check HTTP status code, raise exception on non-200
- Raise exception if h5_url missing from response
- Fix description field to use .get() instead of direct key access
- Remove unreachable return None

Previously WeChat API errors (param errors, amount issues, etc.)
would return None, causing the frontend to show:
  https://token.opencomputing.cn/null
Now errors are properly raised and shown to the user.
2026-07-15 17:04:21 +08:00
ccee3ba12b feat: 启用微信支付和转账支付渠道
- recharge.ui: 下拉列表添加微信支付和转账支付选项
- user_recharge.dspy: 扩展provider校验,支持wechat/transfer
- wechat.py: 修复description字段兼容payment_name
- transfer.py: 导入DBPools + 修复tcode拼写错误
2026-07-15 13:45:21 +08:00
7a0e87e735 fix: get_pay_fee 返回 fee_rate 而非 fee_rate*amount,修复双重乘法
get_pay_fee() 返回 fee_rate*amount,但 create_payment()
又把返回值当 feerate 传给 new_log(),new_log() 内部又乘
一次 amount,导致 pay_fee = fee_rate * amount²。

修复:
- get_pay_fee() 改为只返回 fee_rate
- create_payment() 自己计算 fee = feerate * amount
- new_log() 传 feerate 而非 fee
2026-07-01 11:51:20 +08:00
a9c99305fc Revert "fix: sor_get_pay_feerate 加 ORDER BY + LIMIT 1 防非确定性取值"
This reverts commit 4ec1f12396fd2e2b697d473911a8d0f846caaf4d.
2026-07-01 11:49:46 +08:00
4ec1f12396 fix: sor_get_pay_feerate 加 ORDER BY + LIMIT 1 防非确定性取值
无 ORDER BY 时 MySQL 可能返回非确定的行顺序,
两次同参数调用取到不同费率。
2026-06-30 18:29:03 +08:00
69d503051f fix: payfee.fee_rate 费率精度 2→4 位小数
DB 迁移:
  ALTER TABLE payfee MODIFY COLUMN fee_rate DOUBLE(18,4) NOT NULL;
2026-06-30 18:06:33 +08:00
854a0fdc12 fix: payment_log.json 移除 Jinja2 {% if %} 块,CRUD json 文件必须为纯 JSON 2026-06-29 18:12:55 +08:00
50566ed576 fix: payment_log.json JSON 语法错误导致 xls2ui 崩溃
两处修复:
1. logined_userorgid 从 browserfields 内移到 params 层级
2. binds[0] 缺少开头 { 导致 JSON 解析失败 (line 25 column 9)
2026-06-29 17:31:19 +08:00
Hermes Agent
a6d0380903 feat: add i18n translations (zh/en/jp/ko) for all modules 2026-06-19 15:01:45 +08:00
Hermes Agent
9b2e414af5 chore: 添加json/build.sh脚本 2026-06-17 17:26:32 +08:00
1773bce216 feat: disable wechat payment channel, keep alipay only
- Remove wechat from provider options
- Set alipay as default payment channel
- Only alipay is currently enabled for unipay
2026-05-30 13:27:23 +08:00
1ae077df93 refactor(models): convert to json format per database-table-definition-spec 2026-05-27 13:23:34 +08:00
5a452c0052 feat: add load_path.py RBAC permission registration script 2026-05-27 13:16:11 +08:00
a688d3d562 fix: defer payment provider init to load_unipay(), graceful failure
- Move env var reading and key file open() from import-time CONF dict
  into _build_provider_conf() called during load_unipay()
- Each provider is wrapped in try/except — if env vars are missing,
  key files don't exist, or instantiation fails, the provider is
  set to None (disabled) and a warning is printed
- Program continues to start even if all payment channels fail
- Existing code already checks PROVIDERS[name] is None in all
  business functions (create_payment, notify handlers, etc.)
- Existing get_provider() in notify.py already returns None on
  instantiation error
2026-05-26 16:47:46 +08:00
b40300ad35 feat: add json table definitions for all models (converted from xlsx) 2026-05-21 12:46:36 +08:00
1dfa144611 bugfix 2026-03-25 11:51:14 +08:00
d827acccab bugfix 2026-03-18 13:01:43 +08:00
8acd990559 bugfix 2025-12-25 18:15:23 +08:00
8a44bc2fb8 bugfix 2025-12-25 18:10:05 +08:00
9b2e2e08df bugfix 2025-12-25 17:45:50 +08:00
321748973e bugfix 2025-12-25 17:37:26 +08:00
8859c41393 bugfix 2025-12-25 17:33:59 +08:00
6d99b854ff bugfix 2025-12-25 17:32:14 +08:00
4926f4ff4d bugfix 2025-12-25 17:15:43 +08:00
5d193acbbe bugfix 2025-12-25 17:13:30 +08:00
027693094b bugfix 2025-12-25 16:44:16 +08:00
ccc6264a7f bugfix 2025-12-25 16:41:43 +08:00
2530533792 bugfix 2025-12-25 16:39:27 +08:00
5a342b7deb bugfix 2025-12-25 16:34:27 +08:00
5e0129acf1 bugfix 2025-12-25 16:28:00 +08:00
74aa5b87b9 bugfix 2025-12-22 13:46:52 +08:00
cd66c915e1 bugfix 2025-12-22 13:45:02 +08:00
yumoqing
7e792e438c bugfix 2025-12-20 20:47:26 +08:00
yumoqing
cfd7fea195 bugfix 2025-12-20 20:47:08 +08:00
5748eb7d76 bugfix 2025-12-19 11:09:08 +08:00
728ae2813e bugfix 2025-12-19 11:04:56 +08:00
83439df2e6 bugfix 2025-12-19 10:57:28 +08:00
885c2a03ba bugfix 2025-12-18 15:56:56 +08:00
f101490df0 bugfix 2025-12-18 15:51:48 +08:00
9765acb850 bugfix 2025-12-18 15:46:34 +08:00
56bf87dfda bugfix 2025-12-18 15:44:53 +08:00
faac5c4113 bugfix 2025-12-18 15:29:38 +08:00
bde6ae9d75 bugfix 2025-12-18 15:26:58 +08:00
bd76c34b34 bugfix 2025-12-18 15:24:47 +08:00
3c94e3c7a4 bugfix 2025-12-18 14:16:35 +08:00