feat:0元支付
This commit is contained in:
1 parent
81f46a161d
commit
185917cebc
5 files changed
+14
-8
No files matched your search
+2
-1
@@ -251,7 +251,8 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService {
|
||||
|
||||
// 3. 生成预支付
|
||||
// 特殊情况:积分兑换时,可能支付金额为零
|
||||
if (order.getPayPrice() > 0) {
|
||||
// TODO 特殊需求,价格可以为0
|
||||
if (order.getPayPrice() >= 0) {
|
||||
createPayOrder(order, orderItems);
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -69,8 +69,9 @@ public class TradePriceServiceImpl implements TradePriceService {
|
||||
.buildCalculateResp(calculateReqBO, spuList, skuList);
|
||||
priceCalculators.forEach(calculator -> calculator.calculate(calculateReqBO, calculateRespBO));
|
||||
// 2.2 如果最终支付金额小于等于 0,则抛出业务异常
|
||||
// TODO 业务需要价格可以为0
|
||||
if (calculateReqBO.getPointActivityId() == null // 积分订单,允许支付金额为 0
|
||||
&& calculateRespBO.getPrice().getPayPrice() <= 0) {
|
||||
&& calculateRespBO.getPrice().getPayPrice() < 0) {
|
||||
log.error("[calculatePrice][价格计算不正确,请求 calculateReqDTO({}),结果 priceCalculate({})]",
|
||||
calculateReqBO, calculateRespBO);
|
||||
throw exception(PRICE_CALCULATE_PAY_PRICE_ILLEGAL);
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@ public class PayOrderCreateReqDTO implements Serializable {
|
||||
* 支付金额,单位:分
|
||||
*/
|
||||
@NotNull(message = "支付金额不能为空")
|
||||
@DecimalMin(value = "0", inclusive = false, message = "支付金额必须大于零")
|
||||
@DecimalMin(value = "0", inclusive = true, message = "支付金额必须大于零")
|
||||
private Integer price;
|
||||
|
||||
/**
|
||||
|
||||
+1
-1
@@ -63,7 +63,7 @@ public class PayOrderUnifiedReqDTO {
|
||||
* 支付金额,单位:分
|
||||
*/
|
||||
@NotNull(message = "支付金额不能为空")
|
||||
@DecimalMin(value = "0", inclusive = false, message = "支付金额必须大于零")
|
||||
@DecimalMin(value = "0", inclusive = true, message = "支付金额必须大于零")
|
||||
private Integer price;
|
||||
|
||||
/**
|
||||
|
||||
@@ -79,8 +79,8 @@ spring:
|
||||
redis:
|
||||
host: 127.0.0.1 # 地址
|
||||
port: 6379 # 端口
|
||||
database: 0 # 数据库索引
|
||||
password: 123456 # 密码,建议生产环境开启
|
||||
database: 10 # 数据库索引
|
||||
# password: 123456 # 密码,建议生产环境开启
|
||||
|
||||
--- #################### 定时任务相关配置 ####################
|
||||
|
||||
@@ -209,8 +209,12 @@ wx:
|
||||
# secret: 6f270509224a7ae1296bbf1c8cb97aed
|
||||
# appid: wxc4598c446f8a9cb3 # 测试号(Kongdy 提供的)
|
||||
# secret: 4a1a04e07f6a4a0751b39c3064a92c8b
|
||||
appid: wx66186af0759f47c9 # 测试号(puhui 提供的)
|
||||
secret: 3218bcbd112cbc614c7264ceb20144ac
|
||||
# 测试
|
||||
# appid: wx66186af0759f47c9
|
||||
# secret: 3218bcbd112cbc614c7264ceb20144ac
|
||||
# 正式
|
||||
appid: wx741ef9b42243284a
|
||||
secret: 3b211e4bf0eeaaf27c8a369bcd10c9fb
|
||||
config-storage:
|
||||
type: RedisTemplate # 采用 RedisTemplate 操作 Redis,会自动从 Spring 中获取
|
||||
key-prefix: wa # Redis Key 的前缀
|
||||
|
||||
Reference in new issue
Block a user