添加信息

fix/release
mofangmin 1 year ago
parent b9752a0210
commit 2c0d2a4f5e
  1. 6
      call/pay.go
  2. 1
      modules/pay/gopay/base.go
  3. 3
      modules/pay/grepay/base.go
  4. 1
      modules/pay/luckyinpay/base.go
  5. 3
      modules/pay/moonpay2/base.go

@ -393,6 +393,7 @@ func WithdrawCallback(order *common.WithdrawOrder) error {
// ReturnBackWithdraw 退出被拒绝或者失败,返还金币 // ReturnBackWithdraw 退出被拒绝或者失败,返还金币
func ReturnBackWithdraw(or *common.WithdrawOrder, originStatus, status uint8, payChannel ...int) error { func ReturnBackWithdraw(or *common.WithdrawOrder, originStatus, status uint8, payChannel ...int) error {
log.Info("ReturnBackWithdraw orderid:%v,originStatus:%v,status:%v", or.OrderID, originStatus, status)
order := &common.WithdrawOrder{} order := &common.WithdrawOrder{}
order.ID = or.ID order.ID = or.ID
tx := db.Mysql().Begin() tx := db.Mysql().Begin()
@ -402,11 +403,10 @@ func ReturnBackWithdraw(or *common.WithdrawOrder, originStatus, status uint8, pa
"fail_reason": or.FailReason, "fail_reason": or.FailReason,
"callback_time": time.Now().Unix(), "callback_time": time.Now().Unix(),
} }
if len(or.Operator) == 0 { if status == common.StatusROrderFail {
status = common.StatusROrderCreate status = common.StatusROrderCreate
delete(u, "callback_time") u["callback_time"] = 0
} }
if len(payChannel) > 0 { if len(payChannel) > 0 {
u["pay_channel"] = payChannel[0] u["pay_channel"] = payChannel[0]
} }

@ -122,6 +122,7 @@ func (s *Sub) CheckSign(str string) bool {
checkSign = req.Data.Sign checkSign = req.Data.Sign
s.Base.CallbackResp.OrderID = req.Data.OrderID s.Base.CallbackResp.OrderID = req.Data.OrderID
s.Base.CallbackResp.Success = req.Code == 200 s.Base.CallbackResp.Success = req.Code == 200
s.Base.CallbackResp.FailMessage = req.Message
mySign = s.Base.SignMD5(req.Data) mySign = s.Base.SignMD5(req.Data)
} else if s.Base.Opt == 4 { } else if s.Base.Opt == 4 {
req := s.Base.CallbackReq.(*WithdrawCallbackReq) req := s.Base.CallbackReq.(*WithdrawCallbackReq)

@ -163,7 +163,7 @@ func (s *Sub) CheckSign(str string) bool {
// return false // return false
// } // }
s.Base.CallbackResp.Success = req.OrdStatus == "01" s.Base.CallbackResp.Success = req.OrdStatus == "01"
s.Base.CallbackResp.FailMessage = req.OrdStatus
return strings.ToUpper(util.CalculateMD5(str+"&key="+s.Base.SignKey)) == req.Sign return strings.ToUpper(util.CalculateMD5(str+"&key="+s.Base.SignKey)) == req.Sign
} else if s.Base.Opt == base.OPTWithdrawCB { } else if s.Base.Opt == base.OPTWithdrawCB {
req := s.Base.CallbackReq.(*WithdrawCallbackReq) req := s.Base.CallbackReq.(*WithdrawCallbackReq)
@ -172,6 +172,7 @@ func (s *Sub) CheckSign(str string) bool {
// return false // return false
// } // }
s.Base.CallbackResp.Success = req.OrdStatus == "07" s.Base.CallbackResp.Success = req.OrdStatus == "07"
s.Base.CallbackResp.FailMessage = req.OrdStatus
return strings.ToUpper(util.CalculateMD5(str+"&key="+s.Base.SignKey)) == req.Sign return strings.ToUpper(util.CalculateMD5(str+"&key="+s.Base.SignKey)) == req.Sign
} }
return false return false

@ -139,6 +139,7 @@ func (s *Sub) CheckSign(_ string) bool {
log.Debug("checkSign pay:%+v", *req) log.Debug("checkSign pay:%+v", *req)
s.Base.CallbackResp.OrderID = req.MchOrderNo s.Base.CallbackResp.OrderID = req.MchOrderNo
s.Base.CallbackResp.Success = req.PayState == 2 s.Base.CallbackResp.Success = req.PayState == 2
s.Base.CallbackResp.FailMessage = req.ErrMsg
signStr := base.GetSignStr(req, s.Base.SignPassStr...) signStr := base.GetSignStr(req, s.Base.SignPassStr...)
sign, _ := base64.StdEncoding.DecodeString(req.Sign) sign, _ := base64.StdEncoding.DecodeString(req.Sign)
err := base.RsaVerify(publicKey, crypto.SHA256, []byte(signStr), sign) err := base.RsaVerify(publicKey, crypto.SHA256, []byte(signStr), sign)

@ -202,7 +202,7 @@ func (s *Sub) CheckSign(str string) bool {
return false return false
} }
s.Base.CallbackResp.Success = req.Status == 4 s.Base.CallbackResp.Success = req.Status == 4
s.Base.CallbackResp.FailMessage = req.Message
return strings.ToUpper(util.CalculateMD5(req.OrderNumber+mid+signKey)) == req.Sign return strings.ToUpper(util.CalculateMD5(req.OrderNumber+mid+signKey)) == req.Sign
} else if s.Base.Opt == base.OPTWithdrawCB { } else if s.Base.Opt == base.OPTWithdrawCB {
req := s.Base.CallbackReq.(*WithdrawCallbackReq) req := s.Base.CallbackReq.(*WithdrawCallbackReq)
@ -211,6 +211,7 @@ func (s *Sub) CheckSign(str string) bool {
return false return false
} }
s.Base.CallbackResp.Success = req.Status == 4 s.Base.CallbackResp.Success = req.Status == 4
s.Base.CallbackResp.FailMessage = req.Message
err := base.RsaDecode(req.Sign, string(publicKey)) err := base.RsaDecode(req.Sign, string(publicKey))
if err != nil { if err != nil {
log.Error("err:%v", err) log.Error("err:%v", err)

Loading…
Cancel
Save