From 1dbe3f60ea4131a7800c550d392486eda91944dc Mon Sep 17 00:00:00 2001 From: ciel yu Date: Wed, 20 Nov 2019 17:49:09 +0800 Subject: [PATCH] =?UTF-8?q?=E9=AA=8C=E7=AD=BE=E5=A2=9E=E5=8A=A0=20attach?= =?UTF-8?q?=20=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pay/notify_result.go | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/pay/notify_result.go b/pay/notify_result.go index fe04a8a..db63ef4 100644 --- a/pay/notify_result.go +++ b/pay/notify_result.go @@ -44,21 +44,24 @@ type NotifyResp struct { func (pcf *Pay) VerifySign(notifyRes NotifyResult) bool { // 封装map 请求过来的 map resMap := make(map[string]interface{}) + // base resMap["appid"] = notifyRes.AppID - resMap["bank_type"] = notifyRes.BankType - resMap["cash_fee"] = notifyRes.CashFee - resMap["fee_type"] = notifyRes.FeeType - resMap["is_subscribe"] = notifyRes.IsSubscribe resMap["mch_id"] = notifyRes.MchID resMap["nonce_str"] = notifyRes.NonceStr - resMap["openid"] = notifyRes.OpenID - resMap["out_trade_no"] = notifyRes.OutTradeNo - resMap["result_code"] = notifyRes.ResultCode + // NotifyResult resMap["return_code"] = notifyRes.ReturnCode - resMap["time_end"] = notifyRes.TimeEnd - resMap["total_fee"] = notifyRes.TotalFee + resMap["result_code"] = notifyRes.ResultCode + resMap["openid"] = notifyRes.OpenID + resMap["is_subscribe"] = notifyRes.IsSubscribe resMap["trade_type"] = notifyRes.TradeType + resMap["bank_type"] = notifyRes.BankType + resMap["total_fee"] = notifyRes.TotalFee + resMap["fee_type"] = notifyRes.FeeType + resMap["cash_fee"] = notifyRes.CashFee resMap["transaction_id"] = notifyRes.TransactionID + resMap["out_trade_no"] = notifyRes.OutTradeNo + resMap["attach"] = notifyRes.Attach + resMap["time_end"] = notifyRes.TimeEnd // 支付key sortedKeys := make([]string, 0, len(resMap)) for k := range resMap {