| | |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.context.annotation.PropertySource; |
| | | |
| | | import java.io.FileInputStream; |
| | | import java.nio.charset.StandardCharsets; |
| | |
| | | |
| | | |
| | | @Configuration |
| | | // @PropertySource("classpath:wxpay.properties") //读取配置文件 |
| | | @ConfigurationProperties(prefix = "wxpay") //读取wxpay节点 |
| | | @Data //使用set方法将wxpay节点中的值填充到当前类的属性中 |
| | | @Slf4j |
| | |
| | | * |
| | | * @return |
| | | */ |
| | | @Bean |
| | | // @Bean |
| | | public ScheduledUpdateCertificatesVerifier getVerifier() { |
| | | |
| | | log.info("获取签名验证器"); |
| | |
| | | * @param verifier |
| | | * @return |
| | | */ |
| | | @Bean(name = "wxPayClient") |
| | | // @Bean(name = "wxPayClient") |
| | | public CloseableHttpClient getWxPayClient(ScheduledUpdateCertificatesVerifier verifier) { |
| | | |
| | | log.info("获取httpClient"); |
| | |
| | | /** |
| | | * 获取HttpClient,无需进行应答签名验证,跳过验签的流程 |
| | | */ |
| | | @Bean(name = "wxPayNoSignClient") |
| | | // @Bean(name = "wxPayNoSignClient") |
| | | public CloseableHttpClient getWxPayNoSignClient() { |
| | | |
| | | //获取商户私钥 |