This commit is contained in:
邹宗楠
2022-07-05 09:50:21 +08:00
parent b87d00bae4
commit 7c9d01071c

View File

@@ -181,43 +181,43 @@ func (p *PayHandler) CreateRefund() (err error) {
case model.PayTypeWX: case model.PayTypeWX:
//企业付款(提现) //企业付款(提现)
if p.VendorPayType == model.VendorPayTypeCompanyPay { if p.VendorPayType == model.VendorPayTypeCompanyPay {
// param := &wxpayapi.TransfersParam{ param := &wxpayapi.TransfersParam{
// PartnerTradeNo: p.Order.OrderID, PartnerTradeNo: p.Order.OrderID,
// CheckName: wxpayapi.CheckName, CheckName: wxpayapi.CheckName,
// Desc: "冲天猴儿app提现到账", Desc: "冲天猴儿app提现到账",
// SpbillCreateIP: p.Ctx.GetRealRemoteIP(), SpbillCreateIP: p.Ctx.GetRealRemoteIP(),
// } }
// //1元以下免费以上收取对应城市手续费 //1元以下免费以上收取对应城市手续费
// place, err := dao.GetPlaceByCode(dao.GetDB(), p.Order.CityCode) place, err := dao.GetPlaceByCode(dao.GetDB(), p.Order.CityCode)
// if err != nil || place == nil { if err != nil || place == nil {
// return fmt.Errorf("未找到该城市code%v", p.Order.CityCode) return fmt.Errorf("未找到该城市code%v", p.Order.CityCode)
// } }
// if p.Order.PayPrice < 100 { if p.Order.PayPrice < 100 {
// param.Amount = p.Order.PayPrice param.Amount = p.Order.PayPrice
// } else { } else {
// param.Amount = p.Order.PayPrice * place.DividePercentage / 100 //手续费 param.Amount = p.Order.PayPrice * place.DividePercentage / 100 //手续费
// } }
// if authInfo, err := p.Ctx.GetV2AuthInfo(); err == nil { if authInfo, err := p.Ctx.GetV2AuthInfo(); err == nil {
// param.OpenID = authInfo.GetAuthID() param.OpenID = authInfo.GetAuthID()
// } }
// globals.SugarLogger.Debugf("CreateRefund wx param: %v", utils.Format4Output(param, false)) globals.SugarLogger.Debugf("CreateRefund wx param: %v", utils.Format4Output(param, false))
// result, err2 := payMap[p.Order.Way].Transfers(param) result, err2 := payMap[p.Order.Way].Transfers(param)
// if err2 == nil { if err2 == nil {
// p.Order.PayFinishedAt = utils.Str2Time(result.PaymentTime) p.Order.PayFinishedAt = utils.Str2Time(result.PaymentTime)
// p.Order.Comment = result.DeviceInfo p.Order.Comment = result.DeviceInfo
// p.Order.OriginalData = utils.Format4Output(result, true) p.Order.OriginalData = utils.Format4Output(result, true)
// if result.ReturnMsg == "" { if result.ReturnMsg == "" {
// p.Order.Status = model.OrderStatusFinished p.Order.Status = model.OrderStatusFinished
// } else { } else {
// p.Order.Status = model.OrderStatusCanceled p.Order.Status = model.OrderStatusCanceled
// } }
// dao.UpdateEntity(dao.GetDB(), p.Order) dao.UpdateEntity(dao.GetDB(), p.Order)
// if result.ReturnMsg == "" { if result.ReturnMsg == "" {
// err = OnCashFinished(p.Order) err = OnCashFinished(p.Order)
// } }
// } else { } else {
// return err2 return err2
// } }
err = OnCashFinished(p.Order) err = OnCashFinished(p.Order)
} else if p.VendorPayType == model.VendorPayTypeTransferAccount { } else if p.VendorPayType == model.VendorPayTypeTransferAccount {
p.Order.PayFinishedAt = time.Now() p.Order.PayFinishedAt = time.Now()