diff --git a/jsowell-admin/src/main/java/com/jsowell/api/uniapp/customer/PayController.java b/jsowell-admin/src/main/java/com/jsowell/api/uniapp/customer/PayController.java index 25c6236f8..f1a1b0112 100644 --- a/jsowell-admin/src/main/java/com/jsowell/api/uniapp/customer/PayController.java +++ b/jsowell-admin/src/main/java/com/jsowell/api/uniapp/customer/PayController.java @@ -216,7 +216,7 @@ public class PayController extends BaseController { logger.info("微信退款回调接口 body:{}", JSON.toJSONString(body)); RestApiResponse response; try { - orderService.wechatPayRefundCallback(request, body); + // orderService.wechatPayRefundCallback(request, body); response = new RestApiResponse<>(); } catch (BusinessException e) { logger.warn("微信退款回调接口warn", e); @@ -245,7 +245,7 @@ public class PayController extends BaseController { } dto.setMemberId(memberId); dto.setRefundType("2"); - orderService.weChatRefund(dto); + // orderService.weChatRefund(dto); response = new RestApiResponse<>(); } catch (BusinessException e) { logger.warn("微信退款接口 warn", e); diff --git a/jsowell-admin/src/main/java/com/jsowell/service/MemberService.java b/jsowell-admin/src/main/java/com/jsowell/service/MemberService.java index a7fe95ed3..3ae05dee1 100644 --- a/jsowell-admin/src/main/java/com/jsowell/service/MemberService.java +++ b/jsowell-admin/src/main/java/com/jsowell/service/MemberService.java @@ -730,14 +730,14 @@ public class MemberService { memberInvoiceTitleService.deleteMemberInvoiceTitleById(Long.valueOf(dto.getTitleId())); } - public Map rechargeBalance(WeixinPayDTO dto) throws Exception { - PaymentScenarioDTO paymentScenarioDTO = new PaymentScenarioDTO(); - paymentScenarioDTO.setType(ScenarioEnum.BALANCE.getValue()); - paymentScenarioDTO.setMemberId(dto.getMemberId()); - dto.setAttach(JSON.toJSONString(paymentScenarioDTO)); - dto.setDescription("会员充值余额"); - return orderService.weixinPayV3(dto); - } + // public Map rechargeBalance(WeixinPayDTO dto) throws Exception { + // PaymentScenarioDTO paymentScenarioDTO = new PaymentScenarioDTO(); + // paymentScenarioDTO.setType(ScenarioEnum.BALANCE.getValue()); + // paymentScenarioDTO.setMemberId(dto.getMemberId()); + // dto.setAttach(JSON.toJSONString(paymentScenarioDTO)); + // dto.setDescription("会员充值余额"); + // return orderService.weixinPayV3(dto); + // } /** * 使用汇付支付充值余额 diff --git a/jsowell-admin/src/main/java/com/jsowell/service/OrderService.java b/jsowell-admin/src/main/java/com/jsowell/service/OrderService.java index fd4d3187d..56a54097d 100644 --- a/jsowell-admin/src/main/java/com/jsowell/service/OrderService.java +++ b/jsowell-admin/src/main/java/com/jsowell/service/OrderService.java @@ -317,9 +317,9 @@ public class OrderService { * @return * @throws Exception */ - public Map weixinPayV3(WeixinPayDTO dto) throws Exception { - return wechatPayService.weixinPayV3(dto); - } + // public Map weixinPayV3(WeixinPayDTO dto) throws Exception { + // return wechatPayService.weixinPayV3(dto); + // } /** * 用户停止充电 @@ -388,10 +388,10 @@ public class OrderService { * * @param dto */ - public void weChatRefund(ApplyRefundDTO dto) { - log.info("微信退款接口 param:{}", JSON.toJSONString(dto)); - orderBasicInfoService.weChatRefund(dto); - } + // public void weChatRefund(ApplyRefundDTO dto) { + // log.info("微信退款接口 param:{}", JSON.toJSONString(dto)); + // orderBasicInfoService.weChatRefund(dto); + // } /** * 汇付退款 @@ -543,7 +543,7 @@ public class OrderService { */ public void wechatPayRefundCallback(HttpServletRequest request, WechatPayNotifyParameter body) throws Exception { // 获取微信退款成功返回的信息 - Map map = wechatPayService.wechatPayRefundCallbackInfo(request, body); + // Map map = wechatPayService.wechatPayRefundCallbackInfo(request, body); } /** diff --git a/jsowell-admin/src/main/java/com/jsowell/service/TempService.java b/jsowell-admin/src/main/java/com/jsowell/service/TempService.java index 12184594c..3507bc2ed 100644 --- a/jsowell-admin/src/main/java/com/jsowell/service/TempService.java +++ b/jsowell-admin/src/main/java/com/jsowell/service/TempService.java @@ -239,7 +239,7 @@ public class TempService { weChatRefundDTO.setRefundType("1"); weChatRefundDTO.setRefundAmount(refundAmount); try { - orderBasicInfoService.weChatRefund(weChatRefundDTO); + // orderBasicInfoService.weChatRefund(weChatRefundDTO); } catch (Exception e) { logger.error("临时订单退款接口发生异常 orderCode:{}", orderBasicInfo.getOrderCode(), e); } diff --git a/jsowell-admin/src/main/java/com/jsowell/web/controller/pile/PileStationInfoController.java b/jsowell-admin/src/main/java/com/jsowell/web/controller/pile/PileStationInfoController.java index f5a6c05c1..ca0e6f5cc 100644 --- a/jsowell-admin/src/main/java/com/jsowell/web/controller/pile/PileStationInfoController.java +++ b/jsowell-admin/src/main/java/com/jsowell/web/controller/pile/PileStationInfoController.java @@ -362,7 +362,7 @@ public class PileStationInfoController extends BaseController { */ @GetMapping("/getParkingInfoList") public RestApiResponse getParkingInfoList() { - logger.info("获取停车平台列表"); + // logger.info("获取停车平台列表"); RestApiResponse response = null; try { startPage(); diff --git a/jsowell-admin/src/main/resources/application-pre.yml b/jsowell-admin/src/main/resources/application-pre.yml index 1f86a2067..2e040b713 100644 --- a/jsowell-admin/src/main/resources/application-pre.yml +++ b/jsowell-admin/src/main/resources/application-pre.yml @@ -8,7 +8,7 @@ spring: # redis 配置 redis: # 地址 - host: 127.0.0.1 + host: 106.14.94.149 # 端口,默认为6379 port: 6379 # 数据库索引 @@ -36,7 +36,7 @@ spring: druid: # 主库数据源 master: - url: jdbc:mysql://127.0.0.1:3306/jsowell_pre?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 + url: jdbc:mysql://106.14.94.149:3306/jsowell_pre?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 username: jsowell_pre password: Js@160829 # 从库数据源 diff --git a/jsowell-admin/src/test/java/SpringBootTestController.java b/jsowell-admin/src/test/java/SpringBootTestController.java index 0ed1591f2..c7bb08a7e 100644 --- a/jsowell-admin/src/test/java/SpringBootTestController.java +++ b/jsowell-admin/src/test/java/SpringBootTestController.java @@ -106,8 +106,6 @@ import java.nio.charset.StandardCharsets; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.*; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; @ActiveProfiles("dev") @@ -2922,7 +2920,7 @@ public class SpringBootTestController { dto.setRefundType("2"); dto.setMemberId("82100864"); dto.setRefundAmount(new BigDecimal("1.23")); - orderBasicInfoService.weChatRefund(dto); + // orderBasicInfoService.weChatRefund(dto); } @Test @@ -2965,7 +2963,7 @@ public class SpringBootTestController { request.setReason("结算退款"); request.setFunds_account("AVAILABLE"); - wechatPayService.ApplyForWechatPayRefundV3(request); + // wechatPayService.ApplyForWechatPayRefundV3(request); // 退款方法 diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/WechatPayService.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/WechatPayService.java index 2a0911a09..3c8bfbde0 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/WechatPayService.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/WechatPayService.java @@ -1,14 +1,5 @@ package com.jsowell.pile.service; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.jsowell.pile.dto.WeixinPayDTO; -import com.jsowell.wxpay.response.WechatPayNotifyParameter; -import com.jsowell.wxpay.response.WechatPayRefundRequest; -import com.jsowell.wxpay.response.WechatPayRefundResponse; - -import javax.servlet.http.HttpServletRequest; -import java.util.Map; - public interface WechatPayService { /** * 获取微信支付参数 @@ -16,7 +7,7 @@ public interface WechatPayService { * @return * @throws Exception */ - Map weixinPayV3(WeixinPayDTO dto) throws Exception; + // Map weixinPayV3(WeixinPayDTO dto) throws Exception; /** * 获取微信支付回调信息 @@ -25,13 +16,13 @@ public interface WechatPayService { * @return * @throws Exception */ - Map wechatPayCallbackInfo(HttpServletRequest request, WechatPayNotifyParameter body) throws Exception; + // Map wechatPayCallbackInfo(HttpServletRequest request, WechatPayNotifyParameter body) throws Exception; /** * 微信退款接口 * ApplyForARefund */ - WechatPayRefundResponse ApplyForWechatPayRefundV3(WechatPayRefundRequest request) throws JsonProcessingException; + // WechatPayRefundResponse ApplyForWechatPayRefundV3(WechatPayRefundRequest request) throws JsonProcessingException; /** * 获取微信退款回调信息 @@ -39,5 +30,5 @@ public interface WechatPayService { * @param body * @return */ - Map wechatPayRefundCallbackInfo(HttpServletRequest request, WechatPayNotifyParameter body) throws Exception; + // Map wechatPayRefundCallbackInfo(HttpServletRequest request, WechatPayNotifyParameter body) throws Exception; } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/OrderBasicInfoServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/OrderBasicInfoServiceImpl.java index b91fd9cb6..7f108361a 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/OrderBasicInfoServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/OrderBasicInfoServiceImpl.java @@ -2,7 +2,6 @@ package com.jsowell.pile.service.impl; import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSONObject; -import com.fasterxml.jackson.core.JsonProcessingException; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; @@ -1096,7 +1095,7 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService { MemberTransactionRecord transactionRecord = memberTransactionRecordService.selectByOrderCode(orderCode, ActionTypeEnum.FORWARD.getValue()); logger.info("查到该笔订单付款金额到哪里了:{}", JSON.toJSONString(transactionRecord)); if (StringUtils.equals(transactionRecord.getPaymentInstitutions(), PaymentInstitutionsEnum.WECHAT_PAY.getValue())) { - this.weChatRefund(applyRefundDTO); + // this.weChatRefund(applyRefundDTO); } else if (StringUtils.equals(transactionRecord.getPaymentInstitutions(), PaymentInstitutionsEnum.ADAPAY.getValue())) { // 汇付退款需要一级运营商的小程序appId, 否则会退款失败 String wechatAppId = pileMerchantInfoService.queryAppIdByMerchantId(orderBasicInfo.getMerchantId()); @@ -1735,11 +1734,11 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService { // 退款有两种情况 1-订单结算退款 2-用户余额退款 String refundType = dto.getRefundType(); if (StringUtils.equals(refundType, "1")) { - WechatPayRefundResponse response = refundOrderWithWechatPay(dto); - logger.info("订单结算退款 result:{}", JSON.toJSONString(response)); + // WechatPayRefundResponse response = refundOrderWithWechatPay(dto); + // logger.info("订单结算退款 result:{}", JSON.toJSONString(response)); } else if (StringUtils.equals(refundType, "2")) { - WechatPayRefundResponse response = refundBalanceWithWechatPay(dto); - logger.info("用户余额退款 result:{}", JSON.toJSONString(response)); + // WechatPayRefundResponse response = refundBalanceWithWechatPay(dto); + // logger.info("用户余额退款 result:{}", JSON.toJSONString(response)); } else { logger.warn("没有找到退款处理逻辑"); } @@ -2171,11 +2170,11 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService { request.setAmount(amount); request.setReason("订单结算退款"); request.setFunds_account("AVAILABLE"); - try { - return wechatPayService.ApplyForWechatPayRefundV3(request); - } catch (JsonProcessingException e) { - logger.error("调微信退款API发生异常", e); - } + // try { + // return wechatPayService.ApplyForWechatPayRefundV3(request); + // } catch (JsonProcessingException e) { + // logger.error("调微信退款API发生异常", e); + // } return null; } @@ -2239,12 +2238,12 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService { // 调微信退款api if (CollectionUtils.isNotEmpty(requestList)) { for (WechatPayRefundRequest refundRequest : requestList) { - try { - WechatPayRefundResponse wechatPayRefundResponse = wechatPayService.ApplyForWechatPayRefundV3(refundRequest); - logger.info("调微信退款API退款====={}", JSON.toJSONString(wechatPayRefundResponse)); - } catch (Exception e) { - logger.error("调微信退款API发生异常", e); - } + // try { + // WechatPayRefundResponse wechatPayRefundResponse = wechatPayService.ApplyForWechatPayRefundV3(refundRequest); + // logger.info("调微信退款API退款====={}", JSON.toJSONString(wechatPayRefundResponse)); + // } catch (Exception e) { + // logger.error("调微信退款API发生异常", e); + // } } } return null; diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/WechatPayServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/WechatPayServiceImpl.java index c6f103a4f..f6113f02e 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/WechatPayServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/WechatPayServiceImpl.java @@ -1,50 +1,10 @@ package com.jsowell.pile.service.impl; -import com.alibaba.fastjson2.JSON; -import com.alibaba.fastjson2.JSONObject; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.google.common.collect.Maps; -import com.jsowell.common.enums.MemberWalletEnum; -import com.jsowell.common.enums.weixin.WeiXinPayTradeStatus; -import com.jsowell.common.enums.ykc.ActionTypeEnum; -import com.jsowell.common.enums.ykc.PayModeEnum; -import com.jsowell.common.enums.ykc.PaymentInstitutionsEnum; -import com.jsowell.common.enums.ykc.ScenarioEnum; -import com.jsowell.common.util.DateUtils; -import com.jsowell.common.util.StringUtils; -import com.jsowell.common.util.id.SnowflakeIdWorker; -import com.jsowell.pile.domain.MemberTransactionRecord; -import com.jsowell.pile.domain.WxpayCallbackRecord; -import com.jsowell.pile.domain.WxpayRefundCallback; -import com.jsowell.pile.dto.PaymentScenarioDTO; -import com.jsowell.pile.dto.WeixinPayDTO; -import com.jsowell.pile.service.MemberBasicInfoService; -import com.jsowell.pile.service.MemberTransactionRecordService; -import com.jsowell.pile.service.WechatPayService; -import com.jsowell.pile.service.WxpayCallbackRecordService; -import com.jsowell.pile.service.WxpayRefundCallbackService; -import com.jsowell.pile.vo.web.UpdateMemberBalanceDTO; -import com.jsowell.wxpay.common.WeChatPayParameter; -import com.jsowell.wxpay.response.WechatPayNotifyParameter; -import com.jsowell.wxpay.response.WechatPayNotifyResource; -import com.jsowell.wxpay.response.WechatPayRefundNotifyResource; -import com.jsowell.wxpay.response.WechatPayRefundRequest; -import com.jsowell.wxpay.response.WechatPayRefundResponse; -import com.jsowell.wxpay.utils.AesUtil; -import com.jsowell.wxpay.utils.HttpUtils; -import com.jsowell.wxpay.utils.WechatPayUtils; +import com.jsowell.pile.service.*; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import javax.servlet.http.HttpServletRequest; -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.security.cert.X509Certificate; -import java.util.HashMap; -import java.util.Map; - /** * 微信支付 */ @@ -64,58 +24,58 @@ public class WechatPayServiceImpl implements WechatPayService { @Autowired private MemberTransactionRecordService memberTransactionRecordService; - @Override - public Map weixinPayV3(WeixinPayDTO dto) throws Exception { - String openId = dto.getOpenId(); - //封装请求参数 - Map paramMap = new HashMap<>(); - // 支付的产品(小程序或者公众号,主要需要和微信支付绑定哦) - paramMap.put("appid", WeChatPayParameter.appId); - // 支付的商户号 - paramMap.put("mchid", WeChatPayParameter.mchId); - // 商品描述 - paramMap.put("description", dto.getDescription()); - // 商户订单号 - paramMap.put("out_trade_no", SnowflakeIdWorker.getSnowflakeId()); - // 交易结束时间 - paramMap.put("time_expire", getTimeExpire()); - // 附加数据 - paramMap.put("attach", dto.getAttach()); - // 通知地址 - paramMap.put("notify_url", WeChatPayParameter.notifyUrl); - - Map amountMap = Maps.newHashMap(); - //订单金额 单位分 - amountMap.put("total", Integer.parseInt(getMoney(dto.getAmount()))); - amountMap.put("currency", "CNY"); - paramMap.put("amount", amountMap); - // 设置小程序所需的openid - Map payerMap = Maps.newHashMap(); - payerMap.put("openid", openId); - paramMap.put("payer", payerMap); - - ObjectMapper objectMapper = new ObjectMapper(); - String body = objectMapper.writeValueAsString(paramMap); - log.info("支付的相关参数是:{}", body); - - Map stringObjectMap = HttpUtils.doPostWexin(WeChatPayParameter.unifiedOrderUrlJS, body); - try { - return WechatPayUtils.getTokenWeixin(WeChatPayParameter.appId, String.valueOf(stringObjectMap.get("prepay_id"))); - } catch (Exception e) { - log.error("微信支付v3 error", e); - } - return null; - } + // @Override + // public Map weixinPayV3(WeixinPayDTO dto) throws Exception { + // String openId = dto.getOpenId(); + // //封装请求参数 + // Map paramMap = new HashMap<>(); + // // 支付的产品(小程序或者公众号,主要需要和微信支付绑定哦) + // paramMap.put("appid", WeChatPayParameter.appId); + // // 支付的商户号 + // paramMap.put("mchid", WeChatPayParameter.mchId); + // // 商品描述 + // paramMap.put("description", dto.getDescription()); + // // 商户订单号 + // paramMap.put("out_trade_no", SnowflakeIdWorker.getSnowflakeId()); + // // 交易结束时间 + // paramMap.put("time_expire", getTimeExpire()); + // // 附加数据 + // paramMap.put("attach", dto.getAttach()); + // // 通知地址 + // paramMap.put("notify_url", WeChatPayParameter.notifyUrl); + // + // Map amountMap = Maps.newHashMap(); + // //订单金额 单位分 + // amountMap.put("total", Integer.parseInt(getMoney(dto.getAmount()))); + // amountMap.put("currency", "CNY"); + // paramMap.put("amount", amountMap); + // // 设置小程序所需的openid + // Map payerMap = Maps.newHashMap(); + // payerMap.put("openid", openId); + // paramMap.put("payer", payerMap); + // + // ObjectMapper objectMapper = new ObjectMapper(); + // String body = objectMapper.writeValueAsString(paramMap); + // log.info("支付的相关参数是:{}", body); + // + // Map stringObjectMap = HttpUtils.doPostWexin(WeChatPayParameter.unifiedOrderUrlJS, body); + // try { + // return WechatPayUtils.getTokenWeixin(WeChatPayParameter.appId, String.valueOf(stringObjectMap.get("prepay_id"))); + // } catch (Exception e) { + // log.error("微信支付v3 error", e); + // } + // return null; + // } /** * 获取过期时间 * @return */ - private String getTimeExpire() { - long currentTimeMillis = System.currentTimeMillis(); - currentTimeMillis = currentTimeMillis + (30 * 60 * 1000); - return DateUtils.timeStampToRfc3339(currentTimeMillis); - } + // private String getTimeExpire() { + // long currentTimeMillis = System.currentTimeMillis(); + // currentTimeMillis = currentTimeMillis + (30 * 60 * 1000); + // return DateUtils.timeStampToRfc3339(currentTimeMillis); + // } /** * 元转换成分 @@ -123,53 +83,53 @@ public class WechatPayServiceImpl implements WechatPayService { * @param amount * @return */ - public static String getMoney(String amount) { - if (amount == null) { - return ""; - } - // 金额转化为分为单位 - // 处理包含, ¥ 或者$的金额 - String currency = amount.replaceAll("\\$|\\¥|\\,", ""); - int index = currency.indexOf("."); - int length = currency.length(); - Long amLong = 0L; - if (index == -1) { - amLong = Long.valueOf(currency + "00"); - } else if (length - index >= 3) { - amLong = Long.valueOf((currency.substring(0, index + 3)).replace(".", "")); - } else if (length - index == 2) { - amLong = Long.valueOf((currency.substring(0, index + 2)).replace(".", "") + 0); - } else { - amLong = Long.valueOf((currency.substring(0, index + 1)).replace(".", "") + "00"); - } - return amLong.toString(); - } + // public static String getMoney(String amount) { + // if (amount == null) { + // return ""; + // } + // // 金额转化为分为单位 + // // 处理包含, ¥ 或者$的金额 + // String currency = amount.replaceAll("\\$|\\¥|\\,", ""); + // int index = currency.indexOf("."); + // int length = currency.length(); + // Long amLong = 0L; + // if (index == -1) { + // amLong = Long.valueOf(currency + "00"); + // } else if (length - index >= 3) { + // amLong = Long.valueOf((currency.substring(0, index + 3)).replace(".", "")); + // } else if (length - index == 2) { + // amLong = Long.valueOf((currency.substring(0, index + 2)).replace(".", "") + 0); + // } else { + // amLong = Long.valueOf((currency.substring(0, index + 1)).replace(".", "") + "00"); + // } + // return amLong.toString(); + // } - public static void main(String[] args) { - String s = "{\n" + - " \"mchid\": \"1632405339\",\n" + - " \"appid\": \"wxbb3e0d474569481d\",\n" + - " \"out_trade_no\": \"823422832569454592\",\n" + - " \"transaction_id\": \"4200001841202305301676160680\",\n" + - " \"trade_type\": \"JSAPI\",\n" + - " \"trade_state\": \"SUCCESS\",\n" + - " \"trade_state_desc\": \"支付成功\",\n" + - " \"bank_type\": \"OTHERS\",\n" + - " \"attach\": \"{\\\"memberId\\\":\\\"82507801\\\",\\\"orderCode\\\":\\\"C27473779928\\\",\\\"type\\\":\\\"order\\\"}\",\n" + - " \"success_time\": \"2023-05-30T15:15:20+08:00\",\n" + - " \"payer\": {\n" + - " \"openid\": \"o4REX5FPLsLOxM2x9ig2MHuuHPqU\"\n" + - " },\n" + - " \"amount\": {\n" + - " \"total\": 5000,\n" + - " \"payer_total\": 5000,\n" + - " \"currency\": \"CNY\",\n" + - " \"payer_currency\": \"CNY\"\n" + - " }\n" + - "}"; - WechatPayNotifyResource wechatPayNotifyResource = JSON.parseObject(s, WechatPayNotifyResource.class); - System.out.println(wechatPayNotifyResource); - } + // public static void main(String[] args) { + // String s = "{\n" + + // " \"mchid\": \"1632405339\",\n" + + // " \"appid\": \"wxbb3e0d474569481d\",\n" + + // " \"out_trade_no\": \"823422832569454592\",\n" + + // " \"transaction_id\": \"4200001841202305301676160680\",\n" + + // " \"trade_type\": \"JSAPI\",\n" + + // " \"trade_state\": \"SUCCESS\",\n" + + // " \"trade_state_desc\": \"支付成功\",\n" + + // " \"bank_type\": \"OTHERS\",\n" + + // " \"attach\": \"{\\\"memberId\\\":\\\"82507801\\\",\\\"orderCode\\\":\\\"C27473779928\\\",\\\"type\\\":\\\"order\\\"}\",\n" + + // " \"success_time\": \"2023-05-30T15:15:20+08:00\",\n" + + // " \"payer\": {\n" + + // " \"openid\": \"o4REX5FPLsLOxM2x9ig2MHuuHPqU\"\n" + + // " },\n" + + // " \"amount\": {\n" + + // " \"total\": 5000,\n" + + // " \"payer_total\": 5000,\n" + + // " \"currency\": \"CNY\",\n" + + // " \"payer_currency\": \"CNY\"\n" + + // " }\n" + + // "}"; + // WechatPayNotifyResource wechatPayNotifyResource = JSON.parseObject(s, WechatPayNotifyResource.class); + // System.out.println(wechatPayNotifyResource); + // } /** * 微信支付回调 @@ -178,88 +138,88 @@ public class WechatPayServiceImpl implements WechatPayService { * @throws Exception * @return */ - @Override - public Map wechatPayCallbackInfo(HttpServletRequest request, WechatPayNotifyParameter body) throws Exception { - Map resultMap = Maps.newHashMap(); - //1:获取微信支付回调的获取签名信息 - String timestamp = request.getHeader("Wechatpay-Timestamp"); - String nonce = request.getHeader("Wechatpay-Nonce"); - ObjectMapper objectMapper = new ObjectMapper(); - // 2: 开始解析报文体 - String data = objectMapper.writeValueAsString(body); - String message = timestamp + "\n" + nonce + "\n" + data + "\n"; - //3:获取应答签名 - String sign = request.getHeader("Wechatpay-Signature"); - //4:获取平台对应的证书 - String serialNo = request.getHeader("Wechatpay-Serial"); - if (!WeChatPayParameter.certificateMap.containsKey(serialNo)) { - WeChatPayParameter.certificateMap = WechatPayUtils.refreshCertificate(); - } - X509Certificate x509Certificate = WeChatPayParameter.certificateMap.get(serialNo); - if (!WechatPayUtils.verify(x509Certificate, message.getBytes(), sign)) { - throw new IllegalArgumentException("微信支付签名验证失败:" + message); - } - // log.info("签名验证成功"); - WechatPayNotifyParameter.Resource resource = body.getResource(); - // 5:回调报文解密 - AesUtil aesUtil = new AesUtil(WeChatPayParameter.v3Key.getBytes()); - // 解密后json字符串 - String decryptToString = aesUtil.decryptToString( - resource.getAssociated_data().getBytes(), - resource.getNonce().getBytes(), - resource.getCiphertext()); - log.info("2-->decryptToString====>{}", decryptToString); - - //6:获取微信支付返回的信息 - WechatPayNotifyResource wechatPayNotifyResource = JSON.parseObject(decryptToString, WechatPayNotifyResource.class); - //7: 支付状态的判断 如果是success就代表支付成功 - if (StringUtils.equals(wechatPayNotifyResource.getTrade_state(), WeiXinPayTradeStatus.SUCCESS.getValue())) { - // 8:获取支付的交易单号,流水号,和附属参数 - String out_trade_no = wechatPayNotifyResource.getOut_trade_no(); - // 微信支付单号 - String transaction_id = wechatPayNotifyResource.getTransaction_id(); - String attach = wechatPayNotifyResource.getAttach(); - log.info("3-->微信支付成功,商户订单号是:{}, 支付订单号:{}, 附属参数是:{}", out_trade_no, transaction_id, attach); - // 转换附属参数 - PaymentScenarioDTO paymentScenarioDTO = JSONObject.parseObject(attach, PaymentScenarioDTO.class); - String type = paymentScenarioDTO.getType(); - // - BigDecimal amount = new BigDecimal(wechatPayNotifyResource.getAmount().getTotal()); - if (StringUtils.equals(type, ScenarioEnum.ORDER.getValue())) { - // 1-订单支付 - resultMap.put("orderCode", paymentScenarioDTO.getOrderCode()); - resultMap.put("memberId", paymentScenarioDTO.getMemberId()); - resultMap.put("amount", amount); - resultMap.put("type", type); - } else if (StringUtils.equals(type, ScenarioEnum.BALANCE.getValue())) { - // 2-充值余额 - resultMap.put("memberId", paymentScenarioDTO.getMemberId()); - resultMap.put("amount", amount); - resultMap.put("type", type); - } - resultMap.put("out_trade_no", out_trade_no); - resultMap.put("transaction_id", transaction_id); - // 保存微信支付记录 - WxpayCallbackRecord record = new WxpayCallbackRecord(); - record.setPayScenario(type); - record.setMemberId(paymentScenarioDTO.getMemberId()); - record.setOrderCode(paymentScenarioDTO.getOrderCode()); - record.setOutTradeNo(out_trade_no); - record.setTransactionId(transaction_id); - record.setMchId(wechatPayNotifyResource.getMchid()); - record.setAppId(wechatPayNotifyResource.getAppid()); - record.setTradeType(wechatPayNotifyResource.getTrade_type()); - record.setTradeState(wechatPayNotifyResource.getTrade_state()); - record.setTradeStateDesc(wechatPayNotifyResource.getTrade_state_desc()); - record.setBankType(wechatPayNotifyResource.getBank_type()); - record.setAttach(wechatPayNotifyResource.getAttach()); - record.setSuccessTime(DateUtils.toLocalDateTime(wechatPayNotifyResource.getSuccess_time(), DateUtils.RFC3339)); - record.setPayerOpenId(wechatPayNotifyResource.getPayer().getOpenid()); - record.setPayerTotal(wechatPayNotifyResource.getAmount().getTotal()); - wxpayCallbackRecordService.insertSelective(record); - } - return resultMap; - } + // @Override + // public Map wechatPayCallbackInfo(HttpServletRequest request, WechatPayNotifyParameter body) throws Exception { + // Map resultMap = Maps.newHashMap(); + // //1:获取微信支付回调的获取签名信息 + // String timestamp = request.getHeader("Wechatpay-Timestamp"); + // String nonce = request.getHeader("Wechatpay-Nonce"); + // ObjectMapper objectMapper = new ObjectMapper(); + // // 2: 开始解析报文体 + // String data = objectMapper.writeValueAsString(body); + // String message = timestamp + "\n" + nonce + "\n" + data + "\n"; + // //3:获取应答签名 + // String sign = request.getHeader("Wechatpay-Signature"); + // //4:获取平台对应的证书 + // String serialNo = request.getHeader("Wechatpay-Serial"); + // if (!WeChatPayParameter.certificateMap.containsKey(serialNo)) { + // WeChatPayParameter.certificateMap = WechatPayUtils.refreshCertificate(); + // } + // X509Certificate x509Certificate = WeChatPayParameter.certificateMap.get(serialNo); + // if (!WechatPayUtils.verify(x509Certificate, message.getBytes(), sign)) { + // throw new IllegalArgumentException("微信支付签名验证失败:" + message); + // } + // // log.info("签名验证成功"); + // WechatPayNotifyParameter.Resource resource = body.getResource(); + // // 5:回调报文解密 + // AesUtil aesUtil = new AesUtil(WeChatPayParameter.v3Key.getBytes()); + // // 解密后json字符串 + // String decryptToString = aesUtil.decryptToString( + // resource.getAssociated_data().getBytes(), + // resource.getNonce().getBytes(), + // resource.getCiphertext()); + // log.info("2-->decryptToString====>{}", decryptToString); + // + // //6:获取微信支付返回的信息 + // WechatPayNotifyResource wechatPayNotifyResource = JSON.parseObject(decryptToString, WechatPayNotifyResource.class); + // //7: 支付状态的判断 如果是success就代表支付成功 + // if (StringUtils.equals(wechatPayNotifyResource.getTrade_state(), WeiXinPayTradeStatus.SUCCESS.getValue())) { + // // 8:获取支付的交易单号,流水号,和附属参数 + // String out_trade_no = wechatPayNotifyResource.getOut_trade_no(); + // // 微信支付单号 + // String transaction_id = wechatPayNotifyResource.getTransaction_id(); + // String attach = wechatPayNotifyResource.getAttach(); + // log.info("3-->微信支付成功,商户订单号是:{}, 支付订单号:{}, 附属参数是:{}", out_trade_no, transaction_id, attach); + // // 转换附属参数 + // PaymentScenarioDTO paymentScenarioDTO = JSONObject.parseObject(attach, PaymentScenarioDTO.class); + // String type = paymentScenarioDTO.getType(); + // // + // BigDecimal amount = new BigDecimal(wechatPayNotifyResource.getAmount().getTotal()); + // if (StringUtils.equals(type, ScenarioEnum.ORDER.getValue())) { + // // 1-订单支付 + // resultMap.put("orderCode", paymentScenarioDTO.getOrderCode()); + // resultMap.put("memberId", paymentScenarioDTO.getMemberId()); + // resultMap.put("amount", amount); + // resultMap.put("type", type); + // } else if (StringUtils.equals(type, ScenarioEnum.BALANCE.getValue())) { + // // 2-充值余额 + // resultMap.put("memberId", paymentScenarioDTO.getMemberId()); + // resultMap.put("amount", amount); + // resultMap.put("type", type); + // } + // resultMap.put("out_trade_no", out_trade_no); + // resultMap.put("transaction_id", transaction_id); + // // 保存微信支付记录 + // WxpayCallbackRecord record = new WxpayCallbackRecord(); + // record.setPayScenario(type); + // record.setMemberId(paymentScenarioDTO.getMemberId()); + // record.setOrderCode(paymentScenarioDTO.getOrderCode()); + // record.setOutTradeNo(out_trade_no); + // record.setTransactionId(transaction_id); + // record.setMchId(wechatPayNotifyResource.getMchid()); + // record.setAppId(wechatPayNotifyResource.getAppid()); + // record.setTradeType(wechatPayNotifyResource.getTrade_type()); + // record.setTradeState(wechatPayNotifyResource.getTrade_state()); + // record.setTradeStateDesc(wechatPayNotifyResource.getTrade_state_desc()); + // record.setBankType(wechatPayNotifyResource.getBank_type()); + // record.setAttach(wechatPayNotifyResource.getAttach()); + // record.setSuccessTime(DateUtils.toLocalDateTime(wechatPayNotifyResource.getSuccess_time(), DateUtils.RFC3339)); + // record.setPayerOpenId(wechatPayNotifyResource.getPayer().getOpenid()); + // record.setPayerTotal(wechatPayNotifyResource.getAmount().getTotal()); + // wxpayCallbackRecordService.insertSelective(record); + // } + // return resultMap; + // } /** * 获取微信退款回调信息 @@ -268,119 +228,119 @@ public class WechatPayServiceImpl implements WechatPayService { * @param body * @return */ - @Override - public Map wechatPayRefundCallbackInfo(HttpServletRequest request, WechatPayNotifyParameter body) throws Exception { - //1:获取微信支付回调的获取签名信息 - String timestamp = request.getHeader("Wechatpay-Timestamp"); - String nonce = request.getHeader("Wechatpay-Nonce"); - ObjectMapper objectMapper = new ObjectMapper(); - // 2: 开始解析报文体 - String data = objectMapper.writeValueAsString(body); - String message = timestamp + "\n" + nonce + "\n" + data + "\n"; - //3:获取应答签名 - String sign = request.getHeader("Wechatpay-Signature"); - //4:获取平台对应的证书 - String serialNo = request.getHeader("Wechatpay-Serial"); - if (!WeChatPayParameter.certificateMap.containsKey(serialNo)) { - WeChatPayParameter.certificateMap = WechatPayUtils.refreshCertificate(); - } - X509Certificate x509Certificate = WeChatPayParameter.certificateMap.get(serialNo); - if (!WechatPayUtils.verify(x509Certificate, message.getBytes(), sign)) { - throw new IllegalArgumentException("微信支付签名验证失败:" + message); - } - // log.info("签名验证成功"); - WechatPayNotifyParameter.Resource resource = body.getResource(); - // 5:回调报文解密 - AesUtil aesUtil = new AesUtil(WeChatPayParameter.v3Key.getBytes()); - // 解密后json字符串 - String decryptToString = aesUtil.decryptToString( - resource.getAssociated_data().getBytes(), - resource.getNonce().getBytes(), - resource.getCiphertext()); - log.info("微信退款回调信息:{}", decryptToString); - - WechatPayRefundNotifyResource refundNotifyResource = JSONObject.parseObject(decryptToString, WechatPayRefundNotifyResource.class); - if (refundNotifyResource == null) { - return null; - } - // 查询原支付信息,获取是订单结算退款还是余额退款 - String out_trade_no = refundNotifyResource.getOut_trade_no(); - String out_refund_no = refundNotifyResource.getOut_refund_no(); - String transaction_id = refundNotifyResource.getTransaction_id(); - String refund_id = refundNotifyResource.getRefund_id(); - - WxpayCallbackRecord wxpayCallbackRecord = wxpayCallbackRecordService.selectByOutTradeNo(out_trade_no); - if (wxpayCallbackRecord == null) { - log.info("查询原支付信息为空 OutTradeNo:{}", out_trade_no); - return null; - } - - String memberId = wxpayCallbackRecord.getMemberId(); - String orderCode = wxpayCallbackRecord.getOrderCode(); - // 退款金额 单位分 - int payer_refund = refundNotifyResource.getAmount().getPayer_refund(); - // 分转成元 - BigDecimal refundAmount = new BigDecimal(payer_refund).divide(new BigDecimal(100), 2, RoundingMode.HALF_UP); - - // 收到的退款回调是退余额的,扣除会员余额 - if (StringUtils.equals(wxpayCallbackRecord.getPayScenario(), ScenarioEnum.BALANCE.getValue())) { - // 这笔支付订单原来是充值余额的,退款成功了,需要扣掉会员的本金金额 - UpdateMemberBalanceDTO dto = new UpdateMemberBalanceDTO(); - dto.setMemberId(memberId); - dto.setUpdatePrincipalBalance(refundAmount); // 更新会员本金金额,单位元 - dto.setType(MemberWalletEnum.TYPE_OUT.getValue()); - dto.setSubType(MemberWalletEnum.SUBTYPE_USER_REFUND.getValue()); - memberBasicInfoService.updateMemberBalance(dto); - } - - // 保存微信退款回调信息 - WxpayRefundCallback record = WxpayRefundCallback.builder() - .memberId(memberId) - .orderCode(orderCode) - .outTradeNo(out_trade_no) - .outRefundNo(out_refund_no) - .transactionId(transaction_id) - .mchId(refundNotifyResource.getMchid()) - .refundId(refund_id) - .refundStatus(refundNotifyResource.getRefund_status()) - .successTime(refundNotifyResource.getSuccess_time()) - .userReceivedAccount(refundNotifyResource.getUser_received_account()) - .payerTotal(refundNotifyResource.getAmount().getPayer_total() + "") - .payerRefund(payer_refund + "") // 微信支付接收单位分 - .amountTotal(refundNotifyResource.getAmount().getTotal() + "") - .amountRefund(refundNotifyResource.getAmount().getRefund() + "") - .build(); - wxpayRefundCallbackService.insertSelective(record); - - // 记录会员交易流水 - MemberTransactionRecord memberTransactionRecord = MemberTransactionRecord.builder() - .orderCode(orderCode) - .scenarioType(wxpayCallbackRecord.getPayScenario()) - .memberId(memberId) - .actionType(ActionTypeEnum.REVERSE.getValue()) - .payMode(PayModeEnum.PAYMENT_OF_WECHATPAY.getValue()) - .paymentInstitutions(PaymentInstitutionsEnum.WECHAT_PAY.getValue()) - .amount(refundAmount) // 记录会员交易流水,单位元 - .outTradeNo(out_trade_no) - .transactionId(transaction_id) - .outRefundNo(out_refund_no) - .refundId(refund_id) - .build(); - memberTransactionRecordService.insertSelective(memberTransactionRecord); - return null; - } + // @Override + // public Map wechatPayRefundCallbackInfo(HttpServletRequest request, WechatPayNotifyParameter body) throws Exception { + // //1:获取微信支付回调的获取签名信息 + // String timestamp = request.getHeader("Wechatpay-Timestamp"); + // String nonce = request.getHeader("Wechatpay-Nonce"); + // ObjectMapper objectMapper = new ObjectMapper(); + // // 2: 开始解析报文体 + // String data = objectMapper.writeValueAsString(body); + // String message = timestamp + "\n" + nonce + "\n" + data + "\n"; + // //3:获取应答签名 + // String sign = request.getHeader("Wechatpay-Signature"); + // //4:获取平台对应的证书 + // String serialNo = request.getHeader("Wechatpay-Serial"); + // if (!WeChatPayParameter.certificateMap.containsKey(serialNo)) { + // WeChatPayParameter.certificateMap = WechatPayUtils.refreshCertificate(); + // } + // X509Certificate x509Certificate = WeChatPayParameter.certificateMap.get(serialNo); + // if (!WechatPayUtils.verify(x509Certificate, message.getBytes(), sign)) { + // throw new IllegalArgumentException("微信支付签名验证失败:" + message); + // } + // // log.info("签名验证成功"); + // WechatPayNotifyParameter.Resource resource = body.getResource(); + // // 5:回调报文解密 + // AesUtil aesUtil = new AesUtil(WeChatPayParameter.v3Key.getBytes()); + // // 解密后json字符串 + // String decryptToString = aesUtil.decryptToString( + // resource.getAssociated_data().getBytes(), + // resource.getNonce().getBytes(), + // resource.getCiphertext()); + // log.info("微信退款回调信息:{}", decryptToString); + // + // WechatPayRefundNotifyResource refundNotifyResource = JSONObject.parseObject(decryptToString, WechatPayRefundNotifyResource.class); + // if (refundNotifyResource == null) { + // return null; + // } + // // 查询原支付信息,获取是订单结算退款还是余额退款 + // String out_trade_no = refundNotifyResource.getOut_trade_no(); + // String out_refund_no = refundNotifyResource.getOut_refund_no(); + // String transaction_id = refundNotifyResource.getTransaction_id(); + // String refund_id = refundNotifyResource.getRefund_id(); + // + // WxpayCallbackRecord wxpayCallbackRecord = wxpayCallbackRecordService.selectByOutTradeNo(out_trade_no); + // if (wxpayCallbackRecord == null) { + // log.info("查询原支付信息为空 OutTradeNo:{}", out_trade_no); + // return null; + // } + // + // String memberId = wxpayCallbackRecord.getMemberId(); + // String orderCode = wxpayCallbackRecord.getOrderCode(); + // // 退款金额 单位分 + // int payer_refund = refundNotifyResource.getAmount().getPayer_refund(); + // // 分转成元 + // BigDecimal refundAmount = new BigDecimal(payer_refund).divide(new BigDecimal(100), 2, RoundingMode.HALF_UP); + // + // // 收到的退款回调是退余额的,扣除会员余额 + // if (StringUtils.equals(wxpayCallbackRecord.getPayScenario(), ScenarioEnum.BALANCE.getValue())) { + // // 这笔支付订单原来是充值余额的,退款成功了,需要扣掉会员的本金金额 + // UpdateMemberBalanceDTO dto = new UpdateMemberBalanceDTO(); + // dto.setMemberId(memberId); + // dto.setUpdatePrincipalBalance(refundAmount); // 更新会员本金金额,单位元 + // dto.setType(MemberWalletEnum.TYPE_OUT.getValue()); + // dto.setSubType(MemberWalletEnum.SUBTYPE_USER_REFUND.getValue()); + // memberBasicInfoService.updateMemberBalance(dto); + // } + // + // // 保存微信退款回调信息 + // WxpayRefundCallback record = WxpayRefundCallback.builder() + // .memberId(memberId) + // .orderCode(orderCode) + // .outTradeNo(out_trade_no) + // .outRefundNo(out_refund_no) + // .transactionId(transaction_id) + // .mchId(refundNotifyResource.getMchid()) + // .refundId(refund_id) + // .refundStatus(refundNotifyResource.getRefund_status()) + // .successTime(refundNotifyResource.getSuccess_time()) + // .userReceivedAccount(refundNotifyResource.getUser_received_account()) + // .payerTotal(refundNotifyResource.getAmount().getPayer_total() + "") + // .payerRefund(payer_refund + "") // 微信支付接收单位分 + // .amountTotal(refundNotifyResource.getAmount().getTotal() + "") + // .amountRefund(refundNotifyResource.getAmount().getRefund() + "") + // .build(); + // wxpayRefundCallbackService.insertSelective(record); + // + // // 记录会员交易流水 + // MemberTransactionRecord memberTransactionRecord = MemberTransactionRecord.builder() + // .orderCode(orderCode) + // .scenarioType(wxpayCallbackRecord.getPayScenario()) + // .memberId(memberId) + // .actionType(ActionTypeEnum.REVERSE.getValue()) + // .payMode(PayModeEnum.PAYMENT_OF_WECHATPAY.getValue()) + // .paymentInstitutions(PaymentInstitutionsEnum.WECHAT_PAY.getValue()) + // .amount(refundAmount) // 记录会员交易流水,单位元 + // .outTradeNo(out_trade_no) + // .transactionId(transaction_id) + // .outRefundNo(out_refund_no) + // .refundId(refund_id) + // .build(); + // memberTransactionRecordService.insertSelective(memberTransactionRecord); + // return null; + // } /** * 微信支付 申请退款接口 */ - @Override - public WechatPayRefundResponse ApplyForWechatPayRefundV3(WechatPayRefundRequest request) throws JsonProcessingException { - ObjectMapper objectMapper = new ObjectMapper(); - String body = objectMapper.writeValueAsString(request); - log.info("申请退款的相关参数是:{}", body); - Map stringObjectMap = HttpUtils.doPostWexin(WeChatPayParameter.refundJsUrl, body); - log.info("申请退款的返回参数是:{}", stringObjectMap); - return JSON.parseObject(JSON.toJSONString(stringObjectMap), WechatPayRefundResponse.class); - } + // @Override + // public WechatPayRefundResponse ApplyForWechatPayRefundV3(WechatPayRefundRequest request) throws JsonProcessingException { + // ObjectMapper objectMapper = new ObjectMapper(); + // String body = objectMapper.writeValueAsString(request); + // log.info("申请退款的相关参数是:{}", body); + // Map stringObjectMap = HttpUtils.doPostWexin(WeChatPayParameter.refundJsUrl, body); + // log.info("申请退款的返回参数是:{}", stringObjectMap); + // return JSON.parseObject(JSON.toJSONString(stringObjectMap), WechatPayRefundResponse.class); + // } } diff --git a/jsowell-pile/src/main/java/com/jsowell/wxpay/config/WechatPayConfig.java b/jsowell-pile/src/main/java/com/jsowell/wxpay/config/WechatPayConfig.java index dd0d2391f..5bf2b3f6b 100644 --- a/jsowell-pile/src/main/java/com/jsowell/wxpay/config/WechatPayConfig.java +++ b/jsowell-pile/src/main/java/com/jsowell/wxpay/config/WechatPayConfig.java @@ -1,8 +1,6 @@ package com.jsowell.wxpay.config; -import com.jsowell.wxpay.common.WeChatPayParameter; -import com.jsowell.wxpay.utils.WechatPayUtils; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.CommandLineRunner; @@ -75,26 +73,26 @@ public class WechatPayConfig implements CommandLineRunner { /** * 商户私钥路径 */ - @Value("${wechat.key.path}") - private String wechatKeyPath; + // @Value("${wechat.key.path}") + // private String wechatKeyPath; @Override public void run(String... args) throws Exception { //微信支付 - WeChatPayParameter.mchId = wechatMchId; - WeChatPayParameter.appId = wechatAppId; - WeChatPayParameter.v3Key = wechatV3Key; - WeChatPayParameter.certificatesUrl = wechatCertificatesUrl; - WeChatPayParameter.unifiedOrderUrl = wechatUnifiedOrderUrl; - WeChatPayParameter.unifiedOrderUrlJS = wechatUnifiedOrderUrlJS; - WeChatPayParameter.notifyUrl = payCallbackUrl; - WeChatPayParameter.refundJsUrl = wechatRefundJsUrl; - WeChatPayParameter.refundNotifyUrl = refundCallbackUrl; + // WeChatPayParameter.mchId = wechatMchId; + // WeChatPayParameter.appId = wechatAppId; + // WeChatPayParameter.v3Key = wechatV3Key; + // WeChatPayParameter.certificatesUrl = wechatCertificatesUrl; + // WeChatPayParameter.unifiedOrderUrl = wechatUnifiedOrderUrl; + // WeChatPayParameter.unifiedOrderUrlJS = wechatUnifiedOrderUrlJS; + // WeChatPayParameter.notifyUrl = payCallbackUrl; + // WeChatPayParameter.refundJsUrl = wechatRefundJsUrl; + // WeChatPayParameter.refundNotifyUrl = refundCallbackUrl; //加载商户私钥 - WeChatPayParameter.privateKey = WechatPayUtils.getPrivateKey(wechatKeyPath); - WeChatPayParameter.mchSerialNo = mchSerialNo; + // WeChatPayParameter.privateKey = WechatPayUtils.getPrivateKey(wechatKeyPath); + // WeChatPayParameter.mchSerialNo = mchSerialNo; //获取平台证书 - WeChatPayParameter.certificateMap = WechatPayUtils.refreshCertificate(); + // WeChatPayParameter.certificateMap = WechatPayUtils.refreshCertificate(); log.info(">>>>>>>>>>>>>>>服务启动执行,执行加载数据等操作 WechatPayConfig order 5 <<<<<<<<<<<<<"); } } diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/ZheJiangPlatformServiceImpl.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/ZheJiangPlatformServiceImpl.java index dd31c3f36..e08b4ca01 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/ZheJiangPlatformServiceImpl.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/ZheJiangPlatformServiceImpl.java @@ -259,7 +259,7 @@ public class ZheJiangPlatformServiceImpl implements ThirdPartyPlatformService { return resultMap; } - // 获取青海平台配置密钥信息 + // 获取平台配置密钥信息 private ThirdPartySecretInfoVO getZheJiangPlatformSecretInfo() { // 通过第三方平台类型查询相关配置信息 ThirdPartySecretInfoVO thirdPartySecretInfoVO = thirdpartySecretInfoService.queryByThirdPlatformType(ThirdPlatformTypeEnum.ZHE_JIANG_PLATFORM.getTypeCode());