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

@@ -38,6 +38,7 @@ from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentClo
from tencentcloud.sts.v20180813 import sts_client, models
from utils.weixin_broadcast import WeixinBroadcastSender
from utils.money import yuan_to_fen
from utils.chat_utils import _send_group_message, _subscribe_users_to_group, establish_order_chat
from utils.fadan_utils import check_fadan_qiangdan_eligible
@@ -886,7 +887,7 @@ class CreateOrderView(APIView):
nonce_str = ''.join(random.choices(string.ascii_letters + string.digits, k=32))
# 金额(单位:分)
total_fee = int(float(jine) * 100)
total_fee = yuan_to_fen(jine)
# 交易类型
trade_type = 'JSAPI'
@@ -5662,7 +5663,7 @@ class AdTongYiTuiKuanPingTai(APIView):
# 生成退款单号
refund_id = f"TK{int(time.time())}{random.randint(1000, 9999)}"
total_fee_in_fen = int(float(jine) * 100)
total_fee_in_fen = yuan_to_fen(jine)
# 构造请求参数
refund_data = {