dromara / dromara/payment-spring-boot
【proxy】RestTemplate自定义设置代理支持
- Dominant language
- HTML
- Stars
- 851
- Forks
- 181
- PR merge metrics
- No merged PRs in 30d
Description
**描述问题**
问题原因是,生产环境部分内网机器,由于安全限制,不能直接访问公网环境,通常通过能够访问公网的机器代理出去访问,如http_prosy,https_proxy,在Java程序中也是如此,通过配置如下,以实现能够访问微信接口
```java
HttpHost proxy = new HttpHost("192.xxx.xxx.xxx", 31280);
CloseableHttpClient httpClient = HttpClientBuilder.create().setProxy(proxy).build();
```
**环境版本信息**
JDK1.8,使用版本:1.0.19.RELEASE
**期望的结果**
此处构建new WechatPayClient()时希望能够支持自定义RestTemplate()
希望增加如下代码做兼容
```java
public WechatPayClient(SignatureProvider signatureProvider, RestTemplate restTemplate) {
this.signatureProvider = signatureProvider;
this.restOperations = restTemplate;
}
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at the WechatPayClient construction path and inspect how its RestTemplate or restOperations is initialized. Add support for supplying a custom RestTemplate, then verify that requests use it and that the existing constructor behavior remains unchanged; the issue does not mention a test file.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring-boot
- Domain
- api, backend, payments
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 38/100