From 3887287e4c11d32049f910dcce13a6b1e1e40cab Mon Sep 17 00:00:00 2001 From: huanghongfa <huanghongfa123456> Date: 星期二, 20 四月 2021 09:29:19 +0800 Subject: [PATCH] 小程序对接微信支付 --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopOrderServiceImpl.java | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopOrderServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopOrderServiceImpl.java index feff4a9..12ec2ce 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopOrderServiceImpl.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopOrderServiceImpl.java @@ -9,6 +9,7 @@ import com.panzhihua.common.model.dtos.PageDTO; import com.panzhihua.common.model.dtos.shop.*; import com.panzhihua.common.model.vos.R; +import com.panzhihua.common.utlis.WxPayUtils; import com.panzhihua.service_community.dao.ComShopOrderDAO; import com.panzhihua.service_community.model.dos.ComShopOrderDO; import com.panzhihua.common.model.vos.R; @@ -54,6 +55,7 @@ private ComShopOrderGoodsDAO comShopOrderGoodsDAO; @Resource private ComShopOrderDAO comShopOrderDAO; + /** * 订单预览 @@ -265,7 +267,6 @@ //创建订单操作记录 ComShopOrderOperateDO orderOperateDO = new ComShopOrderOperateDO(); orderOperateDO.setOrderNo(orderNo); - orderOperateDO.setOperationType(ComShopOrderOperateDO.operationType.create); orderOperateDO.setOperationTime(new Date()); if(StringUtils.isNotEmpty(orderCreateDTO.getPhone())){ @@ -279,6 +280,14 @@ shopOrderVO.setOrderNo(orderNo); shopOrderVO.setOrderTotal(orderTotal); + + try { + //调用wx支付 + String xml = WxPayUtils.getUnifiedorder("",orderCreateDTO.getOpenId(),orderNo,orderTotal); + log.info("微信支付返回参数:" + xml); + }catch (Exception e){ + log.error("调用微信支付异常,异常原因:" + e.getMessage()); + } return R.ok(shopOrderVO); } -- Gitblit v1.7.1