EntryThirdRespDto 为 null 的情况

This commit is contained in:
gong
2026-01-09 16:58:26 +08:00
parent e203d7275a
commit 8cbf20e751
3 changed files with 15 additions and 13 deletions

View File

@@ -132,10 +132,10 @@ public class AlipayIsvEntryManager {
respDto.setStatus(PayCst.EntryStatus.REJECTED); respDto.setStatus(PayCst.EntryStatus.REJECTED);
respDto.setErrorMsg(object.getString(PayCst.ALIPAY_ERROR_MSG_KEY)); respDto.setErrorMsg(object.getString(PayCst.ALIPAY_ERROR_MSG_KEY));
return respDto; return respDto;
} catch (IOException e) { } catch (Exception e) {
log.error("上传图片出错", e); log.error("支付宝开启代商户签约创建应用事务异常2", e);
respDto.setStatus(PayCst.EntryStatus.REJECTED); respDto.setStatus(PayCst.EntryStatus.REJECTED);
respDto.setErrorMsg("上传图片出错"); respDto.setErrorMsg(e.getMessage());
return respDto; return respDto;
} }
} }

View File

@@ -336,11 +336,11 @@ public class WechatEntryManager {
public static void main(String[] args) throws IOException { public static void main(String[] args) throws IOException {
queryMerchantEntryStatus(null, "20220106000000000001"); // queryMerchantEntryStatus(null, "20220106000000000001");
// int offset = 0; int offset = 0;
// Integer limit = 100; Integer limit = 100;
// JSONObject resp = queryBankList(null, offset, limit); JSONObject resp = queryBankList(null, offset, limit);
// queryBankBranchList(dto, "1000009561", "110000", offset, limit); // queryBankBranchList(dto, "1000009561", "110000", offset, limit);
// queryBankBranchList(dto, "1000009561", "29", offset, limit); // queryBankBranchList(dto, "1000009561", "29", offset, limit);

View File

@@ -50,22 +50,24 @@ public class WechatReqUtils {
String authorization = String.format("WECHATPAY2-SHA256-RSA2048 mchid=\"%s\",nonce_str=\"%s\",signature=\"%s\",timestamp=\"%d\",serial_no=\"%s\"", String authorization = String.format("WECHATPAY2-SHA256-RSA2048 mchid=\"%s\",nonce_str=\"%s\",signature=\"%s\",timestamp=\"%d\",serial_no=\"%s\"",
configDto.getMerchantId(), nonce, signature, timestamp, configDto.getSerialNumber()); configDto.getMerchantId(), nonce, signature, timestamp, configDto.getSerialNumber());
HttpRequest request = switch (method) { HttpRequest request = switch (method) {
case "POST" -> HttpUtil.createPost(configDto.getDomain() + url) case "POST" -> HttpUtil.createPost(configDto.getDomain() + url)
.header("Authorization", authorization) .header("Authorization", authorization)
.header("Content-Type", "application/json") .charset(StandardCharsets.UTF_8)
.header("Wechatpay-Serial", configDto.getPublicKeyId()) .contentType("application/json")
.body(body); .body(body );
case "GET" -> HttpUtil.createGet(configDto.getDomain() + url) case "GET" -> HttpUtil.createGet(configDto.getDomain() + url)
.header("Authorization", authorization) .header("Authorization", authorization)
.header("Content-Type", "application/json") .charset(StandardCharsets.UTF_8)
.header("Wechatpay-Serial", configDto.getPublicKeyId()); .contentType("application/json");
default -> throw new CzgException("不支持的请求方法"); default -> throw new CzgException("不支持的请求方法");
}; };
log.info("微信支付请求url = {} \nauthorization: {}", url, authorization);
HttpResponse response = request.execute(); HttpResponse response = request.execute();
String s = response.body(); String s = response.body();
log.info("微信支付请求url = {}, method: {}, body: {}, resp: {}", url, method, body, s); log.info("微信支付请求url = {}\n\tmethod: {}\n\tbody: {}\n\tresp: {}", url, method, body, s);
return s; return s;
} }