From dea671cc2291aa6571c1668b8c2704623deef1b7 Mon Sep 17 00:00:00 2001 From: chen-xin-zhi <3588068430@qq.com> Date: Fri, 4 Apr 2025 09:59:26 +0800 Subject: [PATCH] this is 4.2 update --- .../cultural/heritage/controller/global/GlobalController.java | 2 ++ .../cultural/heritage/controller/wx/WeChatPayController.java | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/cultural/heritage/controller/global/GlobalController.java b/src/main/java/com/cultural/heritage/controller/global/GlobalController.java index 5e91b7e..dedbc45 100644 --- a/src/main/java/com/cultural/heritage/controller/global/GlobalController.java +++ b/src/main/java/com/cultural/heritage/controller/global/GlobalController.java @@ -415,6 +415,8 @@ public class GlobalController { return ResultUtils.success(new BigDecimal(postagePrice).setScale(2, RoundingMode.HALF_UP)); } + + } diff --git a/src/main/java/com/cultural/heritage/controller/wx/WeChatPayController.java b/src/main/java/com/cultural/heritage/controller/wx/WeChatPayController.java index 9767702..432c185 100644 --- a/src/main/java/com/cultural/heritage/controller/wx/WeChatPayController.java +++ b/src/main/java/com/cultural/heritage/controller/wx/WeChatPayController.java @@ -34,6 +34,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.io.IOException; +import java.math.BigDecimal; /** * 微信小程序相关接口 @@ -87,7 +88,8 @@ public class WeChatPayController { if (!loginUser.getId().equals(order.getUserId())) { throw new BusinessException(ErrorCode.NO_AUTH_ERROR, "你不是该订单用户!"); } - PrepayWithRequestPaymentResponse response = weChatService.createPayment(String.valueOf(orderId), miniOpenId, order.getTotalAmount()); + BigDecimal total = order.getTotalAmount().add(order.getPostage()); + PrepayWithRequestPaymentResponse response = weChatService.createPayment(String.valueOf(orderId), miniOpenId, total); return ResultUtils.success(response); }