|
|
@@ -2995,6 +2995,7 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService {
|
|
|
throw new CustomException("小程序没有配置商户信息");
|
|
|
}
|
|
|
MerchantAppConfig merchantAppConfig = merchantAppConfigMapper.selectMerchantAppConfigById(fsCoursePlaySourceConfig.getMerchantConfigId());
|
|
|
+ FsPayConfig fsPayConfig = JSON.parseObject(merchantAppConfig.getDataJson(), FsPayConfig.class);
|
|
|
String openId = null;
|
|
|
String appId = param.getAppId();
|
|
|
if (StringUtils.isNotBlank(appId)) {
|
|
|
@@ -3037,7 +3038,7 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService {
|
|
|
storePayment.setPayMoney(order.getPayMoney());
|
|
|
storePayment.setBusinessCode(order.getOrderCode());
|
|
|
storePayment.setCreateTime(new Date());
|
|
|
- storePayment.setPayTypeCode(!"appPay".equals(payConfigDTO.getType()) ? "weixin" : param.getPayType());
|
|
|
+ storePayment.setPayTypeCode(!"appPay".equals(merchantAppConfig.getMerchantType()) ? "weixin" : param.getPayType());
|
|
|
storePayment.setBusinessType(2);
|
|
|
storePayment.setRemark("药品订单支付");
|
|
|
storePayment.setOpenId(openId);
|
|
|
@@ -3052,7 +3053,7 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService {
|
|
|
//创建微信订单
|
|
|
WxPayConfig payConfig = new WxPayConfig();
|
|
|
SysConfig sysConfig = sysConfigMapper.selectConfigByConfigKey("his.pay");
|
|
|
- FsPayConfig fsPayConfig = new Gson().fromJson(sysConfig.getConfigValue(), FsPayConfig.class);
|
|
|
+// FsPayConfig fsPayConfig = new Gson().fromJson(sysConfig.getConfigValue(), FsPayConfig.class);
|
|
|
payConfig.setAppId(fsPayConfig.getAppId());
|
|
|
payConfig.setMchId(fsPayConfig.getWxMchId());
|
|
|
payConfig.setMchKey(fsPayConfig.getWxMchKey());
|
|
|
@@ -3136,11 +3137,10 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService {
|
|
|
mt.setAppId(appId);
|
|
|
storePaymentService.updateFsStorePayment(mt);
|
|
|
return R.ok().put("isPay", 0).put("data", result).put("type", "hf");
|
|
|
- } else if (payConfigDTO.getType().equals("appPay") && "wx".equals(param.getPayType())) {
|
|
|
+ } else if (merchantAppConfig.getMerchantType().equals("appPay") && "wx".equals(param.getPayType())) {
|
|
|
//创建微信订单
|
|
|
WxPayConfig payConfig = new WxPayConfig();
|
|
|
SysConfig sysConfig = sysConfigMapper.selectConfigByConfigKey("his.pay");
|
|
|
- FsPayConfig fsPayConfig = new Gson().fromJson(sysConfig.getConfigValue(), FsPayConfig.class);
|
|
|
payConfig.setAppId(appId);
|
|
|
payConfig.setMchId(fsPayConfig.getWxAppMchId());
|
|
|
payConfig.setMchKey(fsPayConfig.getWxAppMchKey());
|
|
|
@@ -3163,10 +3163,9 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService {
|
|
|
e.printStackTrace();
|
|
|
throw new CustomException("支付失败"+e.getMessage());
|
|
|
}
|
|
|
- } else if (payConfigDTO.getType().equals("appPay") && "ali".equals(param.getPayType())) {
|
|
|
+ } else if (merchantAppConfig.getMerchantType().equals("appPay") && "ali".equals(param.getPayType())) {
|
|
|
// 实例化客户端
|
|
|
SysConfig sysConfig = sysConfigMapper.selectConfigByConfigKey("his.pay");
|
|
|
- FsPayConfig fsPayConfig = new Gson().fromJson(sysConfig.getConfigValue(), FsPayConfig.class);
|
|
|
AlipayClient alipayClient = new DefaultAlipayClient("https://openapi.alipay.com/gateway.do", fsPayConfig.getAliAppId(), fsPayConfig.getAliPrivateKey(), "json", "utf-8", fsPayConfig.getAliPublicKey(), "RSA2");
|
|
|
|
|
|
// 构造请求参数以调用接口
|