|
@@ -1456,7 +1456,7 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService {
|
|
|
|
|
|
|
|
FsUser user = userService.selectFsUserByUserId(order.getUserId());
|
|
FsUser user = userService.selectFsUserByUserId(order.getUserId());
|
|
|
Map<String, BigDecimal> data = new HashMap<>();
|
|
Map<String, BigDecimal> data = new HashMap<>();
|
|
|
- if (user != null && StringUtils.isNotEmpty(user.getMaOpenId())) {
|
|
|
|
|
|
|
+ if (user != null && (StringUtils.isNotEmpty(user.getMaOpenId()) || StringUtils.isNotEmpty(user.getAppOpenId()))) {
|
|
|
if (param.getUserCouponId() != null && param.getUserCouponId() > 0l) {
|
|
if (param.getUserCouponId() != null && param.getUserCouponId() > 0l) {
|
|
|
FsUserCoupon userCoupon = userCouponService.selectFsUserCouponById(param.getUserCouponId());
|
|
FsUserCoupon userCoupon = userCouponService.selectFsUserCouponById(param.getUserCouponId());
|
|
|
if (userCoupon == null) {
|
|
if (userCoupon == null) {
|
|
@@ -3155,15 +3155,18 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService {
|
|
|
payConfig.setMchKey(fsPayConfig.getWxAppMchKey());
|
|
payConfig.setMchKey(fsPayConfig.getWxAppMchKey());
|
|
|
payConfig.setSubAppId(org.apache.commons.lang3.StringUtils.trimToNull(null));
|
|
payConfig.setSubAppId(org.apache.commons.lang3.StringUtils.trimToNull(null));
|
|
|
payConfig.setSubMchId(org.apache.commons.lang3.StringUtils.trimToNull(null));
|
|
payConfig.setSubMchId(org.apache.commons.lang3.StringUtils.trimToNull(null));
|
|
|
- payConfig.setKeyPath(null);
|
|
|
|
|
|
|
+ payConfig.setKeyPath(fsPayConfig.getWxAppKeyPath());
|
|
|
payConfig.setNotifyUrl(fsPayConfig.getWxAppNotifyUrl());
|
|
payConfig.setNotifyUrl(fsPayConfig.getWxAppNotifyUrl());
|
|
|
|
|
+ log.info("payConfig支付参数,{}:", payConfig);
|
|
|
wxPayService.setConfig(payConfig);
|
|
wxPayService.setConfig(payConfig);
|
|
|
WxPayUnifiedOrderRequest orderRequest = new WxPayUnifiedOrderRequest();
|
|
WxPayUnifiedOrderRequest orderRequest = new WxPayUnifiedOrderRequest();
|
|
|
orderRequest.setBody("药品订单支付");
|
|
orderRequest.setBody("药品订单支付");
|
|
|
- orderRequest.setOutTradeNo("store-"+storePayment.getPayCode());
|
|
|
|
|
|
|
+ orderRequest.setOutTradeNo("storeOrder-"+storePayment.getPayCode());
|
|
|
orderRequest.setTotalFee(WxPayUnifiedOrderRequest.yuanToFen(storePayment.getPayMoney().toString()));
|
|
orderRequest.setTotalFee(WxPayUnifiedOrderRequest.yuanToFen(storePayment.getPayMoney().toString()));
|
|
|
orderRequest.setTradeType("APP");
|
|
orderRequest.setTradeType("APP");
|
|
|
- orderRequest.setNotifyUrl(fsPayConfig.getNotifyUrlScrm());
|
|
|
|
|
|
|
+ orderRequest.setNotifyUrl(fsPayConfig.getWxAppNotifyUrl());
|
|
|
|
|
+ orderRequest.setSpbillCreateIp(IpUtils.getIpAddr(ServletUtils.getRequest()));
|
|
|
|
|
+ log.info("orderRequest请求参数,{}:", orderRequest);
|
|
|
//调用统一下单接口,获取"预支付交易会话标识"
|
|
//调用统一下单接口,获取"预支付交易会话标识"
|
|
|
try {
|
|
try {
|
|
|
Object result = wxPayService.createOrder(orderRequest);
|
|
Object result = wxPayService.createOrder(orderRequest);
|