|
|
@@ -1145,12 +1145,12 @@ public class FsStorePaymentScrmServiceImpl implements IFsStorePaymentScrmService
|
|
|
type = "wxApp";
|
|
|
}
|
|
|
//支付宝可以不需要appid(在没有appid的情况下)【ps:小程序的支付宝没传appid 就G】
|
|
|
- if ((PaymentMethodEnum.ALIPAY == payOrderParam.getPaymentMethod())
|
|
|
- && StringUtils.isBlank(payOrderParam.getAppId())) {
|
|
|
- String json = configService.selectConfigByKey("his.pay");
|
|
|
- PayConfigDTO payConfigDTO = JSONUtil.toBean(json, PayConfigDTO.class);
|
|
|
- payConfig.setType(payConfigDTO.getType());
|
|
|
- } else {
|
|
|
+// if ((PaymentMethodEnum.ALIPAY == payOrderParam.getPaymentMethod())
|
|
|
+// && StringUtils.isBlank(payOrderParam.getAppId())) {
|
|
|
+// String json = configService.selectConfigByKey("his.pay");
|
|
|
+// PayConfigDTO payConfigDTO = JSONUtil.toBean(json, PayConfigDTO.class);
|
|
|
+// payConfig.setType(payConfigDTO.getType());
|
|
|
+// } else {
|
|
|
if (StringUtils.isBlank(payOrderParam.getAppId())) {
|
|
|
throw new IllegalArgumentException("appId不能为空");
|
|
|
}
|
|
|
@@ -1173,7 +1173,7 @@ public class FsStorePaymentScrmServiceImpl implements IFsStorePaymentScrmService
|
|
|
payConfig.setAppId(fsCoursePlaySourceConfig.getAppid());
|
|
|
|
|
|
logger.debug("支付配置 his.pay: {}", payConfig);
|
|
|
- }
|
|
|
+// }
|
|
|
|
|
|
|
|
|
// FsPayConfig payConfig = JSONUtil.toBean(json, FsPayConfig.class);
|
|
|
@@ -1191,7 +1191,7 @@ public class FsStorePaymentScrmServiceImpl implements IFsStorePaymentScrmService
|
|
|
LiveOrderPayment liveOrderPayment = createLiveStorePayment(payConfig, user, payOrderParam);
|
|
|
BeanUtils.copyProperties(liveOrderPayment, storePayment);
|
|
|
} else {
|
|
|
- storePayment = createStorePaymentScrm(payConfig, user, payOrderParam);
|
|
|
+ storePayment = createStorePaymentScrm(payConfig, user, payOrderParam,merchantAppConfig.getMerchantId());
|
|
|
}
|
|
|
|
|
|
// 根据配置类型创建第三方支付订单
|
|
|
@@ -1305,7 +1305,7 @@ public class FsStorePaymentScrmServiceImpl implements IFsStorePaymentScrmService
|
|
|
order.setReqSeqId(payOrderParam.getBusinessType().getPrefix() + "-" + storePayment.getPayCode());
|
|
|
order.setTransAmt(storePayment.getPayMoney().toString());
|
|
|
order.setGoodsDesc(payOrderParam.getBusinessType().getDesc());
|
|
|
-
|
|
|
+ order.setAppId(payOrderParam.getAppId());
|
|
|
// 微信支付需要设置openid
|
|
|
if (isWechatPayment(payOrderParam.getPaymentMethod())) {
|
|
|
order.setOpenid(getOpenIdForPaymentMethod(user, payOrderParam.getPaymentMethod(), payConfig));
|
|
|
@@ -1429,7 +1429,7 @@ public class FsStorePaymentScrmServiceImpl implements IFsStorePaymentScrmService
|
|
|
/**
|
|
|
* 创建支付订单
|
|
|
*/
|
|
|
- private FsStorePaymentScrm createStorePaymentScrm(FsPayConfig payConfig, FsUserScrm user, PayOrderParam payOrderParam) {
|
|
|
+ private FsStorePaymentScrm createStorePaymentScrm(FsPayConfig payConfig, FsUserScrm user, PayOrderParam payOrderParam,String merchantId) {
|
|
|
String payCode = OrderCodeUtils.getOrderSn();
|
|
|
if (StringUtils.isEmpty(payCode)) {
|
|
|
throw new CustomException("订单生成失败,请重试");
|
|
|
@@ -1452,7 +1452,7 @@ public class FsStorePaymentScrmServiceImpl implements IFsStorePaymentScrmService
|
|
|
storePayment.setStoreId(payOrderParam.getStoreId());
|
|
|
storePayment.setUserId(user.getUserId());
|
|
|
storePayment.setBusinessId(payOrderParam.getOrderId().toString());
|
|
|
-
|
|
|
+ storePayment.setMerConfigId(Long.valueOf(merchantId));
|
|
|
// 设置openId(如果是微信支付)
|
|
|
if (isWechatPayment(payOrderParam.getPaymentMethod())) {
|
|
|
storePayment.setOpenId(getOpenIdForPaymentMethod(user, payOrderParam.getPaymentMethod(), payConfig));
|