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); }