This commit is contained in:
aaron 2025-04-02 16:12:30 +08:00
parent 5b6459c220
commit 32d85cf692
2 changed files with 14 additions and 12 deletions

View File

@ -906,12 +906,13 @@ async def cancel_order(
db.commit()
wechat = WeChatClient()
await wechat.apply_refund(
order_id=order.orderid,
total_amount=int(float(order.final_amount) * 100) if not settings.DEBUG else 1, # 转换为分
reason="用户取消订单"
)
if order.final_amount > 0:
wechat = WeChatClient()
await wechat.apply_refund(
order_id=order.orderid,
total_amount=int(float(order.final_amount) * 100) if not settings.DEBUG else 1, # 转换为分
reason="用户取消订单"
)
# 发送企业微信消息
wecom_bot = WecomBot()
@ -1167,12 +1168,13 @@ async def deliveryman_cancel_order(
db.commit()
wechat = WeChatClient()
await wechat.apply_refund(
order_id=order.orderid,
total_amount=int(float(order.final_amount) * 100) if not settings.DEBUG else 1, # 转换为分
reason="配送员取消订单"
)
if order.final_amount > 0:
wechat = WeChatClient()
await wechat.apply_refund(
order_id=order.orderid,
total_amount=int(float(order.final_amount) * 100) if not settings.DEBUG else 1, # 转换为分
reason="配送员取消订单"
)
# 发送企业微信消息
wecom_bot = WecomBot()

Binary file not shown.