Jerry %!s(int64=6) %!d(string=hai) anos
pai
achega
dcb41b8eed
Modificáronse 3 ficheiros con 4 adicións e 5 borrados
  1. 0 5
      constant.go
  2. 1 0
      release_note.txt
  3. 3 0
      wechat/service_api.go

+ 0 - 5
model.go → constant.go

@@ -9,8 +9,3 @@ const (
 	OK         = "OK"
 	Version    = "2.0.5"
 )
-
-type ReturnMessage struct {
-	ReturnCode string `json:"return_code"`
-	ReturnMsg  string `json:"return_msg"`
-}

+ 1 - 0
release_note.txt

@@ -2,6 +2,7 @@
 发布时间:2020/01/01 22:55
 修改记录:
    (1) 添加一些函数参数判空操作,避免Panic
+   (2) 去掉不用的结构体 ReturnMessage
 
 版本号:Release 2.0.4
 发布时间:2019/12/24 14:29

+ 3 - 0
wechat/service_api.go

@@ -120,6 +120,9 @@ func ParseRefundNotifyResult(req *http.Request) (notifyReq *RefundNotifyRequest,
 //    返回参数err:错误信息
 //    文档:https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=9_16&index=10
 func DecryptRefundNotifyReqInfo(reqInfo, apiKey string) (refundNotify *RefundNotify, err error) {
+	if reqInfo == gopay.NULL || apiKey == gopay.NULL {
+		return nil, errors.New("reqInfo or apiKey is null")
+	}
 	var (
 		encryptionB, bs []byte
 		block           cipher.Block