wechat payment for pc is ready

This commit is contained in:
RockYang
2024-09-19 14:42:25 +08:00
parent b989199edb
commit 4d9f89f630
10 changed files with 98 additions and 106 deletions

View File

@@ -8,6 +8,7 @@ package payment
// * +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
import (
"crypto/tls"
"encoding/json"
"errors"
"fmt"
@@ -108,7 +109,13 @@ func (s *GeekPayService) sendRequest(endpoint string, params map[string]string)
apiURL := fmt.Sprintf("%s/mapi.php", endpoint)
logger.Infof(apiURL)
resp, err := http.PostForm(apiURL, form)
tr := &http.Transport{
TLSClientConfig: &tls.Config{
InsecureSkipVerify: true, // 取消 SSL 证书验证
},
}
client := &http.Client{Transport: tr}
resp, err := client.PostForm(apiURL, form)
if err != nil {
return nil, err
}