Skip to content

Commit 9a97006

Browse files
wdmicOnz
andauthored
🎨 #4050 【微信支付】修复服务商模式请求付款码codepay接口返回202状态码导致响应异常的问题
Co-authored-by: Onz <dioong@dingtalk.com>
1 parent 24d20b3 commit 9a97006

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,8 @@ public String postV3WithWechatpaySerial(String url, String requestStr) throws Wx
175175
responseString = EntityUtils.toString(entity, StandardCharsets.UTF_8);
176176
}
177177

178-
if (HttpStatus.SC_OK == statusCode || HttpStatus.SC_NO_CONTENT == statusCode) {
178+
if (HttpStatus.SC_OK == statusCode || HttpStatus.SC_NO_CONTENT == statusCode
179+
|| (HttpStatus.SC_ACCEPTED == statusCode && url.endsWith("/codepay"))) {
179180
this.logRequestAndResponse(url, requestStr, responseString);
180181
return responseString;
181182
}

weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceHttpComponentsImpl.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,8 @@ public String postV3WithWechatpaySerial(String url, String requestStr) throws Wx
172172
responseString = EntityUtils.toString(entity, StandardCharsets.UTF_8);
173173
}
174174

175-
if (HttpStatus.SC_OK == statusCode || HttpStatus.SC_NO_CONTENT == statusCode) {
175+
if (HttpStatus.SC_OK == statusCode || HttpStatus.SC_NO_CONTENT == statusCode
176+
|| (HttpStatus.SC_ACCEPTED == statusCode && url.endsWith("/codepay"))) {
176177
this.logRequestAndResponse(url, requestStr, responseString);
177178
return responseString;
178179
}

0 commit comments

Comments
 (0)