fix: 微信支付元转分改用 Decimal,修复 2.01 元被收 2 元

This commit is contained in:
XingQue
2026-06-26 01:53:28 +08:00
parent eb1fc6d2ae
commit f38f1216ea
6 changed files with 52 additions and 17 deletions

View File

@@ -33,6 +33,7 @@ from rest_framework.permissions import AllowAny, IsAuthenticated
from rest_framework_simplejwt.tokens import RefreshToken
from utils.oss_utils import upload_to_oss, delete_from_oss, get_oss_client
from utils.money import yuan_to_fen
from .utils import verify_shop_permission
from shop.utils import verify_shop_permission, update_dianpu_daily_stat
@@ -2673,7 +2674,7 @@ class ShopRefundView(APIView):
return {'code': 500, 'msg': '微信支付配置不完整'}
out_refund_no = self._generate_refund_no(order.OrderID)
total_fee = int(float(order.Amount or 0) * 100)
total_fee = yuan_to_fen(order.Amount or 0)
refund_fee = total_fee
params = {