fix(pay): 支付校验参数错误以及后台任务

This commit is contained in:
xingc
2025-05-09 19:32:49 +08:00
parent f7eff392b0
commit 72b40e4476
2 changed files with 18 additions and 12 deletions

View File

@@ -129,13 +129,13 @@ async def wechat_notify(
'status': base_schema.OrderStatusType.OK
})
result = {'status': 200, 'message': 'OK'}
background_tasks.add_task(actions_after_payment, notify_params=params)
background_tasks.add_task(actions_after_payment, notify_params=params, db_session=db_session)
else:
result = {'status': 400, 'message': '支付失败'}
record.update({
'status': base_schema.OrderStatusType.FAIL,
})
await db_crud.update(data=record, filters={'order_id': record['out_trade_no']})
await db_crud.update(data=record, filters={'order_id': record['order_id']})
return result