Jerry 6 лет назад
Родитель
Сommit
af6fbb04bc
2 измененных файлов с 7 добавлено и 6 удалено
  1. 3 2
      constant.go
  2. 4 4
      wechat_client_test.go

+ 3 - 2
constant.go

@@ -46,9 +46,10 @@ const (
 	SignType_HMAC_SHA256 = "HMAC-SHA256"
 
 	//Debug数据
-	ApiKey    = "GFDS8j98rewnmgl45wHTt980jg543wmg"
+	ApiKey    = "fsdf"
+	ApiKey2   = "dfhfghj"
 	AppID     = "wxdaa2ab9ef87b5497"
-	APPSecret = "65f42f625a788ed52f6e2e159304879c"
+	APPSecret = "fghfghj"
 	MchID     = "1368139502"
 	MchID2    = "1526665601"
 	OpenID    = "o0Df70H2Q0fY8JXh1aFPIRyOBgu8"

+ 4 - 4
wechat_client_test.go

@@ -97,18 +97,18 @@ func TestWeChatClient_Refund(t *testing.T) {
 	//    MchID:商户ID
 	//    ApiKey:Key值
 	//    isProd:是否是正式环境
-	client := NewWeChatClient(AppID, MchID, ApiKey, true)
+	client := NewWeChatClient(AppID, MchID2, ApiKey2, true)
 
 	//初始化参数结构体
 	body := make(BodyMap)
-	body.Set("out_trade_no", "GYWX201808300559489073925369")
+	body.Set("out_trade_no", "GYWX201906262222504974571772")
 	body.Set("nonce_str", GetRandomString(32))
 	body.Set("sign_type", SignType_MD5)
 	s := GetRandomString(64)
 	fmt.Println("s:", s)
 	body.Set("out_refund_no", s)
-	body.Set("total_fee", 18)
-	body.Set("refund_fee", 18)
+	body.Set("total_fee", 500)
+	body.Set("refund_fee", 500)
 
 	//请求申请退款(沙箱环境下,证书路径参数可传空)
 	//    body:参数Body