fix: 临时写死微信V3商户证书序列号
覆盖 club 表与 settings 中的 cert_serial_no,统一使用 apiclient_key 对应序列号。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -10,6 +10,10 @@ from jituan.services.club_resolver import get_club_miniapp_appid
|
|||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
# 临时写死:微信商户 API 证书序列号(与 apiclient_key.pem 对应)
|
||||||
|
# 后台 club 表 / settings 配置正确后可删除此覆盖
|
||||||
|
WX_V3_CERT_SERIAL_NO_OVERRIDE = '481784CF56E872D9D8122BAC64E6BC7390803582'
|
||||||
|
|
||||||
|
|
||||||
def _xml_text(root, tag, default=''):
|
def _xml_text(root, tag, default=''):
|
||||||
node = root.find(tag)
|
node = root.find(tag)
|
||||||
@@ -200,6 +204,11 @@ def club_id_from_order(order_id):
|
|||||||
return CLUB_ID_DEFAULT
|
return CLUB_ID_DEFAULT
|
||||||
|
|
||||||
|
|
||||||
|
def _apply_v3_cert_serial_override(cfg):
|
||||||
|
cfg['CERT_SERIAL_NO'] = WX_V3_CERT_SERIAL_NO_OVERRIDE
|
||||||
|
return cfg
|
||||||
|
|
||||||
|
|
||||||
def get_wechat_v3_config(club_id=None):
|
def get_wechat_v3_config(club_id=None):
|
||||||
"""
|
"""
|
||||||
微信 V3(转账/查单)配置。
|
微信 V3(转账/查单)配置。
|
||||||
@@ -222,10 +231,10 @@ def get_wechat_v3_config(club_id=None):
|
|||||||
club = Club.query.get(club_id=cid)
|
club = Club.query.get(club_id=cid)
|
||||||
except Club.DoesNotExist:
|
except Club.DoesNotExist:
|
||||||
logger.warning('club %s 不存在,回落全局 V3 支付配置', cid)
|
logger.warning('club %s 不存在,回落全局 V3 支付配置', cid)
|
||||||
return fallback
|
return _apply_v3_cert_serial_override(fallback)
|
||||||
|
|
||||||
cfg_json = club.config_json or {}
|
cfg_json = club.config_json or {}
|
||||||
return {
|
return _apply_v3_cert_serial_override({
|
||||||
'APPID': get_club_miniapp_appid(club) or (
|
'APPID': get_club_miniapp_appid(club) or (
|
||||||
fallback['APPID'] if cid == CLUB_ID_DEFAULT else ''
|
fallback['APPID'] if cid == CLUB_ID_DEFAULT else ''
|
||||||
),
|
),
|
||||||
@@ -256,7 +265,7 @@ def get_wechat_v3_config(club_id=None):
|
|||||||
or fallback['TRANSFER_SCENE_ID']
|
or fallback['TRANSFER_SCENE_ID']
|
||||||
),
|
),
|
||||||
'club_id': cid,
|
'club_id': cid,
|
||||||
}
|
})
|
||||||
|
|
||||||
|
|
||||||
def club_id_for_tixian_yonghuid(yonghuid):
|
def club_id_for_tixian_yonghuid(yonghuid):
|
||||||
|
|||||||
Reference in New Issue
Block a user