mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-25 00:15:06 +08:00
【功能优化】支付:支付应用,增加 appKey 标识,用于不同接入方的标识
This commit is contained in:
@ -101,7 +101,7 @@ public interface TradeOrderConvert {
|
||||
default PayOrderCreateReqDTO convert(TradeOrderDO order, List<TradeOrderItemDO> orderItems,
|
||||
TradeOrderProperties orderProperties) {
|
||||
PayOrderCreateReqDTO createReqDTO = new PayOrderCreateReqDTO()
|
||||
.setAppKey(orderProperties.getAppKey()).setUserIp(order.getUserIp());
|
||||
.setAppKey(orderProperties.getPayAppKey()).setUserIp(order.getUserIp());
|
||||
// 商户相关字段
|
||||
createReqDTO.setMerchantOrderId(String.valueOf(order.getId()));
|
||||
String subject = orderItems.get(0).getSpuName();
|
||||
|
@ -1,5 +1,6 @@
|
||||
package cn.iocoder.yudao.module.trade.framework.order.config;
|
||||
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@ -19,17 +20,15 @@ import java.time.Duration;
|
||||
@Validated
|
||||
public class TradeOrderProperties {
|
||||
|
||||
/**
|
||||
* 默认应用标识
|
||||
*/
|
||||
private static final String APP_KEY_DEFAULT = "mall";
|
||||
private static final String PAY_APP_KEY_DEFAULT = "mall";
|
||||
|
||||
/**
|
||||
* 应用标识,用于区分不同的应用程序
|
||||
* 通过注解@NotNull确保应用标识不能为空
|
||||
* 支付应用标识
|
||||
*
|
||||
* 在 pay 模块的 [支付管理 -> 应用信息] 里添加
|
||||
*/
|
||||
@NotNull(message = "应用标识不能为空")
|
||||
private String appKey = APP_KEY_DEFAULT;
|
||||
@NotEmpty(message = "Pay 应用标识不能为空")
|
||||
private String payAppKey = PAY_APP_KEY_DEFAULT;
|
||||
|
||||
/**
|
||||
* 支付超时时间
|
||||
|
@ -99,7 +99,7 @@ public class TradeOrderUpdateServiceTest extends BaseDbUnitTest {
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() {
|
||||
when(tradeOrderProperties.getAppKey()).thenReturn("demo");
|
||||
when(tradeOrderProperties.getPayAppKey()).thenReturn("mall");
|
||||
when(tradeOrderProperties.getPayExpireTime()).thenReturn(Duration.ofDays(1));
|
||||
when(tradeNoRedisDAO.generate(anyString())).thenReturn(IdUtil.randomUUID());
|
||||
}
|
||||
|
Reference in New Issue
Block a user