From 1d271124463179d550ae64cc914f1459e19f5f58 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Thu, 14 Sep 2023 14:20:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/local_wechat/api.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lib/local_wechat/api.go b/lib/local_wechat/api.go index 2cea5d0..c4e5fff 100644 --- a/lib/local_wechat/api.go +++ b/lib/local_wechat/api.go @@ -66,6 +66,22 @@ func TradeAppRefund(client *wechat.Client, subject, transactionId, outRefundNo, } return wxRsp, resBm, nil } +func TradeAppRefundQuery(client *wechat.Client, transactionId string) (*wechat.QueryRefundResponse, gopay.BodyMap, error) { + // 初始化 BodyMap + bm := make(gopay.BodyMap) + bm.Set("transaction_id", transactionId). + Set("nonce_str", util.GetRandomString(32)). + Set("sign_type", wechat.SignType_MD5) + wxRsp, resBm, err := client.QueryRefund(bm) + fmt.Println(wxRsp) + fmt.Println(resBm) + if err != nil { + xlog.Error(err) + fmt.Println(err) + return wxRsp, resBm, err + } + return wxRsp, resBm, nil +} // TradeAppPay is 微信APP支付 func TradeAppPay(client *wechat.Client, subject, orderID, amount, notifyUrl string) (map[string]string, error) {