1
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user