1
0
mirror of https://github.com/silenceper/wechat.git synced 2026-02-10 07:42:26 +08:00

feat: create mini program virtual payment (#709)

This commit is contained in:
houseme
2023-08-21 22:09:30 +08:00
committed by GitHub
parent 7df3fe1a09
commit 26b0aacb4c
12 changed files with 1216 additions and 27 deletions

View File

@@ -100,7 +100,7 @@ func PostJSON(uri string, obj interface{}) ([]byte, error) {
return PostJSONContext(context.Background(), uri, obj)
}
// PostJSONWithRespContentType post json数据请求且返回数据类型
// PostJSONWithRespContentType post json 数据请求,且返回数据类型
func PostJSONWithRespContentType(uri string, obj interface{}) ([]byte, string, error) {
jsonBuf := new(bytes.Buffer)
enc := json.NewEncoder(jsonBuf)
@@ -216,7 +216,7 @@ func PostXML(uri string, obj interface{}) ([]byte, error) {
return io.ReadAll(response.Body)
}
// httpWithTLS CA证书
// httpWithTLS CA 证书
func httpWithTLS(rootCa, key string) (*http.Client, error) {
var client *http.Client
certData, err := os.ReadFile(rootCa)
@@ -235,7 +235,7 @@ func httpWithTLS(rootCa, key string) (*http.Client, error) {
return client, nil
}
// pkcs12ToPem 将Pkcs12转成Pem
// pkcs12ToPem 将 Pkcs12 转成 Pem
func pkcs12ToPem(p12 []byte, password string) tls.Certificate {
blocks, err := pkcs12.ToPEM(p12, password)
defer func() {