xiaoyong931011
2023-05-09 aa861e83f2a7a5f99ed30d448c129c2032b71af6
src/main/java/cc/mrbird/febs/pay/controller/PayCallBackController.java
@@ -1,16 +1,12 @@
package cc.mrbird.febs.pay.controller;
import cc.mrbird.febs.common.entity.FebsResponse;
import cc.mrbird.febs.pay.properties.AliPayProperties;
import cc.mrbird.febs.pay.service.IPayService;
import com.alibaba.fastjson.JSONObject;
import cc.mrbird.febs.pay.service.AliIPayService;
import com.alipay.api.AlipayApiException;
import com.alipay.api.internal.util.AlipaySignature;
import com.ijpay.alipay.AliPayApi;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@@ -28,7 +24,7 @@
public class PayCallBackController {
    @Autowired
    private IPayService payService;
    private AliIPayService payService;
    @Resource
    private AliPayProperties aliPayProperties;
@@ -42,7 +38,7 @@
        try {
            verifyResult = AlipaySignature.verifyV1(params, aliPayProperties.getPublicKey(), "UTF-8", "RSA2");
        } catch (AlipayApiException e) {
            log.info("验证失败==");
            log.info("=验证失败=:{}", params);
            return "failure";
        }
@@ -51,11 +47,11 @@
                payService.aliCallback(params);
                return "success";
            } else {
                log.info("支付失败");
                log.info("支付失败:{}", params);
                return "failure";
            }
        } else {
            log.info("验证失败");
            log.info("验证失败:{}", params);
            return "failure";
        }
    }