package com.ruoyi.wx.web.unit;

import com.github.binarywang.wxpay.bean.notify.SignatureHeader;
import jakarta.servlet.http.HttpServletRequest;

public class WeixinNotifyUtils {
    /**
     * 获取请求头签名
     */
    public static SignatureHeader getSignatureHeader(HttpServletRequest request) {
        SignatureHeader signatureHeader = new SignatureHeader();
        signatureHeader.setSignature(request.getHeader("Wechatpay-Signature"));
        signatureHeader.setNonce(request.getHeader("Wechatpay-Nonce"));
        signatureHeader.setSerial(request.getHeader("Wechatpay-Serial"));
        signatureHeader.setTimeStamp(request.getHeader("Wechatpay-TimeStamp"));
        return signatureHeader;
    }
}
