升级hutool版本最新版本, 升级wxjava到最新版本并同步修改类名;

This commit is contained in:
terrfly 2024-03-06 10:20:10 +08:00
parent e09fe8f701
commit c00310c777
3 changed files with 25 additions and 27 deletions

View File

@ -18,8 +18,8 @@ package com.jeequan.jeepay.pay.channel.wxpay;
import com.alibaba.fastjson.JSONObject;
import com.github.binarywang.wxpay.bean.notify.SignatureHeader;
import com.github.binarywang.wxpay.bean.notify.WxPayNotifyResponse;
import com.github.binarywang.wxpay.bean.notify.WxPayNotifyV3Result;
import com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyResult;
import com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyV3Result;
import com.github.binarywang.wxpay.config.WxPayConfig;
import com.github.binarywang.wxpay.constant.WxPayConstants;
import com.github.binarywang.wxpay.service.WxPayService;
@ -89,7 +89,7 @@ public class WxpayChannelNoticeService extends AbstractChannelNoticeService {
}
// 验签 && 获取订单回调数据
WxPayOrderNotifyV3Result.DecryptNotifyResult result = parseOrderNotifyV3Result(request, mchAppConfigContext);
WxPayNotifyV3Result.DecryptNotifyResult result = parseOrderNotifyV3Result(request, mchAppConfigContext);
return MutablePair.of(result.getOutTradeNo(), result);
@ -133,7 +133,7 @@ public class WxpayChannelNoticeService extends AbstractChannelNoticeService {
}else if (CS.PAY_IF_VERSION.WX_V3.equals(wxServiceWrapper.getApiVersion())) { // V3
// 获取回调参数
WxPayOrderNotifyV3Result.DecryptNotifyResult result = (WxPayOrderNotifyV3Result.DecryptNotifyResult) params;
WxPayNotifyV3Result.DecryptNotifyResult result = (WxPayNotifyV3Result.DecryptNotifyResult) params;
// 验证参数
verifyWxPayParams(result, payOrder);
@ -148,7 +148,7 @@ public class WxpayChannelNoticeService extends AbstractChannelNoticeService {
}
channelResult.setChannelOrderId(result.getTransactionId()); //渠道订单号
WxPayOrderNotifyV3Result.Payer payer = result.getPayer();
WxPayNotifyV3Result.Payer payer = result.getPayer();
if (payer != null) {
channelResult.setChannelUserId(payer.getOpenid()); //支付用户ID
}
@ -199,7 +199,7 @@ public class WxpayChannelNoticeService extends AbstractChannelNoticeService {
* @param mchAppConfigContext 商户配置
* @return true:校验通过 false:校验不通过
*/
private WxPayOrderNotifyV3Result.DecryptNotifyResult parseOrderNotifyV3Result(HttpServletRequest request, MchAppConfigContext mchAppConfigContext) throws Exception {
private WxPayNotifyV3Result.DecryptNotifyResult parseOrderNotifyV3Result(HttpServletRequest request, MchAppConfigContext mchAppConfigContext) throws Exception {
SignatureHeader header = new SignatureHeader();
header.setTimeStamp(request.getHeader("Wechatpay-Timestamp"));
header.setNonce(request.getHeader("Wechatpay-Nonce"));
@ -221,7 +221,7 @@ public class WxpayChannelNoticeService extends AbstractChannelNoticeService {
wxPayConfig.setVerifier(verifier);
wxPayService.setConfig(wxPayConfig);
WxPayOrderNotifyV3Result result = wxPayService.parseOrderNotifyV3Result(params, header);
WxPayNotifyV3Result result = wxPayService.parseOrderNotifyV3Result(params, header);
return result.getResult();
}
@ -230,7 +230,7 @@ public class WxpayChannelNoticeService extends AbstractChannelNoticeService {
* V3接口验证微信支付通知参数
* @return
*/
public void verifyWxPayParams(WxPayOrderNotifyV3Result.DecryptNotifyResult result, PayOrder payOrder) {
public void verifyWxPayParams(WxPayNotifyV3Result.DecryptNotifyResult result, PayOrder payOrder) {
try {
// 核对金额

View File

@ -15,14 +15,11 @@
*/
package com.jeequan.jeepay.pay.channel.wxpay;
import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.github.binarywang.wxpay.bean.profitsharing.*;
import com.github.binarywang.wxpay.bean.profitsharingV3.ProfitSharingReceiver;
import com.github.binarywang.wxpay.bean.profitsharingV3.ProfitSharingUnfreezeRequest;
import com.github.binarywang.wxpay.bean.profitsharingV3.ProfitSharingUnfreezeResult;
import com.github.binarywang.wxpay.bean.profitsharing.request.*;
import com.github.binarywang.wxpay.bean.profitsharing.result.*;
import com.github.binarywang.wxpay.exception.WxPayException;
import com.jeequan.jeepay.core.constants.CS;
import com.jeequan.jeepay.core.entity.MchDivisionReceiver;
@ -100,7 +97,7 @@ public class WxpayDivisionService implements IDivisionService {
return ChannelRetMsg.confirmSuccess(null);
}else if (CS.PAY_IF_VERSION.WX_V3.equals(wxServiceWrapper.getApiVersion())) {
ProfitSharingReceiver profitSharingReceiver = new ProfitSharingReceiver();
ProfitSharingReceiverV3Request profitSharingReceiver = new ProfitSharingReceiverV3Request();
profitSharingReceiver.setType(mchDivisionReceiver.getAccType() == 0 ? "PERSONAL_OPENID" : "MERCHANT_ID");
profitSharingReceiver.setAccount(mchDivisionReceiver.getAccNo());
profitSharingReceiver.setName(mchDivisionReceiver.getAccName());
@ -116,7 +113,7 @@ public class WxpayDivisionService implements IDivisionService {
profitSharingReceiver.setSubMchId(isvsubMchParams.getSubMchId());
}
ProfitSharingReceiver receiver = wxServiceWrapper.getWxPayService().getProfitSharingV3Service().addProfitSharingReceiver(profitSharingReceiver);
ProfitSharingReceiverV3Result receiver = wxServiceWrapper.getWxPayService().getProfitSharingService().addReceiverV3(profitSharingReceiver);
// 明确成功
return ChannelRetMsg.confirmSuccess(null);
@ -189,7 +186,7 @@ public class WxpayDivisionService implements IDivisionService {
}else if (CS.PAY_IF_VERSION.WX_V3.equals(wxServiceWrapper.getApiVersion())) {
com.github.binarywang.wxpay.bean.profitsharingV3.ProfitSharingRequest request = new com.github.binarywang.wxpay.bean.profitsharingV3.ProfitSharingRequest();
ProfitSharingV3Request request = new ProfitSharingV3Request();
request.setTransactionId(payOrder.getChannelOrderNo());
request.setUnfreezeUnsplit(true);
@ -208,7 +205,7 @@ public class WxpayDivisionService implements IDivisionService {
request.setOutOrderNo(recordList.get(0).getBatchOrderId()); //取到批次号
}
List<ProfitSharingReceiver> receivers = new ArrayList<>();
List<ProfitSharingV3Request.Receiver> receivers = new ArrayList<>();
for (int i = 0; i < recordList.size(); i++) {
PayOrderDivisionRecord record = recordList.get(i);
@ -216,11 +213,11 @@ public class WxpayDivisionService implements IDivisionService {
continue;
}
ProfitSharingReceiver receiver = new ProfitSharingReceiver();
ProfitSharingV3Request.Receiver receiver = new ProfitSharingV3Request.Receiver();
// 0-个人 1-商户 (目前仅支持服务商appI获取个人openId, PERSONAL_OPENID 不支持 PERSONAL_SUB_OPENID )
receiver.setType(record.getAccType() == 0 ? "PERSONAL_OPENID" : "MERCHANT_ID");
receiver.setAccount(record.getAccNo());
receiver.setAmount(record.getCalDivisionAmount());
receiver.setAmount(record.getCalDivisionAmount().intValue());
receiver.setDescription(record.getPayOrderId() + "分账");
receivers.add(receiver);
}
@ -230,7 +227,8 @@ public class WxpayDivisionService implements IDivisionService {
}
request.setReceivers(receivers);
com.github.binarywang.wxpay.bean.profitsharingV3.ProfitSharingResult profitSharingResult = wxServiceWrapper.getWxPayService().getProfitSharingV3Service().profitSharing(request);
ProfitSharingV3Result profitSharingResult = wxServiceWrapper.getWxPayService().
getProfitSharingService().profitSharingV3(request);
return ChannelRetMsg.waiting();
@ -317,11 +315,11 @@ public class WxpayDivisionService implements IDivisionService {
String result = wxServiceWrapper.getWxPayService().getV3(url);
com.github.binarywang.wxpay.bean.profitsharingV3.ProfitSharingResult profitSharingResult = JSON.parseObject(result, com.github.binarywang.wxpay.bean.profitsharingV3.ProfitSharingResult.class);
ProfitSharingV3Result profitSharingResult = JSON.parseObject(result, ProfitSharingV3Result.class);
List<com.github.binarywang.wxpay.bean.profitsharingV3.ProfitSharingResult.Receiver> receivers = profitSharingResult.getReceivers();
List<ProfitSharingV3Result.Receiver> receivers = profitSharingResult.getReceivers();
for (com.github.binarywang.wxpay.bean.profitsharingV3.ProfitSharingResult.Receiver receiver : receivers) {
for (ProfitSharingV3Result.Receiver receiver : receivers) {
// 我方系统的分账接收记录ID
Long recordId = accnoAndRecordIdSet.get(receiver.getAccount());
@ -363,7 +361,7 @@ public class WxpayDivisionService implements IDivisionService {
if (CS.PAY_IF_VERSION.WX_V2.equals(wxServiceWrapper.getApiVersion())) { //V2
ProfitSharingFinishRequest request = new ProfitSharingFinishRequest();
ProfitSharingUnfreezeRequest request = new ProfitSharingUnfreezeRequest();
//放置isv信息
WxpayKit.putApiIsvInfo(mchAppConfigContext, request);
@ -378,7 +376,7 @@ public class WxpayDivisionService implements IDivisionService {
}else {
ProfitSharingUnfreezeRequest request = new ProfitSharingUnfreezeRequest();
ProfitSharingUnfreezeV3Request request = new ProfitSharingUnfreezeV3Request();
// 特约商户
if(mchAppConfigContext.isIsvsubMch()){
WxpayIsvsubMchParams isvsubMchParams =
@ -391,7 +389,7 @@ public class WxpayDivisionService implements IDivisionService {
request.setOutOrderNo(SeqKit.genDivisionBatchId());
request.setSubMchId(null);
request.setDescription("完结分账");
ProfitSharingUnfreezeResult profitSharingUnfreezeResult = wxServiceWrapper.getWxPayService().getProfitSharingV3Service().profitSharingUnfreeze(request);
ProfitSharingUnfreezeV3Result profitSharingUnfreezeResult = wxServiceWrapper.getWxPayService().getProfitSharingService().profitSharingUnfreeze(request);
// 明确成功
return profitSharingUnfreezeResult.getOrderId();

View File

@ -45,10 +45,10 @@
<jeepay.sdk.java.version>1.3.0</jeepay.sdk.java.version>
<fastjson.version>1.2.83</fastjson.version> <!-- fastjson -->
<mybatis.plus.starter.version>3.4.2</mybatis.plus.starter.version> <!-- mybatis plus -->
<hutool.util.version>5.7.16</hutool.util.version> <!-- hutool -->
<hutool.util.version>5.8.26</hutool.util.version> <!-- hutool -->
<spring.security.version>5.4.7</spring.security.version> <!-- 用于core的scope依赖 -->
<jjwt.version>0.9.1</jjwt.version>
<binarywang.weixin.java.version>4.3.9.B</binarywang.weixin.java.version>
<binarywang.weixin.java.version>4.6.0</binarywang.weixin.java.version>
<rocketmq.spring.boot.starter.version>2.2.0</rocketmq.spring.boot.starter.version>
<aliyun-openservices-ons-client.version>1.8.8.1.Final</aliyun-openservices-ons-client.version>