fix(支付): 修复金额计算精度问题
All checks were successful
Build docker and publish / build (20.15.1) (push) Successful in 6m45s

在epayPayment和CryptoSaaSPayment方法中,对转换后的金额进行四舍五入保留两位小数处理,确保支付金额精度准确
This commit is contained in:
shanshanzhong 2025-12-02 02:35:05 -08:00
parent 9987bd43fa
commit 6fba1d683a

View File

@ -275,6 +275,7 @@ func (l *PurchaseCheckoutLogic) epayPayment(config *payment.Payment, info *order
if err != nil { if err != nil {
return "", err return "", err
} }
amount = math.Round(amount*100) / 100
// Build notification URL for payment status callbacks // Build notification URL for payment status callbacks
notifyUrl := "" notifyUrl := ""
@ -317,6 +318,7 @@ func (l *PurchaseCheckoutLogic) CryptoSaaSPayment(config *payment.Payment, info
if err != nil { if err != nil {
return "", err return "", err
} }
amount = math.Round(amount*100) / 100
// Build notification URL for payment status callbacks // Build notification URL for payment status callbacks
notifyUrl := "" notifyUrl := ""