diff --git a/app.py b/app.py index 31acce26..f326ae46 100755 --- a/app.py +++ b/app.py @@ -3786,10 +3786,14 @@ def wechat_h5_payment_callback(): return redirect(redirect_url) except Exception as e: - print(f"[微信H5支付] 回调处理失败: {e}") import traceback - traceback.print_exc() - return redirect(f'https://valuefrontier.cn/home/pages/account/subscription?wechat_pay_error=callback_failed') + error_detail = traceback.format_exc() + print(f"[微信H5支付] 回调处理失败: {e}") + print(f"[微信H5支付] 详细错误: {error_detail}") + # 临时:将错误信息编码后传递给前端,方便调试 + import urllib.parse + error_msg = urllib.parse.quote(str(e)[:100]) + return redirect(f'https://valuefrontier.cn/home/pages/account/subscription?wechat_pay_error=callback_failed&detail={error_msg}') @app.route('/api/payment/wechat/jsapi/create-order', methods=['POST'])