diff --git a/internal/logic/public/portal/purchaseCheckoutLogic.go b/internal/logic/public/portal/purchaseCheckoutLogic.go index 7fa5827..a132acb 100644 --- a/internal/logic/public/portal/purchaseCheckoutLogic.go +++ b/internal/logic/public/portal/purchaseCheckoutLogic.go @@ -271,10 +271,11 @@ func (l *PurchaseCheckoutLogic) epayPayment(config *payment.Payment, info *order client := epay.NewClient(epayConfig.Pid, epayConfig.Url, epayConfig.Key, epayConfig.Type) // Convert order amount to CNY using current exchange rate - amount, err := l.queryExchangeRate("CNY", info.Amount) - if err != nil { - return "", err - } + amount, err := l.queryExchangeRate("CNY", info.Amount) + if err != nil { + return "", err + } + amount = math.Round(amount*100) / 100 // Build notification URL for payment status callbacks notifyUrl := "" @@ -313,10 +314,11 @@ func (l *PurchaseCheckoutLogic) CryptoSaaSPayment(config *payment.Payment, info client := epay.NewClient(epayConfig.AccountID, epayConfig.Endpoint, epayConfig.SecretKey, epayConfig.Type) // Convert order amount to CNY using current exchange rate - amount, err := l.queryExchangeRate("CNY", info.Amount) - if err != nil { - return "", err - } + amount, err := l.queryExchangeRate("CNY", info.Amount) + if err != nil { + return "", err + } + amount = math.Round(amount*100) / 100 // Build notification URL for payment status callbacks notifyUrl := ""