|
|
@@ -100,37 +100,37 @@ func TestWeChatClient_CloseOrder(t *testing.T) {
|
|
|
fmt.Println("wxRsp:", *wxRsp)
|
|
|
}
|
|
|
|
|
|
-func TestWeChatClient_Refund(t *testing.T) {
|
|
|
- //初始化微信客户端
|
|
|
- // appId:应用ID
|
|
|
- // MchID:商户ID
|
|
|
- // ApiKey:Key值
|
|
|
- // isProd:是否是正式环境
|
|
|
- client := NewWeChatClient(AppID, MchID_iguiyu, ApiKey_iguiyu, true)
|
|
|
-
|
|
|
- //初始化参数结构体
|
|
|
- body := make(BodyMap)
|
|
|
- body.Set("out_trade_no", "97HiM5j6kGmM2fk7fYMc8MgKhPnEQ5Rk")
|
|
|
- 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", 1)
|
|
|
- body.Set("refund_fee", 1)
|
|
|
-
|
|
|
- //请求申请退款(沙箱环境下,证书路径参数可传空)
|
|
|
- // body:参数Body
|
|
|
- // certFilePath:cert证书路径
|
|
|
- // keyFilePath:Key证书路径
|
|
|
- // pkcs12FilePath:p12证书路径
|
|
|
- wxRsp, err := client.Refund(body, Cert_iguiyu+"/apiclient_cert.pem", Cert_iguiyu+"/apiclient_key.pem", Cert_iguiyu+"/apiclient_cert.p12")
|
|
|
- if err != nil {
|
|
|
- fmt.Println("Error:", err)
|
|
|
- return
|
|
|
- }
|
|
|
- fmt.Println("wxRsp:", *wxRsp)
|
|
|
-}
|
|
|
+//func TestWeChatClient_Refund(t *testing.T) {
|
|
|
+// //初始化微信客户端
|
|
|
+// // appId:应用ID
|
|
|
+// // MchID:商户ID
|
|
|
+// // ApiKey:Key值
|
|
|
+// // isProd:是否是正式环境
|
|
|
+// client := NewWeChatClient(AppID, MchID_iguiyu, ApiKey_iguiyu, true)
|
|
|
+//
|
|
|
+// //初始化参数结构体
|
|
|
+// body := make(BodyMap)
|
|
|
+// body.Set("out_trade_no", "97HiM5j6kGmM2fk7fYMc8MgKhPnEQ5Rk")
|
|
|
+// 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", 1)
|
|
|
+// body.Set("refund_fee", 1)
|
|
|
+//
|
|
|
+// //请求申请退款(沙箱环境下,证书路径参数可传空)
|
|
|
+// // body:参数Body
|
|
|
+// // certFilePath:cert证书路径
|
|
|
+// // keyFilePath:Key证书路径
|
|
|
+// // pkcs12FilePath:p12证书路径
|
|
|
+// wxRsp, err := client.Refund(body, Cert_iguiyu+"/apiclient_cert.pem", Cert_iguiyu+"/apiclient_key.pem", Cert_iguiyu+"/apiclient_cert.p12")
|
|
|
+// if err != nil {
|
|
|
+// fmt.Println("Error:", err)
|
|
|
+// return
|
|
|
+// }
|
|
|
+// fmt.Println("wxRsp:", *wxRsp)
|
|
|
+//}
|
|
|
|
|
|
func TestWeChatClient_QueryRefund(t *testing.T) {
|
|
|
//初始化微信客户端
|