aa
This commit is contained in:
@@ -29,12 +29,12 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type API struct {
|
type API struct {
|
||||||
appID string
|
appID string
|
||||||
cusID string
|
cusID string
|
||||||
appKey string
|
appKey string
|
||||||
subAppid string
|
|
||||||
client *http.Client
|
client *http.Client
|
||||||
config *platformapi.APIConfig
|
config *platformapi.APIConfig
|
||||||
}
|
}
|
||||||
|
|
||||||
type CreateUnitorderOrderParam struct {
|
type CreateUnitorderOrderParam struct {
|
||||||
@@ -110,18 +110,17 @@ type CreateH5UnitorderOrderParam struct {
|
|||||||
Body string `json:"body"`
|
Body string `json:"body"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func New(appID, appKey, cusID, subAppid string, config ...*platformapi.APIConfig) *API {
|
func New(appID, appKey, cusID string, config ...*platformapi.APIConfig) *API {
|
||||||
curConfig := platformapi.DefAPIConfig
|
curConfig := platformapi.DefAPIConfig
|
||||||
if len(config) > 0 {
|
if len(config) > 0 {
|
||||||
curConfig = *config[0]
|
curConfig = *config[0]
|
||||||
}
|
}
|
||||||
return &API{
|
return &API{
|
||||||
appID: appID,
|
appID: appID,
|
||||||
appKey: appKey,
|
appKey: appKey,
|
||||||
cusID: cusID,
|
cusID: cusID,
|
||||||
subAppid: subAppid,
|
client: &http.Client{Timeout: curConfig.ClientTimeout},
|
||||||
client: &http.Client{Timeout: curConfig.ClientTimeout},
|
config: &curConfig,
|
||||||
config: &curConfig,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -149,12 +148,6 @@ func (a *API) AccessAPI(action string, bizParams map[string]interface{}) (retVal
|
|||||||
params["randomstr"] = utils.GetUUID()
|
params["randomstr"] = utils.GetUUID()
|
||||||
params["version"] = "12"
|
params["version"] = "12"
|
||||||
params = utils.MergeMaps(params, bizParams)
|
params = utils.MergeMaps(params, bizParams)
|
||||||
if action == sepcAction {
|
|
||||||
// params["paytype"] = payType
|
|
||||||
if bizParams["paytype"] == PayTypeWxXcx {
|
|
||||||
params["sub_appid"] = a.subAppid
|
|
||||||
}
|
|
||||||
}
|
|
||||||
signStr := a.signParam(params)
|
signStr := a.signParam(params)
|
||||||
params["sign"] = signStr
|
params["sign"] = signStr
|
||||||
var fullURL string
|
var fullURL string
|
||||||
|
|||||||
Reference in New Issue
Block a user