1
0
mirror of synced 2025-12-27 05:19:07 +08:00

🎨 #2467 【微信支付】微信支付V3接口请求增加代理设置参数的支持

This commit is contained in:
无处不在2015
2021-12-27 15:53:14 +00:00
committed by Binary Wang
parent 7116fe5ae2
commit 1bda3eee15
2 changed files with 52 additions and 3 deletions

View File

@@ -10,6 +10,7 @@ import com.github.binarywang.wxpay.bean.order.WxPayNativeOrderResult;
import com.github.binarywang.wxpay.bean.request.*;
import com.github.binarywang.wxpay.bean.result.*;
import com.github.binarywang.wxpay.bean.result.enums.TradeTypeEnum;
import com.github.binarywang.wxpay.config.WxPayConfig;
import com.github.binarywang.wxpay.constant.WxPayConstants.AccountType;
import com.github.binarywang.wxpay.constant.WxPayConstants.BillType;
import com.github.binarywang.wxpay.constant.WxPayConstants.SignType;
@@ -775,4 +776,24 @@ public class BaseWxPayServiceImplTest {
System.out.println(GSON.toJson(result));
}
/**
* 测试包含正向代理的测试
* @throws WxPayException
*/
@Test
public void testQueryOrderV3WithProxy() {
try {
WxPayOrderQueryV3Request request = new WxPayOrderQueryV3Request();
request.setOutTradeNo("n1ZvYqjAg3D3LUBa");
WxPayConfig config = this.payService.getConfig();
config.setPayBaseUrl("http://api.mch.weixin.qq.com");
config.setHttpProxyHost("12.11.1.113");
config.setHttpProxyPort(8015);
WxPayOrderQueryV3Result result = this.payService.queryOrderV3(request);
System.out.println(GSON.toJson(result));
} catch (WxPayException e) {
}
}
}