diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/order/impl/StoreOrderServiceImpl.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/order/impl/StoreOrderServiceImpl.java index b037cd499..dd91bd4b5 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/order/impl/StoreOrderServiceImpl.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/order/impl/StoreOrderServiceImpl.java @@ -1188,9 +1188,6 @@ public class StoreOrderServiceImpl extends ServiceImpl infoDOS = new ArrayList<>(); orderInfos.forEach(info -> { diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/support/pay/WxPayStrategy.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/support/pay/WxPayStrategy.java index 94ff9e5b2..a5f91de06 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/support/pay/WxPayStrategy.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/support/pay/WxPayStrategy.java @@ -47,28 +47,28 @@ public class WxPayStrategy implements IPayStrategy{ Long requiredTenantId = TenantContextHolder.getRequiredTenantId(); TenantDTO tenant = tenantApi.getTenant(requiredTenantId); InitOrderResponse response = new InitOrderResponse(); -// WxPayService wxPayService = wxPayOneAutoConfiguration.wxPayOneService(); -// Assert.notNull(wxPayService, "获取微信支付配置失败!"); -// WxPayUnifiedOrderV3Request wxPayRequest = new WxPayUnifiedOrderV3Request(); -// int sum = orderDO.getPayPrice().multiply(new BigDecimal("100")).intValue(); -// wxPayRequest.setAmount(new WxPayUnifiedOrderV3Request.Amount().setTotal(sum)); -// wxPayRequest.setDescription(tenant.getName()); -// wxPayRequest.setOutTradeNo(orderDO.getOrderId()); -// wxPayRequest.setNotifyUrl(payProperties.getNotifyUrl()); -// wxPayRequest.setPayer(new WxPayUnifiedOrderV3Request.Payer().setOpenid(openid)); -// wxPayRequest.setSceneInfo(new WxPayUnifiedOrderV3Request.SceneInfo().setPayerClientIp(ServletUtils.getClientIP(servletRequest))); -// wxPayRequest.setAppid(payProperties.getAppId()); -// wxPayRequest.setMchid(payProperties.getMchId()); -// try { -// WxPayUnifiedOrderV3Result wxPayUnifiedOrderV3Result = wxPayService.unifiedOrderV3(TradeTypeEnum.JSAPI, wxPayRequest); -// WxPayUnifiedOrderV3Result.JsapiResult jsapiResult = wxPayUnifiedOrderV3Result.getPayInfo(TradeTypeEnum.JSAPI, payProperties.getAppId(), payProperties.getMchId(), wxPayService.getConfig().getPrivateKey()); -// InitOrderResponse.JsapiResult jsapiResultNew = new InitOrderResponse.JsapiResult(); -// BeanUtils.copyProperties(jsapiResult, jsapiResultNew); -// response.setJsapiResult(jsapiResultNew); -// BeanUtils.copyProperties(wxPayUnifiedOrderV3Result, response); -// } catch (Exception e) { -// log.error(e.getMessage()); -// } + WxPayService wxPayService = wxPayOneAutoConfiguration.wxPayOneService(); + Assert.notNull(wxPayService, "获取微信支付配置失败!"); + WxPayUnifiedOrderV3Request wxPayRequest = new WxPayUnifiedOrderV3Request(); + int sum = orderDO.getPayPrice().multiply(new BigDecimal("100")).intValue(); + wxPayRequest.setAmount(new WxPayUnifiedOrderV3Request.Amount().setTotal(sum)); + wxPayRequest.setDescription(tenant.getName()); + wxPayRequest.setOutTradeNo(orderDO.getOrderId()); + wxPayRequest.setNotifyUrl(payProperties.getNotifyUrl()); + wxPayRequest.setPayer(new WxPayUnifiedOrderV3Request.Payer().setOpenid(openid)); + wxPayRequest.setSceneInfo(new WxPayUnifiedOrderV3Request.SceneInfo().setPayerClientIp(ServletUtils.getClientIP(servletRequest))); + wxPayRequest.setAppid(payProperties.getAppId()); + wxPayRequest.setMchid(payProperties.getMchId()); + try { + WxPayUnifiedOrderV3Result wxPayUnifiedOrderV3Result = wxPayService.unifiedOrderV3(TradeTypeEnum.JSAPI, wxPayRequest); + WxPayUnifiedOrderV3Result.JsapiResult jsapiResult = wxPayUnifiedOrderV3Result.getPayInfo(TradeTypeEnum.JSAPI, payProperties.getAppId(), payProperties.getMchId(), wxPayService.getConfig().getPrivateKey()); + InitOrderResponse.JsapiResult jsapiResultNew = new InitOrderResponse.JsapiResult(); + BeanUtils.copyProperties(jsapiResult, jsapiResultNew); + response.setJsapiResult(jsapiResultNew); + BeanUtils.copyProperties(wxPayUnifiedOrderV3Result, response); + } catch (Exception e) { + log.error(e.getMessage()); + } return response; }