|
@@ -16,7 +16,7 @@
|
|
|
* APP - app支付
|
|
* APP - app支付
|
|
|
* MWEB - H5支付
|
|
* MWEB - H5支付
|
|
|
* 查询订单
|
|
* 查询订单
|
|
|
-* 关闭订单(开发中)
|
|
|
|
|
|
|
+* 关闭订单
|
|
|
* 申请退款(开发中)
|
|
* 申请退款(开发中)
|
|
|
* 查询退款(开发中)
|
|
* 查询退款(开发中)
|
|
|
* 下载对账单(开发中)
|
|
* 下载对账单(开发中)
|
|
@@ -90,11 +90,6 @@ fmt.Println("MwebUrl:", wxRsp.MwebUrl)
|
|
|
|
|
|
|
|
### 查询订单
|
|
### 查询订单
|
|
|
```go
|
|
```go
|
|
|
-//初始化微信客户端
|
|
|
|
|
-// appId:应用ID
|
|
|
|
|
-// mchID:商户ID
|
|
|
|
|
-// secretKey:Key值
|
|
|
|
|
-// isProd:是否是正式环境
|
|
|
|
|
client := gopay.NewWeChatClient("wxd678efh567hg6787", "1230000109", "192006250b4c09247ec02edce69f6a2d", true)
|
|
client := gopay.NewWeChatClient("wxd678efh567hg6787", "1230000109", "192006250b4c09247ec02edce69f6a2d", true)
|
|
|
|
|
|
|
|
//初始化参数结构体
|
|
//初始化参数结构体
|
|
@@ -103,7 +98,7 @@ body.Set("out_trade_no", "CC68aTofMIwVKkVR5UruoBLFFXTAqBfv")
|
|
|
body.Set("nonce_str", gopay.GetRandomString(32))
|
|
body.Set("nonce_str", gopay.GetRandomString(32))
|
|
|
body.Set("sign_type", gopay.SignType_MD5)
|
|
body.Set("sign_type", gopay.SignType_MD5)
|
|
|
|
|
|
|
|
-//请求订单查询
|
|
|
|
|
|
|
+//请求查询订单
|
|
|
wxRsp, err := client.QueryOrder(body)
|
|
wxRsp, err := client.QueryOrder(body)
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
fmt.Println("Error:", err)
|
|
fmt.Println("Error:", err)
|
|
@@ -112,6 +107,25 @@ if err != nil {
|
|
|
fmt.Println("Response:", wxRsp)
|
|
fmt.Println("Response:", wxRsp)
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
|
|
+### 关闭订单
|
|
|
|
|
+```go
|
|
|
|
|
+client := gopay.NewWeChatClient("wxd678efh567hg6787", "1230000109", "192006250b4c09247ec02edce69f6a2d", true)
|
|
|
|
|
+
|
|
|
|
|
+//初始化参数结构体
|
|
|
|
|
+body := make(gopay.BodyMap)
|
|
|
|
|
+body.Set("out_trade_no", "CC68aTofMIwVKkVR5UruoBLFFXTAqBfv")
|
|
|
|
|
+body.Set("nonce_str", gopay.GetRandomString(32))
|
|
|
|
|
+body.Set("sign_type", gopay.SignType_MD5)
|
|
|
|
|
+
|
|
|
|
|
+//请求关闭订单
|
|
|
|
|
+wxRsp, err := client.CloseOrder(body)
|
|
|
|
|
+if err != nil {
|
|
|
|
|
+ fmt.Println("Error:", err)
|
|
|
|
|
+ return
|
|
|
|
|
+}
|
|
|
|
|
+fmt.Println("Response:", wxRsp)
|
|
|
|
|
+```
|
|
|
|
|
+
|
|
|
## 支付宝支付 example
|
|
## 支付宝支付 example
|
|
|
|
|
|
|
|
* Coming soon.
|
|
* Coming soon.
|