Package cn.sinozg.applet.common.utils
Class PayUtil
java.lang.Object
cn.sinozg.applet.common.utils.PayUtil
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringdecryptOrder(String body) 解密订单信息static org.apache.http.impl.client.CloseableHttpClient初始化 clientBuilder和证书管理器static <T> T微信post 请求static PrivateKeystatic booleansignVerify(jakarta.servlet.http.HttpServletRequest request, String body) 验证签名private static com.wechat.pay.contrib.apache.httpclient.auth.Verifierverifier(WechatValue wechat) 获取证书验证器
-
Field Details
-
PRIVATE_KEY
-
log
private static final org.slf4j.Logger log
-
-
Constructor Details
-
PayUtil
private PayUtil()
-
-
Method Details
-
privateKeyInstance
-
httpClient
public static org.apache.http.impl.client.CloseableHttpClient httpClient()初始化 clientBuilder和证书管理器- Returns:
- CloseableHttpClient
-
signVerify
public static boolean signVerify(jakarta.servlet.http.HttpServletRequest request, String body) throws com.wechat.pay.contrib.apache.httpclient.exception.ValidationException, com.wechat.pay.contrib.apache.httpclient.exception.ParseException 验证签名- Parameters:
request- 序列号body- 请求体- Returns:
- 签名是否正确
- Throws:
com.wechat.pay.contrib.apache.httpclient.exception.ValidationExceptioncom.wechat.pay.contrib.apache.httpclient.exception.ParseException
-
verifier
获取证书验证器- Parameters:
wechat- 请求参数- Returns:
- 验证器
-
post
微信post 请求- Type Parameters:
T- 返回类型- Parameters:
url- 请求地址params- 参数clazz- 返回类型- Returns:
- 请求结果
-
decryptOrder
解密订单信息- Parameters:
body- 应答报文主体- Returns:
- 解密结果
-