🆕 #1789 微信支付电商收付通增加下载账单的接口

This commit is contained in:
f00lish
2020-09-29 12:40:11 +08:00
committed by GitHub
parent b797152199
commit 429f1706a4
9 changed files with 292 additions and 3 deletions

View File

@@ -1,15 +1,16 @@
package com.github.binarywang.wxpay.v3.auth;
import java.io.IOException;
import com.github.binarywang.wxpay.v3.Validator;
import lombok.extern.slf4j.Slf4j;
import org.apache.http.Header;
import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.entity.ContentType;
import org.apache.http.util.EntityUtils;
import java.io.IOException;
@Slf4j
public class WxPayValidator implements Validator {
private Verifier verifier;
@@ -20,6 +21,9 @@ public class WxPayValidator implements Validator {
@Override
public final boolean validate(CloseableHttpResponse response) throws IOException {
if (!ContentType.APPLICATION_JSON.getMimeType().equals(ContentType.parse(String.valueOf(response.getFirstHeader("Content-Type").getValue())).getMimeType())) {
return true;
}
Header serialNo = response.getFirstHeader("Wechatpay-Serial");
Header sign = response.getFirstHeader("Wechatpay-Signature");
Header timestamp = response.getFirstHeader("Wechatpay-TimeStamp");