This commit is contained in:
邹宗楠
2023-03-30 18:08:18 +08:00
parent de5cb4ca5e
commit 980fb17b1d
6 changed files with 104 additions and 12 deletions

View File

@@ -0,0 +1,32 @@
package kuaishou_mini
import (
"fmt"
)
// PreCreateOrder 预下单生成支付信息
//func (a *API) PreCreateOrder(param *PreCreateOrderRes) error {
// if a.appId == "" || a.appSecret == "" {
// return error
// }
//
// result, err := a.AccessAPI2(a.FullUrl(KuaiShouPreCreateOrder), utils.Struct2MapByJson(param))
// if err != nil {
// return "", "", err
// }
//
// auth := GetLoginAuth{}
// if err := utils.Map2StructByJson(result, &auth, false); err != nil {
// return "", "", err
// }
//
// if auth.Error != "" {
// return "", "", errors.New(auth.ErrorMsg)
// }
//
// return auth.SessionKey, auth.OpenId, nil
//}
func (a *API) FullUrl(bashUrl string) string {
return fmt.Sprintf(bashUrl+"?app_id=%s&access_token=%s", a.appId, a.accessToken)
}