diff --git a/server/payserver/api/v1/mainservice/mainservice.go b/server/payserver/api/v1/mainservice/mainservice.go index 6c65f27..9732b8c 100644 --- a/server/payserver/api/v1/mainservice/mainservice.go +++ b/server/payserver/api/v1/mainservice/mainservice.go @@ -171,7 +171,12 @@ func (this *MainServiceApi) WxNotifyPurchase(c *gin.Context) { c.JSON(200, rspObj) return } else if !found { - c.JSON(200, rspObj) + if f5.IsOnlineEnv() { + c.JSON(200, rspObj) + } else { + rspObj.ErrorCode = 0 + rspObj.ErrMsg = "Success" + } return } @@ -228,20 +233,20 @@ func (this *MainServiceApi) WxNotifyPurchase(c *gin.Context) { return } - rspObj := struct { + gamerspObj := struct { ErrCode int64 `json:"errcode"` ErrMsg string `json:"errmsg"` }{} f5.GetSysLog().Debug("get game rsp:%s", hcr.GetRawData()) - if json.Unmarshal([]byte(hcr.GetRawData()), &rspObj) != nil { + if json.Unmarshal([]byte(hcr.GetRawData()), &gamerspObj) != nil { return } - if rspObj.ErrCode == 0 { + if gamerspObj.ErrCode == 0 { orderModel.Status = 2 orderModel.UpdateFields([]string{"status"}) - rspObj.ErrCode = 0 + rspObj.ErrorCode = 0 rspObj.ErrMsg = "Success" } })