|
|
@ -6,6 +6,7 @@ import com.hfkj.common.exception.ErrorHelp; |
|
|
|
import com.hfkj.common.exception.SysCode; |
|
|
|
import com.hfkj.common.exception.SysCode; |
|
|
|
import com.hfkj.common.security.UserCenter; |
|
|
|
import com.hfkj.common.security.UserCenter; |
|
|
|
import com.hfkj.common.utils.ResponseMsgUtil; |
|
|
|
import com.hfkj.common.utils.ResponseMsgUtil; |
|
|
|
|
|
|
|
import com.hfkj.config.CommonSysConst; |
|
|
|
import com.hfkj.entity.BsMerPayConfig; |
|
|
|
import com.hfkj.entity.BsMerPayConfig; |
|
|
|
import com.hfkj.entity.BsOrderOutside; |
|
|
|
import com.hfkj.entity.BsOrderOutside; |
|
|
|
import com.hfkj.entity.BsUserCard; |
|
|
|
import com.hfkj.entity.BsUserCard; |
|
|
@ -103,8 +104,13 @@ public class OrderPayController { |
|
|
|
if (merPay == null) { |
|
|
|
if (merPay == null) { |
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "商户未配置支付"); |
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "商户未配置支付"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// appIdType 1: 公众号 2:小程序
|
|
|
|
|
|
|
|
if (body.getInteger("appIdType") != null && body.getInteger("appIdType") == 2) { |
|
|
|
|
|
|
|
body.put("appId", CommonSysConst.getSysConfig().getWechatMaAppid()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 请求支付渠道
|
|
|
|
// 请求支付渠道
|
|
|
|
Map<Object, Object> preorder = HuiPayService.preorder(merPay.getPayMerNo(), merPay.getPayMerKey(), body.getString("openId"), order); |
|
|
|
Map<Object, Object> preorder = HuiPayService.preorder(merPay.getPayMerNo(), merPay.getPayMerKey(), body.getString("appId"), body.getString("openId"), order); |
|
|
|
for (OrderChildModel orderChild : order.getOrderChildList()) { |
|
|
|
for (OrderChildModel orderChild : order.getOrderChildList()) { |
|
|
|
orderChild.setSettleAccount(merPay.getPayMerNo()); |
|
|
|
orderChild.setSettleAccount(merPay.getPayMerNo()); |
|
|
|
orderChild.setSettleAccountKey(merPay.getPayMerKey()); |
|
|
|
orderChild.setSettleAccountKey(merPay.getPayMerKey()); |
|
|
@ -146,7 +152,7 @@ public class OrderPayController { |
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "商户未配置支付"); |
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "商户未配置支付"); |
|
|
|
} |
|
|
|
} |
|
|
|
// 请求支付渠道
|
|
|
|
// 请求支付渠道
|
|
|
|
Map<Object, Object> preorder = HuiPayService.preorder(merPay.getPayMerNo(), merPay.getPayMerKey(), body.getString("openId"), order); |
|
|
|
Map<Object, Object> preorder = HuiPayService.preorder(merPay.getPayMerNo(), merPay.getPayMerKey(), null, body.getString("openId"), order); |
|
|
|
for (OrderChildModel orderChild : order.getOrderChildList()) { |
|
|
|
for (OrderChildModel orderChild : order.getOrderChildList()) { |
|
|
|
orderChild.setSettleAccount(merPay.getPayMerNo()); |
|
|
|
orderChild.setSettleAccount(merPay.getPayMerNo()); |
|
|
|
orderChild.setSettleAccountKey(merPay.getPayMerKey()); |
|
|
|
orderChild.setSettleAccountKey(merPay.getPayMerKey()); |
|
|
|