1. 重构支付宝支付
This commit is contained in:
2026-03-28 16:27:19 +08:00
parent c27371c640
commit 967da9e95e
10 changed files with 126 additions and 107 deletions

View File

@@ -161,6 +161,10 @@ public class AliPayAccountConfigServiceImpl extends BaseServiceImpl<AliPayAccoun
@Override
public AliPayAccountConfig getDefault() {
return getOne(Wrappers.<AliPayAccountConfig>lambdaQuery().eq(AliPayAccountConfig::getStatus, 1));
AliPayAccountConfig config = getOne(Wrappers.<AliPayAccountConfig>lambdaQuery().eq(AliPayAccountConfig::getStatus, 1));
if (config == null) {
throw new ServiceException("该商户号尚未接入");
}
return config;
}
}

View File

@@ -70,7 +70,7 @@ public class AliPayServiceImpl implements IAliPayService {
if (aliPayAccountConfig == null) {
throw new ServiceException("该商户号尚未接入");
}
if (aliPayAccountConfig.getStatus().intValue() != 1) {
if (aliPayAccountConfig.getStatus() != 1) {
throw new ServiceException("该商户号已暂停交易");
}
if (StringUtil.isBlank(notifyUrl)) {

View File

@@ -177,6 +177,10 @@ public class WxPayAccountConfigServiceImpl extends BaseServiceImpl<WxPayAccountC
@Override
public WxPayAccountConfig getDefault() {
return getOne(Wrappers.<WxPayAccountConfig>lambdaQuery().eq(WxPayAccountConfig::getStatus, 1));
WxPayAccountConfig config = getOne(Wrappers.<WxPayAccountConfig>lambdaQuery().eq(WxPayAccountConfig::getStatus, 1));
if (config == null) {
throw new ServiceException("该商户号尚未接入");
}
return config;
}
}