微信支付回调修复

This commit is contained in:
ahao 2025-03-13 10:31:40 +08:00
parent 317e1e8bee
commit 1ff60433a3

View File

@ -325,11 +325,11 @@ async def wxpay_notify(request: Request):
except Exception as e: except Exception as e:
logging.error(f"回调处理异常: {str(e)}", exc_info=True) logging.error(f"回调处理异常: {str(e)}", exc_info=True)
if connection: # if connection:
connection.rollback() # connection.rollback()
return JSONResponse(content={"code": "FAIL", "message": "系统错误"}, status_code=500) return JSONResponse(content={"code": "FAIL", "message": "系统错误"}, status_code=500)
finally: # finally:
if cursor: # if cursor:
cursor.close() # cursor.close()
if connection: # if connection:
connection.close() # connection.close()