fix: 微信支付元转分改用 Decimal,修复 2.01 元被收 2 元
This commit is contained in:
@@ -21,6 +21,7 @@ from rest_framework.views import APIView
|
||||
|
||||
from utils.redis_lock import acquire_lock, release_lock
|
||||
from utils.wechat_v3 import build_authorization
|
||||
from utils.money import yuan_to_fen
|
||||
from gvsdsdk.fluent import db, func, FQ
|
||||
|
||||
from .models import TixianAutoRecord
|
||||
@@ -114,7 +115,7 @@ def _build_wx_transfer_body(wx_cfg, tixian_id, openid, yonghuid, leixing, shijid
|
||||
'out_bill_no': tixian_id,
|
||||
'transfer_scene_id': transfer_scene_id,
|
||||
'openid': openid,
|
||||
'transfer_amount': int(shijidaozhang * 100),
|
||||
'transfer_amount': yuan_to_fen(shijidaozhang),
|
||||
'transfer_remark': f'平台提现-{yonghuid}',
|
||||
'transfer_scene_report_infos': transfer_scene_report_infos,
|
||||
}
|
||||
|
||||
@@ -42,6 +42,7 @@ from rest_framework_simplejwt.authentication import JWTAuthentication
|
||||
from gvsdsdk.fluent import db, func, FQ
|
||||
|
||||
from utils.oss_utils import validate_image, upload_to_oss, delete_from_oss
|
||||
from utils.money import yuan_to_fen
|
||||
from utils.fadan_utils import check_fadan_qiangdan_eligible
|
||||
from utils.invitationcode_utils import CreateInvitationCode, VerifyInvitationCode
|
||||
from users.fadan_fenhong_utils import process_fadan_fenhong
|
||||
@@ -7774,7 +7775,7 @@ class KefuPlatformRefundView(APIView):
|
||||
|
||||
# 生成退款单号
|
||||
out_refund_no = self.generate_refund_no(dingdan_id)
|
||||
total_fee = int(float(jine) * 100)
|
||||
total_fee = yuan_to_fen(jine)
|
||||
refund_fee = total_fee
|
||||
refund_desc = '客服退款'
|
||||
|
||||
@@ -11820,7 +11821,7 @@ class FaKuanPayView(APIView):
|
||||
raise Exception('未知的支付类型')
|
||||
|
||||
nonce_str = ''.join(random.choices(string.ascii_letters + string.digits, k=32))
|
||||
total_fee = int(jine * 100)
|
||||
total_fee = yuan_to_fen(jine)
|
||||
trade_type = 'JSAPI'
|
||||
user_ip = self.get_client_ip()
|
||||
|
||||
@@ -12321,7 +12322,7 @@ class KaohePayView(APIView):
|
||||
raise Exception('未知支付类型')
|
||||
|
||||
nonce_str = ''.join(random.choices(string.ascii_letters + string.digits, k=32))
|
||||
total_fee = int(jine * 100)
|
||||
total_fee = yuan_to_fen(jine)
|
||||
trade_type = 'JSAPI'
|
||||
user_ip = self.get_client_ip()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user