Quellcode durchsuchen

直播代码 删除直播模块的支付回调监听

yuhongqi vor 1 Monat
Ursprung
Commit
dde4e15fb1

+ 0 - 81
fs-live-app/src/main/java/com/fs/app/controller/HuifuPayController.java

@@ -1,81 +0,0 @@
-package com.fs.app.controller;
-
-import com.alibaba.fastjson.JSON;
-import com.fs.course.service.IFsUserCourseOrderService;
-import com.fs.course.service.IFsUserVipOrderService;
-import com.fs.his.service.IFsInquiryOrderService;
-import com.fs.his.service.IFsPackageOrderService;
-import com.fs.his.service.IFsStoreOrderService;
-import com.fs.huifuPay.domain.HuiFuOnlinePay;
-import com.fs.huifuPay.domain.HuiFuOnlineRefund;
-import com.fs.huifuPay.domain.HuiFuResult;
-import com.fs.live.service.ILiveOrderService;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-@RestController
-@RequestMapping(value="/app/hfPay")
-public class HuifuPayController {
-    @Autowired
-    private ILiveOrderService liveOrderService;
-    @Autowired
-    private IFsInquiryOrderService inquiryOrderService;
-    @Autowired
-    private IFsStoreOrderService storeOrderService;
-    @Autowired
-    private IFsPackageOrderService packageOrderService;
-    @Autowired
-    private IFsUserCourseOrderService courseOrderService;
-    @Autowired
-    private IFsUserVipOrderService vipOrderService;
-
-    org.slf4j.Logger logger= LoggerFactory.getLogger(getClass());
-    @RequestMapping("/payNotifyUrl")
-    public String asyncMessage(@RequestParam String resp_desc,@RequestParam String resp_code,@RequestParam String sign,@RequestParam String resp_data) {
-        HuiFuResult huiFuResult = JSON.parseObject(resp_data, HuiFuResult.class);
-        logger.info("汇付支付回调:"+huiFuResult);
-        if(huiFuResult.getResp_code().equals("00000000") && huiFuResult.getNotify_type().equals("1")){
-            String[] orderId=huiFuResult.getReq_seq_id().split("-");
-            switch (orderId[0]){
-                case "inquiry":
-                    inquiryOrderService.payConfirm("",orderId[1],huiFuResult.getHf_seq_id(),"",1);
-                    break;
-                case "store":
-                    storeOrderService.payConfirm("",orderId[1],huiFuResult.getHf_seq_id(),"",1);
-                    break;
-                case "package":
-                    packageOrderService.payConfirm("",orderId[1],huiFuResult.getHf_seq_id(),"",1);
-                    break;
-                case "course":
-                    courseOrderService.payConfirm("",orderId[1],huiFuResult.getHf_seq_id(),"",1);
-                    break;
-                case "appLive":
-                    liveOrderService.payConfirm("",orderId[1],huiFuResult.getHf_seq_id(),"",1);
-                    break;
-            }
-        }
-
-        return "ok";
-    }
-
-
-    @RequestMapping("/payOnlineNotifyUrl")
-    public String asyncHuFuOnlinePay(@RequestParam String resp_desc,@RequestParam String resp_code,@RequestParam String sign,@RequestParam String resp_data) {
-        HuiFuOnlinePay huFuResult = JSON.parseObject(resp_data, HuiFuOnlinePay.class);
-        return "ok";
-    }
-    @RequestMapping("/onlineRefund")
-    public String onlineRefund(@RequestParam String resp_desc,@RequestParam String resp_code,@RequestParam String sign,@RequestParam String resp_data) {
-        HuiFuOnlineRefund huFuResult = JSON.parseObject(resp_data, HuiFuOnlineRefund.class);
-        return "ok";
-    }
-
-    @RequestMapping("/refundNotifyUrl")
-    public String refundMessage(@RequestParam String resp_desc,@RequestParam String resp_code,@RequestParam String sign,@RequestParam String resp_data) {
-        System.out.println(resp_data);
-        return "ok";
-    }
-}

+ 0 - 87
fs-live-app/src/main/java/com/fs/app/controller/TzPayController.java

@@ -1,87 +0,0 @@
-package com.fs.app.controller;
-
-import com.fs.common.core.controller.BaseController;
-import com.fs.common.utils.spring.SpringUtils;
-import com.fs.course.service.IFsUserCourseOrderService;
-import com.fs.course.service.IFsUserVipOrderService;
-import com.fs.his.domain.FsPayConfig;
-import com.fs.his.service.IFsInquiryOrderService;
-import com.fs.his.service.IFsPackageOrderService;
-import com.fs.his.service.IFsStoreOrderService;
-import com.fs.live.service.ILiveOrderService;
-import com.fs.system.domain.SysConfig;
-import com.fs.system.mapper.SysConfigMapper;
-import com.fs.tzBankPay.doman.TzBankOrderDecrypt;
-import com.fs.tzBankPay.doman.TzBankRefundOrderDecrypt;
-import com.google.gson.Gson;
-import com.tzbank.util.CallBackUtil;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
-
-
-@RestController
-@RequestMapping("/app/tzPay")
-public class TzPayController extends BaseController
-{
-    @Autowired
-    private ILiveOrderService liveOrderService;
-    @Autowired
-    private IFsInquiryOrderService inquiryOrderService;
-    @Autowired
-    private IFsStoreOrderService storeOrderService;
-    @Autowired
-    private IFsPackageOrderService packageOrderService;
-    @Autowired
-    private IFsUserCourseOrderService courseOrderService;
-
-    @Autowired
-    private IFsUserVipOrderService userVipOrderService;
-    @RequestMapping(value = "/payNotify",method = RequestMethod.POST)
-    public String payNotify(@RequestBody String  decryptForm) throws Exception {
-        SysConfigMapper sysConfigMapper= SpringUtils.getBean(SysConfigMapper.class);
-        SysConfig sysConfig = sysConfigMapper.selectConfigByConfigKey("his.pay");
-        FsPayConfig fsPayConfig = new Gson().fromJson(sysConfig.getConfigValue(), FsPayConfig.class);
-        String decrypt = CallBackUtil.decrypt( fsPayConfig.getTzAppSecret(),decryptForm);
-        String filteredString = decrypt.replaceAll("[^\\x20-\\x7E]", "");
-        Gson gson = new Gson();
-        TzBankOrderDecrypt tzBankOrderDecrypt = gson.fromJson(filteredString, TzBankOrderDecrypt.class);
-        logger.info("台州银行支付回调:"+tzBankOrderDecrypt.getOrderFlowNo()+":"+tzBankOrderDecrypt);
-        if(tzBankOrderDecrypt.getStatus().equals("90")){
-            if(tzBankOrderDecrypt.getOrderNo().indexOf("inquiry")>-1){
-                inquiryOrderService.payConfirm("",tzBankOrderDecrypt.getOrderNo().substring(7),tzBankOrderDecrypt.getOrderFlowNo(),tzBankOrderDecrypt.getPayType(),1);
-            }
-            else if(tzBankOrderDecrypt.getOrderNo().indexOf("store")>-1){
-                storeOrderService.payConfirm("",tzBankOrderDecrypt.getOrderNo().substring(5),tzBankOrderDecrypt.getOrderFlowNo(),tzBankOrderDecrypt.getPayType(),1);
-            }
-            else if(tzBankOrderDecrypt.getOrderNo().indexOf("package")>-1){
-                packageOrderService.payConfirm("",tzBankOrderDecrypt.getOrderNo().substring(7),tzBankOrderDecrypt.getOrderFlowNo(),tzBankOrderDecrypt.getPayType(),1);
-            }
-            else if(tzBankOrderDecrypt.getOrderNo().indexOf("course")>-1){
-                courseOrderService.payConfirm("",tzBankOrderDecrypt.getOrderNo().substring(6),tzBankOrderDecrypt.getOrderFlowNo(),tzBankOrderDecrypt.getPayType(),1);
-            }
-            else if(tzBankOrderDecrypt.getOrderNo().indexOf("appvip")>-1){
-                userVipOrderService.payConfirm("",tzBankOrderDecrypt.getOrderNo().substring(6),tzBankOrderDecrypt.getOrderFlowNo(),tzBankOrderDecrypt.getPayType(),1);
-            }
-            else if(tzBankOrderDecrypt.getOrderNo().indexOf("appLive")>-1){
-                liveOrderService.payConfirm("",tzBankOrderDecrypt.getOrderNo().substring(6),tzBankOrderDecrypt.getOrderFlowNo(),tzBankOrderDecrypt.getPayType(),1);
-            }
-        }
-        return decrypt;
-    }
-
-
-    @RequestMapping(value = "/refundNotify",method = RequestMethod.POST)
-    public String refundNotify(@RequestBody String  decryptForm) throws Exception {
-        SysConfigMapper sysConfigMapper= SpringUtils.getBean(SysConfigMapper.class);
-        SysConfig sysConfig = sysConfigMapper.selectConfigByConfigKey("his.pay");
-        FsPayConfig fsPayConfig = new Gson().fromJson(sysConfig.getConfigValue(), FsPayConfig.class);
-        String decrypt = CallBackUtil.decrypt(fsPayConfig.getTzAppSecret(),decryptForm);
-        String filteredString = decrypt.replaceAll("[^\\x20-\\x7E]", "");
-        logger.info("台州银行退款回调:"+filteredString);
-        TzBankRefundOrderDecrypt o = new Gson().fromJson(filteredString, TzBankRefundOrderDecrypt.class);
-        return filteredString;
-    }
-}

+ 0 - 135
fs-live-app/src/main/java/com/fs/app/controller/WxPayController.java

@@ -1,135 +0,0 @@
-package com.fs.app.controller;
-
-
-import com.fs.common.core.controller.BaseController;
-import com.fs.common.core.domain.R;
-import com.fs.course.service.IFsCourseRedPacketLogService;
-import com.fs.course.service.IFsUserCourseOrderService;
-import com.fs.course.service.IFsUserVipOrderService;
-import com.fs.his.param.WxSendRedPacketParam;
-import com.fs.his.service.IFsInquiryOrderService;
-import com.fs.his.service.IFsPackageOrderService;
-import com.fs.his.service.IFsStoreOrderService;
-import com.fs.his.service.IFsStorePaymentService;
-import com.fs.live.service.ILiveOrderService;
-import com.fs.sop.service.ISopUserLogsInfoService;
-import com.fs.system.service.ISysConfigService;
-import com.github.binarywang.wxpay.bean.notify.WxPayNotifyResponse;
-import com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyResult;
-import com.github.binarywang.wxpay.service.WxPayService;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.apache.commons.io.IOUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-@Api("微信支付接口")
-@RestController
-@RequestMapping("/app/wxpay")
-public class WxPayController {
-    protected final Logger logger = LoggerFactory.getLogger(BaseController.class);
-    @Autowired
-    private WxPayService wxPayService;
-    @Autowired
-    private IFsInquiryOrderService inquiryOrderService;
-    @Autowired
-    private IFsStoreOrderService storeOrderService;
-    @Autowired
-    private IFsPackageOrderService packageOrderService;
-
-    @Autowired
-    private IFsUserCourseOrderService courseOrderService;
-
-    @Autowired
-    private IFsUserVipOrderService userVipOrderService;
-    @Autowired
-    private IFsStorePaymentService  paymentService;
-    @Autowired
-    private IFsCourseRedPacketLogService redPacketLogService;
-    @Autowired
-    private ISysConfigService configService;
-
-    @Autowired
-    private ISopUserLogsInfoService iSopUserLogsInfoService;
-
-    @Autowired
-    private ILiveOrderService liveOrderService;
-
-
-    /**
-     * 微信回调
-     * 回调接口代码内部自动校验结果签名和业务代码
-     * @param request
-     * @return
-     * @throws Exception
-     */
-    @ApiOperation("微信回调")
-    @PostMapping("/wxPayNotify")
-    public String wxPayNotify(HttpServletRequest request) throws Exception {
-
-        try {
-            String xmlResult = IOUtils.toString(request.getInputStream(), request.getCharacterEncoding());
-            WxPayOrderNotifyResult result = wxPayService.parseOrderNotifyResult(xmlResult);
-            System.out.println(result.getReturnCode());
-            if("SUCCESS".equals(result.getReturnCode())){
-                //订单号
-                String outtradeno = result.getOutTradeNo();
-                String tradeNo = result.getTransactionId();
-                System.out.println(outtradeno);
-                System.out.println(tradeNo);
-                String[] orderId=outtradeno.split("-");
-                switch (orderId[0]){
-                    case "inquiry":
-                        inquiryOrderService.payConfirm("",orderId[1],tradeNo,"",1);
-                    case "store":
-                        storeOrderService.payConfirm("",orderId[1],tradeNo,"",1);
-                    case "package":
-                        packageOrderService.payConfirm("",orderId[1],tradeNo,"",1);
-                    case "course":
-                        courseOrderService.payConfirm("",orderId[1],tradeNo,"",1);
-                    case "appvip":
-                        userVipOrderService.payConfirm("",orderId[1],tradeNo,"",1);
-                    case "appLive":
-                        liveOrderService.payConfirm("",orderId[1],tradeNo,"",1);
-                }
-                return WxPayNotifyResponse.success("处理成功!");
-            }else{
-                return WxPayNotifyResponse.fail("");
-            }
-
-        } catch (Exception e) {
-            logger.error("微信回调结果异常,异常原因{}", e.getMessage());
-            return WxPayNotifyResponse.fail(e.getMessage());
-        }
-    }
-
-    @PostMapping("/sendRedPacket")
-    public R sendRedPacket(@RequestBody WxSendRedPacketParam param){
-        return paymentService.sendRedPacketTest(param);
-    }
-
-    @PostMapping( "/TransferNotify")
-    public String TransferNotify(@RequestBody String notifyData,HttpServletRequest request, HttpServletResponse response) throws Exception {
-        return paymentService.transferNotify(notifyData,request);
-    }
-
-
-    @PostMapping( "/v3TransferNotify")
-    public String v3TransferNotify(@RequestBody String notifyData,HttpServletRequest request, HttpServletResponse response) throws Exception {
-        return paymentService.v3TransferNotify(notifyData,request);
-    }
-
-
-
-    @GetMapping("/test")
-    public void test(){
-        iSopUserLogsInfoService.updateSopUserInfoByExternalId(1L,123456L);
-    }
-
-
-}

+ 0 - 88
fs-live-app/src/main/java/com/fs/app/controller/YbPayController.java

@@ -1,88 +0,0 @@
-package com.fs.app.controller;
-
-import com.fs.common.core.controller.BaseController;
-import com.fs.common.exception.CustomException;
-import com.fs.common.utils.spring.SpringUtils;
-import com.fs.course.service.IFsUserCourseOrderService;
-import com.fs.course.service.IFsUserVipOrderService;
-import com.fs.his.domain.FsPayConfig;
-import com.fs.his.service.IFsInquiryOrderService;
-import com.fs.his.service.IFsPackageOrderService;
-import com.fs.his.service.IFsStoreOrderService;
-import com.fs.live.service.ILiveOrderService;
-import com.fs.system.domain.SysConfig;
-import com.fs.system.mapper.SysConfigMapper;
-import com.fs.ybPay.domain.OrderCallback;
-import com.fs.ybPay.util.PayUtil;
-import com.google.gson.Gson;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.Map;
-
-/**
- *
- *
- * @author fs
- * @date 2023-07-12
- */
-@RestController
-@RequestMapping("/app/pay")
-public class YbPayController extends BaseController
-{
-    @Autowired
-    private IFsInquiryOrderService inquiryOrderService;
-    @Autowired
-    private IFsStoreOrderService storeOrderService;
-    @Autowired
-    private IFsPackageOrderService packageOrderService;
-    @Autowired
-    private IFsUserCourseOrderService courseOrderService;
-    @Autowired
-    private IFsUserVipOrderService userVipOrderService;
-    @Autowired
-    private ILiveOrderService liveOrderService;
-    @PostMapping("/payNotify")
-    public String payNotify(@RequestBody Map<String, String> params, @RequestBody OrderCallback o) {
-        System.out.println("支付回调");
-        //验证
-        SysConfigMapper sysConfigMapper= SpringUtils.getBean(SysConfigMapper.class);
-        SysConfig sysConfig = sysConfigMapper.selectConfigByConfigKey("his.pay");
-        FsPayConfig fsPayConfig = new Gson().fromJson(sysConfig.getConfigValue(), FsPayConfig.class);
-        String sign = PayUtil.sign(params,fsPayConfig.getYbKey());
-        String sg = params.get("sign");
-        if (!sg.equals(sign)){
-            throw new CustomException("验签错误");
-        }
-        String[] orderId=o.getLowOrderId().split("-");
-        switch (orderId[0]){
-            case "inquiry":
-                inquiryOrderService.payConfirm("",orderId[1],o.getUpOrderId(),"",1);
-                break;
-            case "store":
-                storeOrderService.payConfirm("",orderId[1],o.getUpOrderId(),"",1);
-                break;
-            case "package":
-                packageOrderService.payConfirm("",orderId[1],o.getUpOrderId(),"",1);
-                break;
-            case "course":
-                courseOrderService.payConfirm("",orderId[1],o.getUpOrderId(),"",1);
-                break;
-            case "appvip":
-                userVipOrderService.payConfirm("",orderId[1],o.getUpOrderId(),"",1);
-                break;
-            case "appLive":
-                liveOrderService.payConfirm("",orderId[1],o.getUpOrderId(),"",1);
-                break;
-        }
-        System.out.println(o);
-        return "SUCCESS";
-    }
-
-
-
-
-}