fix: 星阙(xq)微信支付改读后台 club 表配置
移除 xq 强制回落 app_secrets 的逻辑,与星之界一致优先读 club 表; 字段为空时仍按项回落 settings,避免未配置时中断现网。 订单 fucha 查单同步使用 club 对应商户号。 回退: git reset --hard backup-before-xq-club-pay-20260710 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -541,7 +541,9 @@ class PaymentVerifyView(APIView):
|
||||
|
||||
try:
|
||||
# 调用微信订单查询接口
|
||||
trade_state, transaction_id = self._query_wechat_payment(dingdanid)
|
||||
trade_state, transaction_id = self._query_wechat_payment(
|
||||
dingdanid, club_id=getattr(dingdan, 'ClubID', None),
|
||||
)
|
||||
|
||||
if trade_state == 'SUCCESS':
|
||||
# 支付成功,执行本地更新
|
||||
@@ -682,14 +684,16 @@ class PaymentVerifyView(APIView):
|
||||
except Exception as e:
|
||||
logger.error(f'订单收支统计失败 {dingdan.OrderID}: {e}', exc_info=True)
|
||||
|
||||
def _query_wechat_payment(self, out_trade_no):
|
||||
def _query_wechat_payment(self, out_trade_no, club_id=None):
|
||||
"""
|
||||
调用微信支付订单查询接口,返回 (trade_state, transaction_id)
|
||||
若查询失败,抛出异常
|
||||
"""
|
||||
appid = settings.WEIXIN_APPID
|
||||
mch_id = settings.WEIXIN_MCHID
|
||||
key = settings.WEIXIN_SHANGHUMIYAO
|
||||
from jituan.services.wechat_pay import club_id_from_order, get_wechat_v2_config
|
||||
pay_cfg = get_wechat_v2_config(club_id or club_id_from_order(out_trade_no))
|
||||
appid = pay_cfg['appid']
|
||||
mch_id = pay_cfg['mch_id']
|
||||
key = pay_cfg['key']
|
||||
nonce_str = self._generate_nonce_str()
|
||||
|
||||
params = {
|
||||
|
||||
Reference in New Issue
Block a user