diff --git a/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/AbstractPayClient.java b/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/AbstractPayClient.java index 06e8774dd..eb3e74777 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/AbstractPayClient.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/AbstractPayClient.java @@ -46,7 +46,7 @@ public abstract class AbstractPayClient implemen */ public final void init() { doInit(); - log.info("[init][配置({}) 初始化完成]", config); + log.info("[init][客户端({}) 初始化完成]", getId()); } /** @@ -59,7 +59,7 @@ public abstract class AbstractPayClient implemen if (config.equals(this.config)) { return; } - log.info("[refresh][配置({})发生变化,重新初始化]", config); + log.info("[refresh][客户端({})发生变化,重新初始化]", getId()); this.config = config; // 初始化 this.init(); diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/app/vo/PayAppBaseVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/app/vo/PayAppBaseVO.java index bf366119c..45f29360f 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/app/vo/PayAppBaseVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/app/vo/PayAppBaseVO.java @@ -29,7 +29,7 @@ public class PayAppBaseVO { @Schema(description = "支付结果的回调地址", requiredMode = Schema.RequiredMode.REQUIRED, example = "http://127.0.0.1:48080/pay-callback") @NotNull(message = "支付结果的回调地址不能为空") @URL(message = "支付结果的回调地址必须为 URL 格式") - private String payNotifyUrl; + private String orderNotifyUrl; @Schema(description = "退款结果的回调地址", requiredMode = Schema.RequiredMode.REQUIRED, example = "http://127.0.0.1:48080/refund-callback") @NotNull(message = "退款结果的回调地址不能为空") diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/order/PayOrderServiceImpl.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/order/PayOrderServiceImpl.java index fd15f7821..e2148f4db 100755 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/order/PayOrderServiceImpl.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/order/PayOrderServiceImpl.java @@ -155,7 +155,7 @@ public class PayOrderServiceImpl implements PayOrderService { // 商户相关的字段 .setOutTradeNo(orderExtension.getNo()) // 注意,此处使用的是 PayOrderExtensionDO.no 属性! .setSubject(order.getSubject()).setBody(order.getBody()) - .setNotifyUrl(genChannelPayNotifyUrl(channel)) + .setNotifyUrl(genChannelOrderNotifyUrl(channel)) .setReturnUrl(reqVO.getReturnUrl()) // 订单相关字段 .setPrice(order.getPrice()).setExpireTime(order.getExpireTime()); @@ -205,7 +205,7 @@ public class PayOrderServiceImpl implements PayOrderService { * @param channel 支付渠道 * @return 支付渠道的回调地址 配置地址 + "/" + channel id */ - private String genChannelPayNotifyUrl(PayChannelDO channel) { + private String genChannelOrderNotifyUrl(PayChannelDO channel) { return payProperties.getOrderNotifyUrl() + "/" + channel.getId(); } diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/refund/PayRefundServiceImpl.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/refund/PayRefundServiceImpl.java index 6eb93e0bb..7914b70f6 100755 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/refund/PayRefundServiceImpl.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/refund/PayRefundServiceImpl.java @@ -134,7 +134,7 @@ public class PayRefundServiceImpl implements PayRefundService { .setRefundPrice(reqDTO.getPrice()) .setOutTradeNo(orderExtension.getNo()) .setOutRefundNo(refund.getNo()) - .setNotifyUrl(genChannelPayNotifyUrl(channel)) + .setNotifyUrl(genChannelRefundNotifyUrl(channel)) .setReason(reqDTO.getReason()); PayRefundRespDTO refundRespDTO = client.unifiedRefund(unifiedReqDTO); // TODO 增加一个 channelErrorCode、channelErrorMsg 字段 // 2.3 处理退款返回 @@ -182,7 +182,7 @@ public class PayRefundServiceImpl implements PayRefundService { * @param channel 支付渠道 * @return 支付渠道的回调地址 配置地址 + "/" + channel id */ - private String genChannelPayNotifyUrl(PayChannelDO channel) { + private String genChannelRefundNotifyUrl(PayChannelDO channel) { return payProperties.getRefundNotifyUrl() + "/" + channel.getId(); } diff --git a/yudao-module-pay/yudao-module-pay-biz/src/test/java/cn/iocoder/yudao/module/pay/service/app/PayAppServiceTest.java b/yudao-module-pay/yudao-module-pay-biz/src/test/java/cn/iocoder/yudao/module/pay/service/app/PayAppServiceTest.java index e90b84685..f25bf8942 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/test/java/cn/iocoder/yudao/module/pay/service/app/PayAppServiceTest.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/test/java/cn/iocoder/yudao/module/pay/service/app/PayAppServiceTest.java @@ -54,7 +54,7 @@ public class PayAppServiceTest extends BaseDbUnitTest { // 准备参数 PayAppCreateReqVO reqVO = randomPojo(PayAppCreateReqVO.class, o -> o.setStatus((RandomUtil.randomEle(CommonStatusEnum.values()).getStatus())) - .setPayNotifyUrl(randomURL()) + .setOrderNotifyUrl(randomURL()) .setRefundNotifyUrl(randomURL())); // 调用 @@ -73,7 +73,7 @@ public class PayAppServiceTest extends BaseDbUnitTest { // 准备参数 PayAppUpdateReqVO reqVO = randomPojo(PayAppUpdateReqVO.class, o -> { o.setStatus(CommonStatusEnum.ENABLE.getStatus()); - o.setPayNotifyUrl(randomURL()).setRefundNotifyUrl(randomURL()); + o.setOrderNotifyUrl(randomURL()).setRefundNotifyUrl(randomURL()); o.setId(dbApp.getId()); // 设置更新的 ID }); diff --git a/yudao-ui-admin/src/views/pay/app/index.vue b/yudao-ui-admin/src/views/pay/app/index.vue index c0494fa24..b027e2c26 100644 --- a/yudao-ui-admin/src/views/pay/app/index.vue +++ b/yudao-ui-admin/src/views/pay/app/index.vue @@ -197,8 +197,8 @@ - - + + @@ -259,7 +259,7 @@ export default { rules: { name: [{required: true, message: "应用名不能为空", trigger: "blur"}], status: [{required: true, message: "开启状态不能为空", trigger: "blur"}], - payNotifyUrl: [{required: true, message: "支付结果的回调地址不能为空", trigger: "blur"}], + orderNotifyUrl: [{required: true, message: "支付结果的回调地址不能为空", trigger: "blur"}], refundNotifyUrl: [{required: true, message: "退款结果的回调地址不能为空", trigger: "blur"}], }, // 数据字典 @@ -319,7 +319,7 @@ export default { name: undefined, status: undefined, remark: undefined, - payNotifyUrl: undefined, + orderNotifyUrl: undefined, refundNotifyUrl: undefined, }; this.resetForm("form");