### Requesting WeChat Pay Certificates via cURL
Source: https://github.com/jerrychin/wechatpay-spring-boot-project/blob/main/README.md
This shell command demonstrates how to request WeChat Pay certificates using cURL. It sends a GET request to the specified endpoint and expects a JSON response.
```Shell
curl http://localhost:8080/demo/certificates
```
--------------------------------
### DemoController for Fetching WeChat Pay Certificates
Source: https://github.com/jerrychin/wechatpay-spring-boot-project/blob/main/README.md
This Java code snippet shows a `DemoController` that uses an injected `CloseableHttpClient` to fetch WeChat Pay certificates from the official API. It demonstrates how to make an HTTP GET request and process the response.
```Java
@RestController
@RequestMapping("/demo")
public class DemoController {
private final CloseableHttpClient httpClient;
public DemoController(CloseableHttpClient httpClient) {
this.httpClient = httpClient;
}
@GetMapping("/certificates")
public String getCertificates() throws URISyntaxException, IOException {
URIBuilder uriBuilder = new URIBuilder("https://api.mch.weixin.qq.com/v3/certificates");
HttpGet httpGet = new HttpGet(uriBuilder.build());
httpGet.addHeader("Accept", "application/json");
return EntityUtils.toString(httpClient.execute(httpGet).getEntity());
}
}
```
--------------------------------
### Spring Boot Application Entry Point
Source: https://github.com/jerrychin/wechatpay-spring-boot-project/blob/main/README.md
This Java code snippet shows the main class for a Spring Boot application. It uses the `@SpringBootApplication` annotation to enable auto-configuration and component scanning, and the `main` method to run the application.
```Java
@SpringBootApplication
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class,args);
}
}
```
--------------------------------
### Maven Dependencies for WechatPay Integration
Source: https://github.com/jerrychin/wechatpay-spring-boot-project/blob/main/README.md
This snippet shows the necessary Maven dependencies to include in your project's pom.xml file for WeChat Pay integration. It includes the Apache HTTP client for WeChat Pay and the Spring Boot starter module.
```XML
0.4.4
0.0.1
com.github.wechatpay-apiv3
wechatpay-apache-httpclient
${wechatpay.version}
io.github.jerrychin
wechatpay-spring-boot-starter
${wechatpay.starter.version}
```
--------------------------------
### WeChat Pay Configuration in application.properties
Source: https://github.com/jerrychin/wechatpay-spring-boot-project/blob/main/README.md
This snippet demonstrates how to configure WeChat Pay properties in your Spring Boot application's `application.properties` file. It includes essential details like merchant ID, API v3 key, merchant serial number, and private key.
```Properties
wechatpay.merchantId=1230000109
wechatpay.apiV3Key=12341234123412341234123412341234
wechatpay.merchantSerialNumber=1DDE55AD98ED71D6EDD4A4A16996DE7B47773A8C
wechatpay.merchantPrivateKey=-----BEGIN PRIVATE KEY-----
-----END PRIVATE KEY-----
logging.level.io.github.jerrychin.wechatpay=trace
```
=== COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.