1
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"time"
|
||||
)
|
||||
|
||||
// PreCreateOrder 预下单生成支付信息
|
||||
@@ -13,7 +14,7 @@ func (a *API) PreCreateOrder(param *PreCreateOrderReq) (string, error) {
|
||||
}
|
||||
|
||||
param.Sign = a.sign(utils.Struct2MapByJson(param))
|
||||
result, err := a.AccessAPI2(a.FullUrl(KuaiShouPreCreateOrder), utils.Struct2MapByJson(param))
|
||||
result, err := a.AccessAPI1(a.FullUrl(KuaiShouPreCreateOrder), utils.Struct2MapByJson(param))
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
@@ -31,5 +32,8 @@ func (a *API) PreCreateOrder(param *PreCreateOrderReq) (string, error) {
|
||||
}
|
||||
|
||||
func (a *API) FullUrl(bashUrl string) string {
|
||||
if a.accessToken == "" || a.expiresIn < time.Now().Unix() {
|
||||
a.GetToken()
|
||||
}
|
||||
return fmt.Sprintf(bashUrl+"?app_id=%s&access_token=%s", a.appId, a.accessToken)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user