feat: club 表独立 mch_key 字段,后台明确区分 APIv2 收款与 APIv3 提现

- 新增 club.mch_key 列并迁移 config_json 历史数据,api_v3_key 保持独立
- club-manage 读写 mch_key;支付读 club.mch_key 优先,兼容 config_json 回落
- 提现查单返回商户号改读俱乐部 V3 配置;不影响其他业务逻辑

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
XingQue
2026-07-10 21:34:32 +08:00
parent 017d176790
commit 49ad57bbb2
6 changed files with 78 additions and 20 deletions

View File

@@ -43,6 +43,7 @@ class Command(BaseCommand):
'wx_secret': getattr(settings, 'WEIXIN_SECRET', ''),
'mch_id': getattr(settings, 'WEIXIN_MCHID', '') or wx_v3.get('MCHID', ''),
'pay_app_id': wx_v3.get('APPID', '') or getattr(settings, 'WEIXIN_APPID', ''),
'mch_key': getattr(settings, 'WEIXIN_SHANGHUMIYAO', ''),
'api_v3_key': wx_v3.get('API_V3_KEY', ''),
'cert_serial_no': wx_v3.get('CERT_SERIAL_NO', ''),
'private_key_path': wx_v3.get('PRIVATE_KEY_PATH', ''),
@@ -75,7 +76,7 @@ class Command(BaseCommand):
if v and not getattr(club, k, None):
setattr(club, k, v)
# V3 字段允许用 settings 补全(证书路径等)
for field in ('api_v3_key', 'cert_serial_no', 'private_key_path', 'platform_cert_dir', 'pay_app_id'):
for field in ('mch_key', 'api_v3_key', 'cert_serial_no', 'private_key_path', 'platform_cert_dir', 'pay_app_id'):
val = defaults.get(field)
if val and not getattr(club, field, None):
setattr(club, field, val)