diff --git a/platformapi/jdapi/sku_test.go b/platformapi/jdapi/sku_test.go index cf536212..5f5a075f 100644 --- a/platformapi/jdapi/sku_test.go +++ b/platformapi/jdapi/sku_test.go @@ -29,7 +29,7 @@ func TestChangeShopCategoryOrder(t *testing.T) { } func TestGetSkuCategoryByName(t *testing.T) { - data, err := api.GetSkuCategoryBySkuName("胡萝卜") + data, err := api.GetSkuCategoryBySkuName("十一特惠七天【榴莲水果捞 榴莲肉]敲好吃约500g") globals.SugarLogger.Debugf("data:=%s", utils.Format4Output(data, false)) globals.SugarLogger.Debugf("data:=%v", err) } diff --git a/platformapi/mtwmapi/mtwmapi_test.go b/platformapi/mtwmapi/mtwmapi_test.go index bb0b73ff..176e6b4f 100644 --- a/platformapi/mtwmapi/mtwmapi_test.go +++ b/platformapi/mtwmapi/mtwmapi_test.go @@ -23,10 +23,10 @@ func init() { //api = New("589", "a81eb3df418d83d6a1a4b7c572156d2f", "", "") // 果园 - //api = New("4123", "df2c88338b85f830cebce2a9eab56628", "", "") + api = New("4123", "df2c88338b85f830cebce2a9eab56628", "", "") //商超 - api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_n49KrTnbe-Qatd-80sFOnQ") + //api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_n49KrTnbe-Qatd-80sFOnQ") //cookieStr := ` // acctId=57396785; token=0bWbK5VbK50E2BmIhIH2zHB-am_y7mB37yXHm6RLZWx4*; wmPoiId=-1; //` diff --git a/platformapi/mtwmapi/retail_test.go b/platformapi/mtwmapi/retail_test.go index 964af2bc..e3e14726 100644 --- a/platformapi/mtwmapi/retail_test.go +++ b/platformapi/mtwmapi/retail_test.go @@ -27,7 +27,7 @@ func TestRetailCatUpdate(t *testing.T) { // 测试获取门店分类列表 func TestRetailCatList(t *testing.T) { - result, err := api.RetailCatList("26242063") + result, err := api.RetailCatList("5943132") if err != nil { t.Fatal(err) } @@ -239,7 +239,7 @@ func TestBatchSetPrice(t *testing.T) { } func TestRetailDelete(t *testing.T) { - poiCode := "26242063" + poiCode := "5943132" i := 0 count := 0 diff --git a/platformapi/tonglianpayapi/tonglian_online_pay.go b/platformapi/tonglianpayapi/tonglian_online_pay.go index b2265790..b0f74b94 100644 --- a/platformapi/tonglianpayapi/tonglian_online_pay.go +++ b/platformapi/tonglianpayapi/tonglian_online_pay.go @@ -153,6 +153,30 @@ type AddTermReq struct { Sign string `json:"sign"` } +// TLQueryTerm 采集门店终端设备信息查询 +func (a *API) TLQueryTerm(param *AddTermQuery) error { + onlineReq := utils.Struct2Map(param, "", false) + result, err := a.AccessAPI2("https://vsp.allinpay.com/cusapi/merchantapi/qryterm", onlineReq) + if err != nil { + return err + } + if result["retcode"].(string) != "SUCCESS" { + return fmt.Errorf(result["retmsg"].(string)) + } + return nil +} + +type AddTermQuery struct { + Orgid string `json:"orgid"` // 集团/代理商商户号 是 共享集团号/代理商参数时必填 + Cusid string `json:"cusid"` // 商户号实际交易的商户号 否 + Appid string `json:"appid"` // 应用ID平台分配的APPID 否 + Version string `json:"version"` // 版本号接口版本号 可 + Termno string `json:"termno"` // 8位数字,商户下唯一 否 + Signtype string `json:"signtype"` + Sign string `json:"sign"` + Querytype string `json:"querytype"` +} + func (a *API) AccessAPI2(action string, bizParams map[string]interface{}) (retVal map[string]interface{}, err error) { params := make(map[string]interface{}) params["appid"] = a.appID diff --git a/platformapi/tonglianpayapi/tonglian_online_pay_test.go b/platformapi/tonglianpayapi/tonglian_online_pay_test.go index bceff7c8..954de1a4 100644 --- a/platformapi/tonglianpayapi/tonglian_online_pay_test.go +++ b/platformapi/tonglianpayapi/tonglian_online_pay_test.go @@ -102,9 +102,9 @@ func TestOrderRefund(t *testing.T) { func TestTLAddTerm(t *testing.T) { param := &AddTermReq{ - Termno: fmt.Sprintf("%d_1", 668470), - Devicetype: "10", - Termsn: fmt.Sprintf("%d_1", 668470), + Termno: fmt.Sprintf("%d00", 668470), + Devicetype: "11", + Termsn: fmt.Sprintf("%d00", 668470), Operation: "00", Termstate: "", Termaddress: fmt.Sprintf("%s-%s-%s-%s", "四川省", "成都市", "金牛区", "圃圆小筑"), @@ -115,3 +115,12 @@ func TestTLAddTerm(t *testing.T) { api.TLAddTerm(param) } + +func TestTLTLQueryTerm(t *testing.T) { + param := &AddTermQuery{ + Termno: "66847000", + Signtype: "RSA", + Sign: "", + } + api.TLQueryTerm(param) +}