|
@@ -5,6 +5,7 @@ import com.github.microservice.net.ResultContent;
|
|
|
import com.github.microservice.net.ResultMessage;
|
|
import com.github.microservice.net.ResultMessage;
|
|
|
import com.github.microservice.pay.client.model.AccountModel;
|
|
import com.github.microservice.pay.client.model.AccountModel;
|
|
|
import com.github.microservice.pay.client.product.miniApp.weChat.conf.WeChatMiniAppConf;
|
|
import com.github.microservice.pay.client.product.miniApp.weChat.conf.WeChatMiniAppConf;
|
|
|
|
|
+import com.github.microservice.pay.client.product.senseless.chinaumsSenseless.conf.ChinaumsSenselessConf;
|
|
|
import com.github.microservice.pay.client.ret.ResultState;
|
|
import com.github.microservice.pay.client.ret.ResultState;
|
|
|
import com.github.microservice.pay.client.service.PayProductAccountService;
|
|
import com.github.microservice.pay.client.service.PayProductAccountService;
|
|
|
import com.github.microservice.pay.client.type.PayProductChannelType;
|
|
import com.github.microservice.pay.client.type.PayProductChannelType;
|
|
@@ -588,9 +589,10 @@ public class ProjectPaySettingServiceImpl extends SuperService {
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
public ResultContent upsertPayAccount(String projectOid, PaymentType paymentType) {
|
|
public ResultContent upsertPayAccount(String projectOid, PaymentType paymentType) {
|
|
|
|
|
+ log.info("upsertPayAccount 维护支付中心的支付账号");
|
|
|
ProjectMainPaySetting projectMainPaySetting = projectMainPaySettingDao.findTopByProjectOidAndChannelType(projectOid, paymentType);
|
|
ProjectMainPaySetting projectMainPaySetting = projectMainPaySettingDao.findTopByProjectOidAndChannelType(projectOid, paymentType);
|
|
|
if (ObjectUtils.isEmpty(projectMainPaySetting)) {
|
|
if (ObjectUtils.isEmpty(projectMainPaySetting)) {
|
|
|
- log.error("upsertPayAccount 项目未配置");
|
|
|
|
|
|
|
+ log.error("upsertPayAccount 项目未配置; {} {}", paymentType.getRemark(), projectOid);
|
|
|
return ResultContent.buildFail("项目未配置");
|
|
return ResultContent.buildFail("项目未配置");
|
|
|
}
|
|
}
|
|
|
ProjectOrgPaySettingInfo entity = projectMainPaySetting.getPaySettingInfo();
|
|
ProjectOrgPaySettingInfo entity = projectMainPaySetting.getPaySettingInfo();
|
|
@@ -604,6 +606,7 @@ public class ProjectPaySettingServiceImpl extends SuperService {
|
|
|
AccountModel accountModel = new AccountModel();
|
|
AccountModel accountModel = new AccountModel();
|
|
|
accountModel.setName(payAccountName);
|
|
accountModel.setName(payAccountName);
|
|
|
|
|
|
|
|
|
|
+ String remark = "";
|
|
|
Boolean disable = Boolean.FALSE;
|
|
Boolean disable = Boolean.FALSE;
|
|
|
if (ObjectUtils.isNotEmpty(entity)) {
|
|
if (ObjectUtils.isNotEmpty(entity)) {
|
|
|
if (paymentType == PaymentType.WeChat) {
|
|
if (paymentType == PaymentType.WeChat) {
|
|
@@ -622,28 +625,34 @@ public class ProjectPaySettingServiceImpl extends SuperService {
|
|
|
// 银联无感支付
|
|
// 银联无感支付
|
|
|
accountModel.setProductChannelType(PayProductChannelType.ChinaumsSenseless);
|
|
accountModel.setProductChannelType(PayProductChannelType.ChinaumsSenseless);
|
|
|
|
|
|
|
|
- WxPayConfigModel model = (WxPayConfigModel) entity.getPayConfig();
|
|
|
|
|
-
|
|
|
|
|
- WeChatMiniAppConf appConf = new WeChatMiniAppConf();
|
|
|
|
|
|
|
+ FrictionlessUnionConfigModel model = (FrictionlessUnionConfigModel) entity.getPayConfig();
|
|
|
|
|
+ ChinaumsSenselessConf appConf = new ChinaumsSenselessConf();
|
|
|
appConf.setAppId(model.getAppId());
|
|
appConf.setAppId(model.getAppId());
|
|
|
- appConf.setMchId(model.getMchId());
|
|
|
|
|
- appConf.setMchSerialNo(model.getMchSerialNo());
|
|
|
|
|
- appConf.setPriKeyPath(model.getPrivateKeyStr());
|
|
|
|
|
- appConf.setApiV3KeyPath(model.getApiV3Key());
|
|
|
|
|
- appConf.setNotifyUrl(model.getNotifyUrl());
|
|
|
|
|
accountModel.setConf(appConf);
|
|
accountModel.setConf(appConf);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // 查看平台支付产品状态
|
|
|
|
|
- PayChannelConfig channelConfig = payChannelConfigDao.findTopByPaymentType(paymentType);
|
|
|
|
|
- if (ObjectUtils.isNotEmpty(channelConfig)) {
|
|
|
|
|
- if (channelConfig.getState() == null || channelConfig.getState() != DataState.Enable) {
|
|
|
|
|
- disable = Boolean.FALSE;
|
|
|
|
|
|
|
+ if (!disable) {
|
|
|
|
|
+ // 机构配置为开启
|
|
|
|
|
+ if (entity.getState() == null || entity.getState() != DataState.Enable) {
|
|
|
|
|
+ disable = Boolean.TRUE;
|
|
|
|
|
+ remark = "机构配置未启用";
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (!disable) {
|
|
|
|
|
+ // 查看平台支付产品状态
|
|
|
|
|
+ PayChannelConfig channelConfig = payChannelConfigDao.findTopByPaymentType(paymentType);
|
|
|
|
|
+ if (ObjectUtils.isNotEmpty(channelConfig)) {
|
|
|
|
|
+ if (channelConfig.getState() == null || channelConfig.getState() != DataState.Enable) {
|
|
|
|
|
+ disable = Boolean.FALSE;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ remark = "平台支付产品未启用";
|
|
|
|
|
+ disable = Boolean.TRUE;
|
|
|
|
|
+ }
|
|
|
} else {
|
|
} else {
|
|
|
|
|
+ remark = "平台支付产品不存在";
|
|
|
disable = Boolean.TRUE;
|
|
disable = Boolean.TRUE;
|
|
|
}
|
|
}
|
|
|
- } else {
|
|
|
|
|
- disable = Boolean.TRUE;
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (!disable) {
|
|
if (!disable) {
|
|
@@ -651,13 +660,16 @@ public class ProjectPaySettingServiceImpl extends SuperService {
|
|
|
ProjectPaySetting projectPaySetting = projectPaySettingDao.findTopByProjectOidAndChannelType(projectOid, paymentType);
|
|
ProjectPaySetting projectPaySetting = projectPaySettingDao.findTopByProjectOidAndChannelType(projectOid, paymentType);
|
|
|
if (projectPaySetting.getState() == null || projectPaySetting.getState() == DataState.Disable) {
|
|
if (projectPaySetting.getState() == null || projectPaySetting.getState() == DataState.Disable) {
|
|
|
disable = Boolean.TRUE;
|
|
disable = Boolean.TRUE;
|
|
|
|
|
+ remark = "项目上支付渠道未启用";
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
// 不可用
|
|
// 不可用
|
|
|
disable = Boolean.TRUE;
|
|
disable = Boolean.TRUE;
|
|
|
|
|
+ remark = "关联的主账户信息不存在";
|
|
|
}
|
|
}
|
|
|
accountModel.setDisable(disable);
|
|
accountModel.setDisable(disable);
|
|
|
|
|
+ accountModel.setRemark(remark);
|
|
|
com.github.microservice.pay.client.ret.ResultContent<Void> resultContent = payProductAccountService.upsert(accountModel);
|
|
com.github.microservice.pay.client.ret.ResultContent<Void> resultContent = payProductAccountService.upsert(accountModel);
|
|
|
if (resultContent.getState() == ResultState.Success) {
|
|
if (resultContent.getState() == ResultState.Success) {
|
|
|
log.info("更新支付产品账户成功...");
|
|
log.info("更新支付产品账户成功...");
|