1
This commit is contained in:
@@ -88,6 +88,7 @@ func (a *API) AccessAPI1(url string, params map[string]interface{}) (retVal map[
|
|||||||
err = platformapi.AccessPlatformAPIWithRetry(a.client,
|
err = platformapi.AccessPlatformAPIWithRetry(a.client,
|
||||||
func() *http.Request {
|
func() *http.Request {
|
||||||
globals.SugarLogger.Debugf("====param := %s", utils.Format4Output(params, false))
|
globals.SugarLogger.Debugf("====param := %s", utils.Format4Output(params, false))
|
||||||
|
globals.SugarLogger.Debugf("====url := %s", utils.Format4Output(url, false))
|
||||||
request, _ := http.NewRequest(http.MethodPost, url, strings.NewReader(utils.Map2URLValues(params).Encode()))
|
request, _ := http.NewRequest(http.MethodPost, url, strings.NewReader(utils.Map2URLValues(params).Encode()))
|
||||||
request.Header.Set("Content-Type", "application/json;charset=UTF-8")
|
request.Header.Set("Content-Type", "application/json;charset=UTF-8")
|
||||||
return request
|
return request
|
||||||
|
|||||||
@@ -34,11 +34,11 @@ type PreCreateOrderReq struct {
|
|||||||
TypeDetail int `json:"type"` // 商品类型,不同商品类目的编号见
|
TypeDetail int `json:"type"` // 商品类型,不同商品类目的编号见
|
||||||
ExpireTime int `json:"expire_time"` // 订单过期时间,单位秒
|
ExpireTime int `json:"expire_time"` // 订单过期时间,单位秒
|
||||||
Sign string `json:"sign"` // 签名
|
Sign string `json:"sign"` // 签名
|
||||||
//Attach string `json:"attach"` // 开发者自定义字段,回调原样回传.
|
Attach string `json:"attach"` // 开发者自定义字段,回调原样回传.
|
||||||
NotifyUrl string `json:"notify_url"` // 回调地址
|
NotifyUrl string `json:"notify_url"` // 回调地址
|
||||||
//GoodsId string `json:"goods_id"` // 下单商品id,需与商品对接 (opens new window)时的product_id一致,长度限制256个英文字符,1个汉字=2个英文字符;
|
GoodsId string `json:"goods_id"` // 下单商品id,需与商品对接 (opens new window)时的product_id一致,长度限制256个英文字符,1个汉字=2个英文字符;
|
||||||
//GoodsDetailUrl string `json:"goods_detail_url"` // 订单详情页跳转path。
|
GoodsDetailUrl string `json:"goods_detail_url"` // 订单详情页跳转path。
|
||||||
//MultiCopiesGoodsInfo string `json:"multi_copies_goods_info"` // 单商品购买多份场景 "[{"copies":2}]"
|
MultiCopiesGoodsInfo string `json:"multi_copies_goods_info"` // 单商品购买多份场景 "[{"copies":2}]"
|
||||||
CancelOrder int64 `json:"cancel_order"` // 该字段表示创建订单的同时是否覆盖之前已存在的订单。
|
CancelOrder int64 `json:"cancel_order"` // 该字段表示创建订单的同时是否覆盖之前已存在的订单。
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -76,14 +76,14 @@ func TestPreCreateOrder(t *testing.T) {
|
|||||||
OpenId: "f198f59711c9785314bf5724f7ab9f47",
|
OpenId: "f198f59711c9785314bf5724f7ab9f47",
|
||||||
TotalAmount: 501,
|
TotalAmount: 501,
|
||||||
Subject: "蔬菜水果日用品",
|
Subject: "蔬菜水果日用品",
|
||||||
Detail: "收藏门店 赠送随机小惊喜一份!1g/个 x 1件商品",
|
Detail: "好吃的素材水果",
|
||||||
TypeDetail: 1832, // 素菜
|
TypeDetail: 1832, // 素菜
|
||||||
ExpireTime: 10 * 60,
|
ExpireTime: 10 * 60,
|
||||||
Sign: "",
|
Sign: "",
|
||||||
//Attach: "22",
|
Attach: "22",
|
||||||
NotifyUrl: "https://callback-jxgy.jxc4.com/kuaishou/kuaiShouCallback",
|
NotifyUrl: "https://callback-jxgy.jxc4.com/kuaishou/kuaiShouCallback",
|
||||||
//GoodsId: "1122",
|
GoodsId: "1122",
|
||||||
//GoodsDetailUrl: "/page/index/anima",
|
GoodsDetailUrl: "/page/index/anima",
|
||||||
//MultiCopiesGoodsInfo: `[{"copies":2}]`,
|
//MultiCopiesGoodsInfo: `[{"copies":2}]`,
|
||||||
CancelOrder: 1,
|
CancelOrder: 1,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user