1
This commit is contained in:
@@ -391,13 +391,11 @@ def _get_wechat_client(
|
|||||||
if public_key and public_key_id:
|
if public_key and public_key_id:
|
||||||
wechatpay_args["public_key"] = public_key
|
wechatpay_args["public_key"] = public_key
|
||||||
wechatpay_args["public_key_id"] = public_key_id
|
wechatpay_args["public_key_id"] = public_key_id
|
||||||
logger.info("Using configured platform public key")
|
|
||||||
else:
|
else:
|
||||||
logger.info("No platform public key configured, will try to download")
|
logger.info("No platform public key configured, will try to download")
|
||||||
|
|
||||||
_wechat_client = WeChatPay(**wechatpay_args)
|
_wechat_client = WeChatPay(**wechatpay_args)
|
||||||
_wechat_mch_id = mch_id
|
_wechat_mch_id = mch_id
|
||||||
logger.info("WeChat Pay client initialized successfully")
|
|
||||||
return _wechat_client
|
return _wechat_client
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.exception(
|
logger.exception(
|
||||||
@@ -450,7 +448,6 @@ def _create_wechat_order(order: PaymentOrder, db_configs: dict[str, str]) -> str
|
|||||||
|
|
||||||
if code == 200 and hasattr(result, 'get') and result.get('code_url'):
|
if code == 200 and hasattr(result, 'get') and result.get('code_url'):
|
||||||
# 注意:微信返回的 code_url 可能需要进一步处理成二维码图片地址
|
# 注意:微信返回的 code_url 可能需要进一步处理成二维码图片地址
|
||||||
logger.info(f"WeChat order created successfully: order_no={order.order_no}")
|
|
||||||
return result.get('code_url')
|
return result.get('code_url')
|
||||||
else:
|
else:
|
||||||
logger.error(
|
logger.error(
|
||||||
|
|||||||
Reference in New Issue
Block a user