添加汇付支付

This commit is contained in:
韩鹏辉
2024-01-17 17:18:25 +08:00
parent ad88ec4da3
commit 6dc546e727
20 changed files with 787 additions and 65 deletions

View File

@@ -186,6 +186,11 @@ public class MerchantController {
@Setter(onMethod_ = {@Autowired})
private RyxPayService ryxPayService;
@Setter(onMethod_ = {@Autowired, @Qualifier("hfPayService")})
private PayService hfPayService;
@Autowired
private UserIpRecordService ipRecordService;
@@ -1752,7 +1757,11 @@ public class MerchantController {
unionInfo=lkLPayService.getUnionInfo(userAuthCode,payMentApp,channel.getMerchantCode());
} else if (channel.getChannel() == 6) {
unionInfo = ysPayOldService.getUnionInfo(userAuthCode, payMentApp, null);
} else {
}else if(channel.getChannel()==7){
unionInfo=hfPayService.getUnionInfo(userAuthCode,payMentApp,channel.getMerchantCode());
}
else {
view.addObject("error", "未知通道类型");
return view;
}

View File

@@ -1,10 +1,14 @@
package cn.pluss.platform.controller.home;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.json.JSONUtil;
import cn.pluss.platform.klk.service.LkLPayServiceImpl;
import cn.pluss.platform.pay.PayService;
import cn.pluss.platform.ryx.pay.RyxPayService;
import cn.pluss.platform.sxf.pay.SxfPayService;
import com.alibaba.fastjson.JSONObject;
import com.huifu.adapay.core.AdapayCore;
import com.huifu.adapay.core.util.AdapaySign;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
@@ -13,6 +17,7 @@ import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Lazy;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.*;
@@ -35,6 +40,14 @@ public class PayNotifyController {
@Setter(onMethod_ = {@Autowired, @Qualifier("lkLPayService")})
private PayService lklPayService;
@Setter(onMethod_ = {@Autowired, @Qualifier("hfPayService")})
private PayService hfPayService;
@Setter(onMethod_ = {@Autowired, @Lazy})
private SxfPayService sxfPayService;
@@ -79,6 +92,46 @@ public class PayNotifyController {
@PostMapping("hfCallBack")
public String hfCallBack(HttpServletRequest request){
log.info("回调返回信息:{}", JSONUtil.toJsonStr(request.getParameterMap()));
Map<String,String> map=new HashMap<>();
try {
//验签请参data
String data = request.getParameter("data");
//验签请参sign
String sign = request.getParameter("sign");
String type=request.getParameter("type");
//验签标记
boolean checkSign;
//验签请参publicKey
String publicKey = AdapayCore.PUBLIC_KEY;
log.info("验签请参data={}sign={}");
//验签
checkSign = AdapaySign.verifySign(data, sign, publicKey);
if(checkSign){
map.put("type",type);
map.put("data",data);
Map object=(Map)hfPayService.payNotifyCallBack(map);
if(ObjectUtil.isNotEmpty(object)&&object.containsKey("code")&&"success".equals(object.get("code"))){
return "SUCCESS";
}
//验签成功逻辑
}else {
return "FAIL";
//验签失败逻辑
}
}catch (Exception e){
log.info("异步回调开始参数request={}");
}
return "FAIL";
}
}

View File

@@ -1,12 +1,12 @@
spring:
# datasource:
# druid:
# url: jdbc:mysql://101.37.12.135:3306/ysk_test?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8
# username: ysk_test
# password: CZGmysqlroot@123
# driver-class-name: com.mysql.jdbc.Driver
datasource:
url: jdbc:mysql://rm-bp19ib8x213kh9t450o.rwlb.rds.aliyuncs.com:3306/chaozhanggui?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8
username: root
password: prodCZGmysqlroot@123
driver-class-name: com.mysql.jdbc.Driver
druid:
url: jdbc:mysql://101.37.12.135:3306/ysk_test?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8
username: ysk_test
password: mysqlroot@123
driver-class-name: com.mysql.jdbc.Driver
# datasource:
# url: jdbc:mysql://rm-bp19ib8x213kh9t450o.rwlb.rds.aliyuncs.com:3306/chaozhanggui?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8
# username: root
# password: prodCZGmysqlroot@123
# driver-class-name: com.mysql.jdbc.Driver

View File

@@ -9,11 +9,11 @@ spring:
allow-bean-definition-overriding: true
profiles:
include: common, ryx, ys
active: prod
active: dev
datasource:
url: jdbc:mysql://60.205.224.68:3306/chaozhanggui?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8
username: root
password: CZGmysqlroot@123
password: sqlroot@123
driver-class-name: com.mysql.jdbc.Driver
# mvc:
@@ -39,3 +39,9 @@ jpush:
environment:
# 极光推送开发环境还是线上环境。暂未使用
develop: true
filepath: E:\\project\\chaozhanggui\\v1.0.3\\files\\
hf:
pay:
callBack: https://admintestapi.sxczgkj.cn/wap/notify/hfCallBack
environment: